added g_strlcat() and g_strlcpy() wrappers, supplied by David Wheeler
[platform/upstream/glib.git] / configure.in
index 2c5af75..3722b19 100644 (file)
@@ -337,7 +337,6 @@ AC_SUBST(STRIP_END)
 size_includes=["
 #include <stdarg.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <ctype.h>
 #include <string.h>
 "]
@@ -399,7 +398,7 @@ fi
 AC_MSG_CHECKING(for sys_siglist)
 AC_TRY_LINK(, [
 extern char *sys_siglist[];
-strlen (sys_siglist[0]);
+exit (sys_siglist[0]);
 ], glib_ok=yes, glib_ok=no)
 AC_MSG_RESULT($glib_ok)
 if test $glib_ok = no; then
@@ -449,6 +448,33 @@ AC_CACHE_VAL(glib_cv_sane_realloc,[
 ])
 AC_MSG_RESULT($glib_cv_sane_realloc)
 
+dnl Check for nl_langinfo and CODESET
+
+AC_MSG_CHECKING([for nl_langinfo (CODESET)])
+AC_TRY_COMPILE([#include <langinfo.h>],
+       [char *codeset = nl_langinfo (CODESET);],
+   AC_DEFINE(HAVE_CODESET)
+   have_codeset=yes,
+   have_codeset=no)
+AC_MSG_RESULT($have_codeset)
+
+
+dnl ****************************************
+dnl *** strlcpy/strlcat                  ***
+dnl ****************************************
+# Check for strlcpy
+AC_MSG_CHECKING(for strlcpy/strlcat)
+AC_TRY_LINK([#include <stdlib.h>
+#include <string.h>], [
+char *p = malloc(10);
+(void) strlcpy(p, "hi", 10);
+(void) strlcat(p, "bye", 10);
+], glib_ok=yes, glib_ok=no)
+AC_MSG_RESULT($glib_ok)
+if test $glib_ok = yes; then
+    AC_DEFINE(HAVE_STRLCPY)
+fi
+  
 
 dnl **********************
 dnl *** va_copy checks ***
@@ -1102,10 +1128,6 @@ case "$CONFIG_OTHER" in
 #ifndef GLIBCONFIG_H
 #define GLIBCONFIG_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 _______EOF
 
        if test x$glib_limits_h = xyes; then
@@ -1126,6 +1148,10 @@ _______EOF
 
        cat >> $outfile <<_______EOF
 
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
 #define G_MINFLOAT     $glib_mf
 #define G_MAXFLOAT     $glib_Mf
 #define G_MINDOUBLE    $glib_md
@@ -1180,9 +1206,23 @@ ${glib_extension}typedef unsigned $gint64 guint64;
 #define G_GINT64_FORMAT $gint64_format
 #define G_GUINT64_FORMAT $guint64_format
 #define G_GINT64_CONSTANT(val) $gint64_constant
+
 _______EOF
        fi
 
+       case x$glib_size_t in
+        x2) echo "typedef gint16  gssize;" >> $outfile
+            echo "typedef guint16 gsize;"  >> $outfile
+            ;;
+        x4) echo "typedef gint32  gssize;" >> $outfile
+            echo "typedef guint32 gsize;"  >> $outfile
+            ;;
+        x8) echo "typedef gint64  gssize;" >> $outfile
+            echo "typedef guint64 gsize;"  >> $outfile
+            ;;
+       *)  echo "#error size of size_t is unknown" >> $outfile
+            ;;
+        esac
 
        if test -z "$glib_unknown_void_p"; then
          cat >>$outfile <<_______EOF
@@ -1399,6 +1439,7 @@ $ac_cv_sizeof_long_long)
   gint64_constant='(G_GNUC_EXTENSION (val##LL))'
   ;;
 esac
+glib_size_t=$glib_cv_sizeof_size_t
 
 gintbits=`expr $ac_cv_sizeof_int \* 8`
 glongbits=`expr $ac_cv_sizeof_long \* 8`
@@ -1505,7 +1546,7 @@ case $host in
   *-*-cygwin*)
     glib_os="#define G_OS_UNIX
 #define G_WITH_CYGWIN"
-    ;;
+v    ;;
   *)
     glib_os="#define G_OS_UNIX"
     ;;
@@ -1515,7 +1556,9 @@ esac
 AC_OUTPUT([
 glib.spec
 Makefile
-glib-config
+glib-config-2.0
+build/Makefile
+build/win32/Makefile
 gmodule/gmoduleconf.h
 gmodule/Makefile
 gobject/Makefile
@@ -1524,7 +1567,7 @@ docs/Makefile
 docs/glib-config.1
 tests/Makefile
 ],[case "$CONFIG_FILES" in
-*glib-config*)chmod +x glib-config;;
+*glib-config-2.0*)chmod +x glib-config-2.0;;
 esac
 echo ""
 echo " *** IMPORTANT *** "
@@ -1536,12 +1579,6 @@ echo ""
 echo "  * You should not base stable software on this version of GLib."
 echo "  * GNOME developers should use a stable version of GLib."
 echo ""
-echo "Distributions should *NOT* ship a development package of this GLib."
-echo "Do not ship the headers and do not ship the glib-config script.  These"
-echo "things will conflict with the stable 1.2 series.  Package only enough"
-echo "to satisfy the requirements of some other package.  Package only the"
-echo "library itself.  Doing otherwise will do no favors to the community."
-echo ""
 echo "If you install this version of GLib, we strongly recommend that you"
 echo "install it in a different prefix than GLib 1.2.  Use --prefix as an"
 echo "argument to configure to do this.  Otherwise, you will not be able to"