diff options
author | Christian Pointner <equinox@anylike.org> | 2012-09-25 11:27:20 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anylike.org> | 2012-09-25 11:27:20 +0000 |
commit | 3890b431646b895647b06b202c8e73b1cd0e3679 (patch) | |
tree | df858f308137637d57bc3854e5e68e08c719da4d /src | |
parent | fixed -Wall (diff) |
add support for clang
Diffstat (limited to 'src')
-rwxr-xr-x | src/configure | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/configure b/src/configure index 680d22e..2dfb56d 100755 --- a/src/configure +++ b/src/configure @@ -32,8 +32,7 @@ TARGET=`uname -s` EBUILD_COMPAT=0 -CFLAGS='-g -Wall -O2' -LDFLAGS='-g -Wall -O2 -lm' +USE_CLANG=0 CRYPTO_LIB='gnutls' LUA_DIR='' @@ -60,6 +59,7 @@ print_usage() { echo " --no-examples dont't install example files" echo " --use-openssl use openssl instead of gnutls" echo " --with-lua=<DIR> use this lua tree instead of system default" + echo " --use-clang use clang/llvm as compiler/linker" } for arg @@ -80,6 +80,9 @@ do --mandir=*) MANDIR=${arg#--mandir=} ;; + --use-clang) + USE_CLANG=1 + ;; --no-manpage) INSTALLMANPAGE=0 ;; @@ -117,6 +120,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 -lm' + COMPILER='gcc' +else + CFLAGS='-g -O2' + LDFLAGS='-g -O2 -lm' + COMPILER='clang' +fi + rm -f version.h rm -f include.mk case $TARGET in @@ -244,7 +257,7 @@ cat > include.mk <<EOF # use ./configure instead TARGET := '$TARGET' -CC := gcc +CC := $COMPILER CFLAGS := $CFLAGS LDFLAGS := $LDFLAGS LUA := '$LUA' |