summaryrefslogtreecommitdiff
path: root/src/configure
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2013-10-07 11:37:35 +0000
committerChristian Pointner <equinox@spreadspace.org>2013-10-07 11:37:35 +0000
commit0b635145d3a16f4e6bb4182956917a320afc1bd7 (patch)
tree83a56b7225f564a1a6d3c3a12a7f4dab3505ceff /src/configure
parentconfigure cleanup (diff)
fixed build with -Wall
added build support for clang git-svn-id: https://svn.spreadspace.org/tcpproxy/trunk@67 e61f0598-a718-4e21-a8f0-0aadfa62ad6b
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