summaryrefslogtreecommitdiff
path: root/src/configure
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2014-06-22 23:47:20 +0000
committerChristian Pointner <equinox@anytun.org>2014-06-22 23:47:20 +0000
commitbcb7bacbfefac35ebe27b8ded9cc94663478081f (patch)
treedb6c54f1bc13e96fddac438dcdff1a53ce574f16 /src/configure
parentmerged nettle featuer branch to trunk (diff)
parentadded support for clang (diff)
merged clang branch
Diffstat (limited to 'src/configure')
-rwxr-xr-xsrc/configure22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/configure b/src/configure
index a8fe6b1..4c84a9d 100755
--- a/src/configure
+++ b/src/configure
@@ -35,10 +35,10 @@ TARGET=`uname -s`
EBUILD_COMPAT=0
-CXXFLAGS='-g -Wall -O2'
-LDFLAGS='-g -Wall -O2'
CROSS_PREFIX=''
+USE_CLANG=0
+
CRYPTO_LIB='gcrypt'
PASSPHRASE=1
ROUTING=1
@@ -81,6 +81,7 @@ print_usage() {
echo " --with-gcrypt=<PREFIX> don't use systemwide gcrypt"
echo " --with-nettle=<PREFIX> don't use systemwide nettle"
echo " --with-openssl=<PREFIX> don't use systemwide openssl"
+ echo " --use-clang use clang/llvm as compiler/linker"
}
for arg
@@ -89,6 +90,9 @@ do
--target=*)
TARGET=${arg#--target=}
;;
+ --use-clang)
+ USE_CLANG=1
+ ;;
--prefix=*)
PREFIX=${arg#--prefix=}
;;
@@ -174,6 +178,16 @@ if [ -n "$ERRORS" ] && [ $EBUILD_COMPAT -ne 1 ]; then
exit 1
fi
+if [ $USE_CLANG -eq 0 ]; then
+ CXXFLAGS='-g -Wall -O2'
+ LDFLAGS='-g -Wall -O2'
+ COMPILER='g++'
+else
+ CXXFLAGS='-g -O2'
+ LDFLAGS='-g -O2'
+ COMPILER='clang++'
+fi
+
rm -f include.mk
rm -f version.h
case $TARGET in
@@ -299,9 +313,9 @@ cat > include.mk <<EOF
# use ./configure instead
TARGET = $TARGET
-CXX = ${CROSS_PREFIX}g++
+CXX = ${CROSS_PREFIX}$COMPILER
CXXFLAGS = $CXXFLAGS
-LD = ${CROSS_PREFIX}g++
+LD = ${CROSS_PREFIX}$COMPILER
LDFLAGS = $LDFLAGS
STRIP = ${CROSS_PREFIX}strip
INSTALL = install