X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/e1999cff4c8d39584a6723cf0ff2ffec9425c4da..0f4172ffbddd7b51c80f388adc69c4601d230bf6:/projects/stargazer/build?ds=inline diff --git a/projects/stargazer/build b/projects/stargazer/build index a77c2e09..86246c3d 100755 --- a/projects/stargazer/build +++ b/projects/stargazer/build @@ -76,7 +76,7 @@ if [ "$sys" = "Darwin" ] then OS=darwin ETC_DIR="./inst/freebsd/etc/stargazer" - MAKE="gmake" + MAKE="make" fi if [ "$OS" = "unknown" ] @@ -132,7 +132,6 @@ else then DEFS="$DEFS -DDARWIN" LIB_THREAD=-lpthread - LIBICONV="" else LIB_THREAD=-lc_r fi @@ -153,6 +152,16 @@ then CXX=g++ fi +if [ -z "$AR" ] +then + AR=ar +fi + +if [ -z "$RANLIB" ] +then + RANLIB=ranlib +fi + printf "Checking CC... " $CC --version > /dev/null 2> /dev/null if [ $? != 0 ] @@ -171,6 +180,24 @@ then exit; fi printf "found\n" +printf "Checking AR... " +$AR --version > /dev/null 2> /dev/null +if [ $? != 0 ] +then + printf "FAIL!\n" + printf "$AR not found\n" + exit; +fi +printf "found\n" +printf "Checking RANLIB... " +$RANLIB --version > /dev/null 2> /dev/null +if [ $? != 0 ] +then + printf "FAIL!\n" + printf "$RANLIB not found\n" + exit; +fi +printf "found\n" printf "Checking endianess... " printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c @@ -199,7 +226,7 @@ rm -f fake printf "Checking for -lexpat... " printf "#include \nint main() { return 0; }\n" > build_check.c -$CXX $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 @@ -212,7 +239,7 @@ rm -f fake printf "Checking for iconv 2nd argument... " printf "#include \nint main(){ const char** src = 0; iconv(0, src, 0, 0, 0); }\n" > build_check.c -$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null +$CC $CFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then printf "non-const\n" @@ -229,7 +256,7 @@ then printf "no\n" printf "Checking for -lfbclient... " printf "int main() { return 0; }\n" > build_check.c - $CXX $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 @@ -272,7 +299,7 @@ if [ $? != 0 ] then printf "no\n"; printf "Checking for -lmysqlclient... " - $CXX $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 @@ -314,7 +341,7 @@ if [ $? != 0 ] then printf "no\n"; printf "Checking for -lpq... " - $CXX $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 @@ -354,7 +381,7 @@ if [ $? != 0 ] then printf "no\n"; printf "Checking for -lxmlrpc... " - $CXX $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 @@ -393,7 +420,7 @@ fi printf "Checking for -lnfnetlink... " printf "#include \n#include \n#include \nint main() { return 0; }\n" > build_check.c -$CXX $CXXFLAGS $LDFLAGS build_check.c -lnfnetlink -o fake > /dev/null 2> /dev/null +$CC $CFLAGS $LDFLAGS build_check.c -lnfnetlink -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then CHECK_NFNETLINK=no @@ -407,7 +434,7 @@ rm -f fake printf "Checking for -lnetfilter_queue... " printf "#include \n#include \nint main() { return 0; }\n" > build_check.c -$CXX $CXXFLAGS $LDFLAGS build_check.c -lnetfilter_queue -o fake > /dev/null 2> /dev/null +$CC $CFLAGS $LDFLAGS build_check.c -lnetfilter_queue -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then CHECK_NFQ=no @@ -425,7 +452,7 @@ then printf "#include \n" > build_check.c printf "#include \n" >> build_check.c printf "int main() { return 0; }\n" >> build_check.c - $CXX $CXXFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null + $CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then CHECK_IP_QUEUE_H=no @@ -540,6 +567,8 @@ done printf "\n" >> $CONFFILE printf "CC=$CC\n" >> $CONFFILE printf "CXX=$CXX\n" >> $CONFFILE +printf "AR=$AR\n" >> $CONFFILE +printf "RANLIB=$RANLIB\n" >> $CONFFILE printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE printf "CFLAGS=$CFLAGS\n" >> $CONFFILE printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE