diff options
author | Christian Pointner <equinox@anytun.org> | 2012-09-25 11:55:47 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2012-09-25 11:55:47 +0000 |
commit | b85d2641b20159f25a4416d7c1322ec98c04eb0c (patch) | |
tree | 42779543116fee6f8963e1b172e767871bd1aed8 /src/configure | |
parent | -Wall cleanup (diff) |
added clang support
Diffstat (limited to 'src/configure')
-rwxr-xr-x | src/configure | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/configure b/src/configure index d91b396..d2f60a8 100755 --- a/src/configure +++ b/src/configure @@ -35,11 +35,9 @@ # TARGET=`uname -s` - EBUILD_COMPAT=0 -CFLAGS='-g -Wall -O2' -LDFLAGS='-g -Wall -O2' +USE_CLANG=0 CRYPTO_LIB='gcrypt' PASSPHRASE=1 @@ -66,6 +64,7 @@ print_usage() { echo " --no-crypto disable crypto at all (only NULL cipher)" echo " --disable-passphrase disable master key and salt passphrase" echo " --enable-passphrase enable master key and salt passphrase" + echo " --use-clang use clang/llvm as compiler/linker" } for arg @@ -74,6 +73,9 @@ do --target=*) TARGET=${arg#--target=} ;; + --use-clang) + USE_CLANG=1 + ;; --prefix=*) PREFIX=${arg#--prefix=} ;; @@ -129,6 +131,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 version.h rm -f include.mk case $TARGET in @@ -194,7 +206,7 @@ cat > include.mk <<EOF # use ./configure instead TARGET := $TARGET -CC := gcc +CC := $COMPILER CFLAGS := $CFLAGS LDFLAGS := $LDFLAGS STRIP := strip |