X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/90e389f6ec12e60a62c362296ffcf314feb5b03d..3df642f3d2537dc5531a8d91c6d85927b34b46c7:/projects/stargazer/build diff --git a/projects/stargazer/build b/projects/stargazer/build index 1779160b..01d96054 100755 --- a/projects/stargazer/build +++ b/projects/stargazer/build @@ -59,7 +59,7 @@ MIN_XMLRPCC_VERSION="1.06.27" XMLRPC_FEATURES="c++2 abyss-server" -if [ -z $1 ] +if [ -z "$1" ] then DEFS="$DEFS -DNDEBUG" MAKEOPTS="-j1" @@ -68,7 +68,7 @@ else then DEFS="$DEFS -DDEBUG" MAKEOPTS="-j1" - CXXFLAGS="$CXXFLAGS -g3 -W -Wall" + CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall" else DEFS="$DEFS -DNDEBUG" MAKEOPTS="-j1" @@ -119,7 +119,8 @@ STG_LIBS="logger.lib scriptexecuter.lib conffiles.lib pinger.lib - dotconfpp.lib" + dotconfpp.lib + smux.lib" PLUGINS="authorization/ao authorization/inetaccess @@ -127,6 +128,7 @@ PLUGINS="authorization/ao other/ping other/rscript other/radius + other/smux store/files capture/cap_nf" @@ -158,28 +160,38 @@ else SHELL="/usr/local/bin/bash" fi -echo -n "Checking gcc... " -gcc --version > /dev/null 2> /dev/null +if [ -z "$CC" ] +then + CC=gcc +fi + +if [ -z "$CXX" ] +then + CXX=g++ +fi + +echo -n "Checking CC... " +$CC --version > /dev/null 2> /dev/null if [ $? != 0 ] then echo "FAIL!" - echo "gcc not found" + echo "$CC not found" exit; fi echo "found" -echo -n "Checking g++... " -g++ --version > /dev/null 2> /dev/null +echo -n "Checking CXX... " +$CXX --version > /dev/null 2> /dev/null if [ $? != 0 ] then echo "FAIL!" - echo "g++ not found" + echo "$CXX not found" exit; fi echo "found" echo -n "Checking endianess... " echo "int main() { int probe = 0x00000001; return *(char *)&probe; }" > build_check.c -gcc $CXXFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null +$CC $CFLAGS $LDFLAGS build_check.c -o fake if [ $? != 0 ] then echo "FAIL!" @@ -191,10 +203,12 @@ else then ARCH=le CXXFLAGS="$CXXFLAGS -DARCH_LE" + CFLAGS="$CFLAGS -DARCH_LE" echo "Little Endian" else ARCH=be CXXFLAGS="$CXXFLAGS -DARCH_BE" + CFLAGS="$CFLAGS -DARCH_BE" echo "Big Endian" fi fi @@ -202,7 +216,7 @@ rm -f fake echo -n "Checking for -lexpat... " echo "int main() { return 0; }" > build_check.c -gcc $CXXFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null +$CC $CFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then CHECK_EXPAT=no @@ -214,7 +228,7 @@ fi rm -f fake echo -n "Checking for -lfbclient... " -gcc $CXXFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null +$CC $CFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then CHECK_FBCLIENT=no @@ -231,7 +245,7 @@ if [ $? != 0 ] then echo "no"; echo -n "Checking for -lmysqlclient... " - gcc $CXXFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null + $CC $CFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then CHECK_MYSQLCLIENT=no @@ -250,7 +264,6 @@ else CHECK_MYSQLCLIENT=no echo "no" else - #CXXFLAGS="$CXXFLAGS $MYSQL_CFLAGS" echo "[$MYSQL_CFLAGS]" echo -n "Checking for mysql_config --libs_r... " MYSQL_LDFLAGS=`mysql_config --libs_r 2> /dev/null` @@ -260,7 +273,6 @@ else echo "no" else CHECK_MYSQLCLIENT=yes - #LDFLAGS="$LDFLAGS $MYSQL_LDFLAGS" echo "[$MYSQL_LDFLAGS]" fi fi @@ -272,7 +284,7 @@ if [ $? != 0 ] then echo "no"; echo -n "Checking for -lpq... " - gcc $CXXFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null + $CC $CFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then CHECK_PQ=no @@ -311,7 +323,7 @@ if [ $? != 0 ] then echo "no"; echo -n "Checking for -lxmlrpc... " - gcc $CXXFLAGS $LDFLAGS build_check.c -lxmlrpc $LIB_THREAD -o fake > /dev/null 2> /dev/null + $CC $CFLAGS $LDFLAGS build_check.c -lxmlrpc $LIB_THREAD -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then CHECK_XMLRPC=no @@ -411,6 +423,7 @@ done echo "" >> $CONFFILE echo "SHELL=$SHELL" >> $CONFFILE echo "CXXFLAGS=$CXXFLAGS" >> $CONFFILE +echo "CFLAGS=$CFLAGS" >> $CONFFILE echo "LDFLAGS=$LDFLAGS" >> $CONFFILE echo "LIB_THREAD=$LIB_THREAD" >> $CONFFILE echo "PREFIX=$PREFIX" >> $CONFFILE