]> git.stg.codes - stg.git/blobdiff - projects/libs/build
Added "smart" iconv 2nd arg const-ness detection.
[stg.git] / projects / libs / build
index 1d40d725628d9ec955c660a7a6d409190c7a3558..9b23d546dab94a19ac80cd186d9c6b288e0f21e0 100755 (executable)
@@ -1,10 +1,5 @@
 #!/bin/sh
 
-#   $Revision: 1.57 $
-#   $Author: faust $
-#   $Date: 2010/05/09 12:39:01 $
-######################################################
-
 # Installation path prefix
 
 #PREFIX=""
@@ -183,6 +178,18 @@ else
 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
+$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c -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" ]