From ba9fe029984b9b1614bdfc81072a3e95675bd74a Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 16 Sep 2013 11:24:18 +0000 Subject: added clang as optional compiler diff --git a/configure b/configure index f21f69d..10bb04d 100755 --- a/configure +++ b/configure @@ -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= build target i.e. Linux (default: autodetect)" echo " --with-lua= 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 <