X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/37aa013f3c1aabe48c6b01fe82f0d62d69f663af..0d6d9ba8a9c8512a0e1fd66a398c61e656644516:/projects/sgconv/build diff --git a/projects/sgconv/build b/projects/sgconv/build index edde35f9..60705252 100755 --- a/projects/sgconv/build +++ b/projects/sgconv/build @@ -56,7 +56,7 @@ if [ "$sys" = "Darwin" ] then OS=darwin ETC_DIR="./inst/freebsd/etc/stargazer" - MAKE="gmake" + MAKE="make" fi if [ "$OS" = "unknown" ] @@ -72,7 +72,6 @@ printf " Building sgconv for $sys $release\n" printf "#############################################################################\n" STG_LIBS="logger.lib - locker.lib crypto.lib common.lib conffiles.lib @@ -85,6 +84,7 @@ then DEFS="$DEFS -DLINUX" LIB_THREAD=-lpthread else + LIBICONV="-liconv" if [ "$OS" = "bsd" ] then DEFS="$DEFS -DFREE_BSD" @@ -116,6 +116,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 ] @@ -134,6 +144,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 @@ -160,6 +188,18 @@ else fi 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 +$CC $CFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null +if [ $? != 0 ] +then + printf "non-const\n" +else + DEFS="$DEFS -DCONST_ICONV" + printf "const\n" +fi +rm -f fake + printf "Checking for fb_config... " FB_VERSION=`fb_config --version 2> /dev/null` if [ "$?" != "0" ] @@ -167,7 +207,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 @@ -249,7 +289,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 @@ -347,10 +387,13 @@ 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 printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE +printf "LIBICONV=$LIBICONV\n" >> $CONFFILE printf "PREFIX=$PREFIX\n" >> $CONFFILE printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE