diff options
author | Christian Pointner <equinox@helsinki.at> | 2013-09-16 11:24:18 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2013-09-16 11:24:18 (GMT) |
commit | ba9fe029984b9b1614bdfc81072a3e95675bd74a (patch) | |
tree | 2521a68e3f491d9630c12b4d527131d751232162 /configure | |
parent | 6883f491a3b401dd79166c21797c7ef6f3f05973 (diff) |
added clang as optional compiler
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -23,8 +23,7 @@ TARGET=`uname -s` -CFLAGS='-g -O2' -LDFLAGS='-g -Wall -O2' +USE_CLANG=0 LUA_LDFLAGS='-lm' LUA_DIR='' @@ -33,6 +32,7 @@ print_usage() { echo "configure --help print this" echo " --target=<TARGET> build target i.e. Linux (default: autodetect)" echo " --with-lua=<DIR> use this lua tree instead of system default" + echo " --use-clang use clang/llvm as compiler/linker" } for arg @@ -41,6 +41,9 @@ do --target=*) TARGET=${arg#--target=} ;; + --use-clang) + USE_CLANG=1 + ;; --with-lua=*) LUA_DIR=${arg#--with-lua=} ;; @@ -56,8 +59,18 @@ do esac done +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 include.mk -case $TARGET in +case $TARGET in Linux) echo "Linux specific build options" LUA_LDFLAGS=$LUA_LDFLAGS' -ldl' @@ -141,7 +154,7 @@ cat >> include.mk <<EOF # use ./configure instead TARGET := $TARGET -CC := gcc +CC := $COMPILER CFLAGS := $CFLAGS LDFLAGS := $LDFLAGS LUA_LDFLAGS := $LUA_LDFLAGS |