From 0b635145d3a16f4e6bb4182956917a320afc1bd7 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 7 Oct 2013 11:37:35 +0000 Subject: fixed build with -Wall added build support for clang git-svn-id: https://svn.spreadspace.org/tcpproxy/trunk@67 e61f0598-a718-4e21-a8f0-0aadfa62ad6b --- src/configure | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/configure') 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= 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 <