Release GLib 2.35.1
[platform/upstream/glib.git] / configure.ac
index 2e29b7f..5c112ea 100644 (file)
@@ -30,8 +30,8 @@ m4_define(glib_configure_ac)
 # <mclasen> on the unstable (ie master), interface age = 0
 
 m4_define([glib_major_version], [2])
-m4_define([glib_minor_version], [33])
-m4_define([glib_micro_version], [6])
+m4_define([glib_minor_version], [35])
+m4_define([glib_micro_version], [1])
 m4_define([glib_interface_age], [0])
 m4_define([glib_binary_age],
           [m4_eval(100 * glib_minor_version + glib_micro_version)])
@@ -234,24 +234,24 @@ AS_IF([test "x$GLIBC21" = "xyes"], [
 
 dnl declare --enable-* args and collect ac_help strings
 AC_ARG_ENABLE(debug,
-              AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
+              AS_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
                              [turn on debugging @<:@default=glib_debug_default@:>@]),,
               enable_debug=glib_debug_default)
 
 AC_ARG_ENABLE(gc_friendly,
-              [AC_HELP_STRING([--enable-gc-friendly],
+              [AS_HELP_STRING([--enable-gc-friendly],
                               [turn on garbage collector friendliness [default=no]])],,
               [enable_gc_friendly=no])
 AC_ARG_ENABLE(mem_pools,
-              [AC_HELP_STRING([--disable-mem-pools],
+              [AS_HELP_STRING([--disable-mem-pools],
                              [disable all glib memory pools])],,
              [disable_mem_pools=no])
 AC_ARG_ENABLE(rebuilds,
-              [AC_HELP_STRING([--disable-rebuilds],
+              [AS_HELP_STRING([--disable-rebuilds],
                               [disable all source autogeneration rules])],,
               [enable_rebuilds=yes])
 AC_ARG_ENABLE(modular_tests,
-              AC_HELP_STRING([--disable-modular-tests],
+              AS_HELP_STRING([--disable-modular-tests],
                              [Disable build of test programs (default: no)]),,
               [enable_modular_tests=yes])
 AM_CONDITIONAL(BUILD_MODULAR_TESTS, test x$enable_modular_tests = xyes)
@@ -273,7 +273,7 @@ AS_IF([test "x$disable_mem_pools" = "xno"], [
 dnl location to install runtime libraries, e.g. ../../lib to install
 dnl to /lib if libdir is /usr/lib
 AC_ARG_WITH(runtime-libdir,
-           [AC_HELP_STRING([--with-runtime-libdir=RELPATH],
+           [AS_HELP_STRING([--with-runtime-libdir=RELPATH],
                            [install runtime libraries relative to libdir])],
            [],
           [with_runtime_libdir=""])
@@ -395,7 +395,7 @@ AS_IF([ test x"$glib_native_win32" = xyes], [
   with_libiconv=native
 ], [
   AC_ARG_WITH(libiconv,
-             [AC_HELP_STRING([--with-libiconv=@<:@no/gnu/native@:>@],
+             [AS_HELP_STRING([--with-libiconv=@<:@no/gnu/native@:>@],
                              [use the libiconv library])],,
              [with_libiconv=maybe])
 
@@ -430,7 +430,7 @@ AS_IF([ test x"$glib_native_win32" = xyes], [
 ])
 
 AC_ARG_ENABLE(iconv-cache, 
-              [AC_HELP_STRING([--enable-iconv-cache=@<:@yes/no/auto@:>@],
+              [AS_HELP_STRING([--enable-iconv-cache=@<:@yes/no/auto@:>@],
                               [cache iconv descriptors [default=auto]])],,
               [enable_iconv_cache=auto])
 
@@ -586,9 +586,20 @@ AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
 # Checks for library functions.
 AC_FUNC_VPRINTF
 AC_FUNC_ALLOCA
-AC_CHECK_FUNCS(mmap posix_memalign memalign valloc fsync pipe2)
+AC_CHECK_FUNCS(mmap posix_memalign memalign valloc fsync pipe2 issetugid)
 AC_CHECK_FUNCS(atexit on_exit timegm gmtime_r)
 
+AC_CACHE_CHECK([for __libc_enable_secure], glib_cv_have_libc_enable_secure,
+  [AC_TRY_LINK([#include <unistd.h>
+    extern int __libc_enable_secure;],
+    [return __libc_enable_secure;],
+   glib_cv_have_libc_enable_secure=yes,
+   glib_cv_have_libc_enable_secure=no)])
+AS_IF([test x$glib_cv_have_libc_enable_secure = xyes], [
+   AC_DEFINE(HAVE_LIBC_ENABLE_SECURE, 1,
+     [Define if you have the __libc_enable_secure variable (GNU libc, eglibc)])
+])
+
 AC_CHECK_SIZEOF(char)
 AC_CHECK_SIZEOF(short)
 AC_CHECK_SIZEOF(long)
@@ -883,7 +894,7 @@ fi
 AC_CHECK_HEADERS([dirent.h float.h limits.h pwd.h grp.h sys/param.h sys/poll.h sys/resource.h])
 AC_CHECK_HEADERS([sys/time.h sys/times.h sys/wait.h unistd.h values.h])
 AC_CHECK_HEADERS([sys/select.h sys/types.h stdint.h inttypes.h sched.h malloc.h])
-AC_CHECK_HEADERS([sys/vfs.h sys/vmount.h sys/statfs.h sys/statvfs.h])
+AC_CHECK_HEADERS([sys/vfs.h sys/vmount.h sys/statfs.h sys/statvfs.h sys/filio.h])
 AC_CHECK_HEADERS([mntent.h sys/mnttab.h sys/vfstab.h sys/mntctl.h fstab.h])
 AC_CHECK_HEADERS([sys/uio.h sys/mkdev.h])
 AC_CHECK_HEADERS([linux/magic.h])
@@ -985,7 +996,7 @@ AC_MSG_RESULT(unsigned $glib_size_type)
 
 # Check for some functions
 AC_CHECK_FUNCS(lstat strerror strsignal memmove vsnprintf stpcpy strcasecmp strncasecmp poll getcwd vasprintf setenv unsetenv getc_unlocked readlink symlink fdwalk memmem)
-AC_CHECK_FUNCS(chown lchmod lchown fchmod fchown link utimes getgrgid getpwuid)
+AC_CHECK_FUNCS(chown lchmod lchown fchmod fchown link utimes getgrgid getpwuid getresuid)
 AC_CHECK_FUNCS(getmntent_r setmntent endmntent hasmntopt getfsstat getvfsstat)
 # Check for high-resolution sleep functions
 AC_CHECK_FUNCS(splice)
@@ -1156,7 +1167,7 @@ AS_IF([test "$ac_cv_func_statfs" = yes], [
 #
 
 AC_ARG_ENABLE(included-printf,
-              [AC_HELP_STRING([--enable-included-printf],
+              [AS_HELP_STRING([--enable-included-printf],
                               [use included printf [default=auto]])],
               enable_included_printf="$enableval")
 
@@ -1669,7 +1680,7 @@ dnl *** Directory for GIO modules ***
 dnl *********************************
 
 AC_ARG_WITH(gio-module-dir,
-           [AC_HELP_STRING([--with-gio-module-dir=DIR],
+           [AS_HELP_STRING([--with-gio-module-dir=DIR],
                            [load gio modules from this directory [LIBDIR/gio/modules]])],
            [],
           [with_gio_module_dir='${libdir}/gio/modules'])
@@ -1680,7 +1691,7 @@ dnl **********************************
 dnl *** Check for libselinux (GIO) ***
 dnl **********************************
 AC_ARG_ENABLE(selinux,
-              AC_HELP_STRING([--disable-selinux],
+              AS_HELP_STRING([--disable-selinux],
                              [build without selinux support]))
 msg_selinux=no
 SELINUX_LIBS=
@@ -1732,7 +1743,7 @@ dnl ****************************
 should_disable_fam=no
 
 AC_ARG_ENABLE(fam,
-              AC_HELP_STRING([--disable-fam],
+              AS_HELP_STRING([--disable-fam],
                              [don't use fam for file system monitoring]),
                          [
                                 if test "x$enable_fam" = "xno"; then
@@ -1761,7 +1772,7 @@ dnl *****************************
 dnl *** Check for xattr (GIO) ***
 dnl *****************************
 AC_ARG_ENABLE(xattr,
-              AC_HELP_STRING([--disable-xattr], [build without xattr support]))
+              AS_HELP_STRING([--disable-xattr], [build without xattr support]))
 msg_xattr=no
 XATTR_LIBS=
 AS_IF([ test "x$enable_xattr" != "xno"], [
@@ -1816,7 +1827,7 @@ dnl ************************
 dnl *** check for libelf ***
 dnl ************************
 AC_ARG_ENABLE(libelf,
-              AC_HELP_STRING([--disable-libelf], [build without libelf support]))
+              AS_HELP_STRING([--disable-libelf], [build without libelf support]))
 AS_IF([ test "x$enable_libelf" != "xno"],[
 PKG_CHECK_MODULES([LIBELF], [libelf >= 0.8.12], [have_libelf=yes], [have_libelf=maybe])
 AS_IF([ test $have_libelf = maybe ], [
@@ -1883,7 +1894,7 @@ dnl *** g_thread checks ***
 dnl ***********************
 
 AC_ARG_WITH(threads,
-           [AC_HELP_STRING([--with-threads=@<:@posix/win32@:>@],
+           [AS_HELP_STRING([--with-threads=@<:@posix/win32@:>@],
                            [specify a thread implementation to use])],
            [],
            [with_threads=yes])
@@ -2479,7 +2490,7 @@ PCRE_REQUIRED_VERSION=8.13
 
 # Check if we should use the internal or the system-supplied pcre
 AC_ARG_WITH(pcre,
-            [AC_HELP_STRING([--with-pcre=@<:@internal/system@:>@],
+            [AS_HELP_STRING([--with-pcre=@<:@internal/system@:>@],
                             [whether to use system PCRE [default=internal]])])
 
 AM_CONDITIONAL(USE_SYSTEM_PCRE, [test "x$with_pcre" = xsystem])
@@ -2585,31 +2596,61 @@ AS_IF([ test $cross_compiling = yes && test x$enable_modular_tests = xyes], [
 dnl **************************
 dnl *** Checks for gtk-doc ***
 dnl **************************
-
+# gtkdocize greps for ^GTK_DOC_CHECK and parses it, so you need to have
+# it on it's own line.
+m4_ifdef([GTK_DOC_CHECK], [
 GTK_DOC_CHECK([1.15], [--flavour no-tmpl])
+],[
+AM_CONDITIONAL([ENABLE_GTK_DOC],[false])
+])
 
 AC_ARG_ENABLE(man,
-              [AC_HELP_STRING([--enable-man],
-                              [regenerate man pages from Docbook [default=no]])],enable_man=yes,
-              enable_man=no)
-
-AS_IF([test "${enable_man}" != no], [
-dnl
-dnl Check for xsltproc
-dnl
-AC_PATH_PROG([XSLTPROC], [xsltproc])
-  if test -z "$XSLTPROC"; then
+              [AS_HELP_STRING([--enable-man],
+                              [generate man pages [default=auto]])],,
+              enable_man=maybe)
+
+AS_IF([test "$enable_man" != no], [
+  AC_PATH_PROG([XSLTPROC], [xsltproc])
+  AS_IF([test -z "$XSLTPROC"], [
+    AS_IF([test "$enable_man" = yes], [
+      AC_MSG_ERROR([xsltproc is required for --enable-man])
+    ])
     enable_man=no
-  fi
+  ])
+])
 
-  dnl check for DocBook DTD and stylesheets in the local catalog.
+AS_IF([ test "$enable_man" != no ], [
+  dnl check for DocBook DTD in the local catalog
   JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
-     [DocBook XML DTD V4.1.2],,enable_man=no)
+     [DocBook XML DTD V4.1.2], [have_docbook_dtd=yes], [have_docbook_dtd=no])
+  AS_IF([test "$have_docbook_dtd" != yes], [
+    AS_IF([test "$enable_man" = yes ], [
+      AC_MSG_ERROR([DocBook DTD is required for --enable-man])
+    ])
+    enable_man=no
+  ])
+])
+
+AS_IF([test "$enable_man" != no], [
+  dnl check for DocBook XSL stylesheets in the local catalog
   JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
-     [DocBook XSL Stylesheets],,enable_man=no)
+     [DocBook XSL Stylesheets], [have_docbook_style=yes],[have_docbook_style=no])
+  AS_IF([ test "$have_docbook_dtd" != yes ], [
+    AS_IF([ test "$enable_man" = yes ], [
+      AC_MSG_ERROR([DocBook XSL Stylesheets are required for --enable-man])
+    ])
+    enable_man=no
+  ])
 ])
 
-AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
+AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
+
+AC_MSG_CHECKING([whether to generate man pages])
+AS_IF([ test "$enable_man" != no ], [
+  AC_MSG_RESULT([yes])
+], [
+  AC_MSG_RESULT([no])
+])
 
 dnl
 dnl Tracing
@@ -3473,7 +3514,7 @@ dnl intra-library PLT jumps, if available.
 dnl
 
 AC_ARG_ENABLE(Bsymbolic,
-              [AC_HELP_STRING([--disable-Bsymbolic],
+              [AS_HELP_STRING([--disable-Bsymbolic],
                               [avoid linking with -Bsymbolic])],,
               [SAVED_LDFLAGS="${LDFLAGS}"
                AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])