summaryrefslogtreecommitdiff
path: root/src/configure
diff options
context:
space:
mode:
Diffstat (limited to 'src/configure')
-rwxr-xr-xsrc/configure21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/configure b/src/configure
index 90bd304..aa9cb83 100755
--- a/src/configure
+++ b/src/configure
@@ -29,8 +29,7 @@
TARGET=`uname -s`
EBUILD_COMPAT=0
-CFLAGS='-g -O2'
-LDFLAGS='-g -Wall -O2'
+USE_CLANG=0
PREFIX='/usr/local'
BINDIR=''
@@ -50,6 +49,7 @@ print_usage() {
echo " --no-manpage dont't install manpage"
echo " --examplesdir=<DIR> the path to the examples files (default: $PREFIX/share/examples)"
echo " --no-examples dont't install example files"
+ echo " --use-clang use clang/llvm as compiler/linker"
}
for arg
@@ -58,6 +58,9 @@ do
--target=*)
TARGET=${arg#--target=}
;;
+ --use-clang)
+ USE_CLANG=1
+ ;;
--prefix=*)
PREFIX=${arg#--prefix=}
;;
@@ -101,6 +104,16 @@ if [ -n "$ERRORS" ] && [ $EBUILD_COMPAT -ne 1 ]; then
exit 1
fi
+if [ $USE_CLANG -eq 0 ]; then
+ CFLAGS='-g -Wall -O2'
+ LDFLAGS='-g -Wall -O2'
+ COMPILER='gcc'
+else
+ CFLAGS='-g -O2'
+ LDFLAGS='-g -O2'
+ COMPILER='clang'
+fi
+
rm -f config.h
rm -f include.mk
case $TARGET in
@@ -137,8 +150,8 @@ cat > include.mk <<EOF
# do not edit this file directly
# use ./configure instead
-TARGET := '$TARGET'
-CC := gcc
+TARGET := $TARGET
+CC := $COMPILER
CFLAGS := $CFLAGS
LDFLAGS := $LDFLAGS
STRIP := strip