X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/17409dcc5a7e9f03a1180cd740b963b53c2ce6ee..13d642c516655dd9798b03399de91fc77ca05af9:/projects/rlm_stg/build?ds=sidebyside diff --git a/projects/rlm_stg/build b/projects/rlm_stg/build index 433cd04f..179d5261 100755 --- a/projects/rlm_stg/build +++ b/projects/rlm_stg/build @@ -68,6 +68,7 @@ then DEFS="$DEFS -DLINUX" LIB_THREAD=-lpthread else + LIBICONV="-liconv" if [ "$OS" = "bsd" ] then DEFS="$DEFS -DFREE_BSD" @@ -137,6 +138,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 "OS=$OS\n" > $CONFFILE printf "STG_TIME=yes\n" >> $CONFFILE printf "DEBUG=$DEBUG\n" >> $CONFFILE @@ -156,6 +169,7 @@ 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