From fb6b8d1ef4b36c92089e89d467d77e2827f12472 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 8 May 2015 18:36:38 +0200 Subject: build nows with clang as well diff --git a/src/configure b/src/configure index 0d92d8b..54c202d 100755 --- a/src/configure +++ b/src/configure @@ -23,8 +23,7 @@ TARGET=`uname -s` EBUILD_COMPAT=0 -CFLAGS='-g -O2' -LDFLAGS='-g -Wall -O2 -lpthread' +USE_CLANG=0 LUA_DIR='' LUA='' @@ -42,6 +41,7 @@ print_usage() { echo " --sysconfdir= the path to the system configuration directory (default: $PREFIX/etc)" echo " --libdir= the path to the lua library directory (default: $PREFIX/lib/rhnop)" echo " --with-lua= use this lua tree instead of system default" + echo " --use-clang use clang/llvm as compiler/linker" } for arg @@ -50,6 +50,9 @@ do --target=*) TARGET=${arg#--target=} ;; + --use-clang) + USE_CLANG=1 + ;; --prefix=*) PREFIX=${arg#--prefix=} ;; @@ -87,6 +90,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 -lpthread' + COMPILER='gcc' +else + CFLAGS='-g -O2' + LDFLAGS='-g -O2 -lpthread' + COMPILER='clang' +fi + rm -f config.h rm -f include.mk case $TARGET in @@ -184,7 +197,7 @@ cat > include.mk <