diff options
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 |