]> git.stg.codes - stg.git/blobdiff - projects/rlm_stg/build
Merge branch 'stg-2.409' into stg-2.409-radius
[stg.git] / projects / rlm_stg / build
index e9be4ed0f86562b891a840d4996618f966d8a434..4894491a84c1800e1e44074a65bec4abbca1fd3a 100755 (executable)
@@ -68,6 +68,7 @@ then
     DEFS="$DEFS -DLINUX"
     LIB_THREAD=-lpthread
 else
     DEFS="$DEFS -DLINUX"
     LIB_THREAD=-lpthread
 else
+    LIBICONV="-liconv"
     if [ "$OS" = "bsd" ]
     then
         DEFS="$DEFS -DFREE_BSD"
     if [ "$OS" = "bsd" ]
     then
         DEFS="$DEFS -DFREE_BSD"
@@ -137,6 +138,18 @@ else
 fi
 rm -f fake
 
 fi
 rm -f fake
 
+printf "Checking for iconv 2nd argument... "
+printf "#include <iconv.h>\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
 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 "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
 printf "PREFIX=$PREFIX\n" >> $CONFFILE
 printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE
 printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE