Drop the warnings.sgml template
[platform/upstream/glib.git] / configure.ac
index 0898617..7c25399 100644 (file)
@@ -27,7 +27,7 @@ m4_define(glib_configure_ac)
 
 m4_define([glib_major_version], [2])
 m4_define([glib_minor_version], [29])
-m4_define([glib_micro_version], [5])
+m4_define([glib_micro_version], [11])
 m4_define([glib_interface_age], [0])
 m4_define([glib_binary_age],
           [m4_eval(100 * glib_minor_version + glib_micro_version)])
@@ -59,12 +59,13 @@ AC_CONFIG_MACRO_DIR([m4macros])
 # Save this value here, since automake will set cflags later
 cflags_set=${CFLAGS+set}
 
-AM_INIT_AUTOMAKE([1.10 no-define])
+AM_INIT_AUTOMAKE([1.11 no-define no-dist-gzip dist-xz tar-ustar])
+AM_MAINTAINER_MODE([enable])
 
-# Support silent build rules, requires at least automake-1.11. Disable
+# Support silent build rules. Disable
 # by either passing --disable-silent-rules to configure or passing V=1
 # to make
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+AM_SILENT_RULES([yes])
 
 GLIB_MAJOR_VERSION=glib_major_version
 GLIB_MINOR_VERSION=glib_minor_version
@@ -103,9 +104,6 @@ AC_SUBST(LT_REVISION)
 AC_SUBST(LT_AGE)
 AC_SUBST(LT_CURRENT_MINUS_AGE)
 
-dnl Initialize maintainer mode
-AM_MAINTAINER_MODE
-
 dnl Checks for programs.
 AC_PROG_CC
 AC_PROG_CPP
@@ -580,45 +578,50 @@ AC_FUNC_VPRINTF
 AC_FUNC_ALLOCA
 AC_CHECK_FUNCS(mmap posix_memalign memalign valloc fsync pipe2)
 AC_CHECK_FUNCS(atexit on_exit timegm gmtime_r)
-# BSD has a qsort_r with wrong argument order
-AC_CACHE_CHECK([for qsort_r], glib_cv_have_qsort_r, [
-AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#define _GNU_SOURCE
-#include <stdlib.h>
 
-static int
-cmp (const void *a, const void *b, void *c)
-{
-  const int *ia = a;
-  const int *ib = b;
+dnl don't use AC_CHECK_FUNCS here, otherwise HAVE_QSORT_R will
+dnl be automatically defined, which we don't want to do
+dnl until we have checked this function is actually usable
+AC_CHECK_FUNC([qsort_r])
 
-  if (*ia < *ib)
-    return -1;
-  else if (*ia > *ib)
-    return 1;
-  else
-    return 0;
-}
+# BSD has a qsort_r with wrong argument order
+if test x$ac_cv_func_qsort_r = xyes ; then
+  AC_CACHE_CHECK([if qsort_r uses glibc compatible argument order], glib_cv_have_qsort_r, [
+  AC_RUN_IFELSE([AC_LANG_SOURCE([[
+  #define _GNU_SOURCE
+  #include <stdlib.h>
+
+  static int
+  cmp (const void *a, const void *b, void *c)
+  {
+    const int *ia = a;
+    const int *ib = b;
+
+    if (*ia < *ib)
+      return -1;
+    else if (*ia > *ib)
+      return 1;
+    else
+      return 0;
+  }
 
-int
-main (int argc, char **argv)
-{
-  int arr[3] = { 1, 2, 0 };
-  int d = 3;
+  int
+  main (int argc, char **argv)
+  {
+    int arr[3] = { 1, 2, 0 };
+    int d = 3;
 
-  qsort_r (arr, 3, sizeof (int), cmp, &d);
+    qsort_r (arr, 3, sizeof (int), cmp, &d);
 
-  if (arr[0] == 0 && arr[1] == 1 && arr[2] == 2)
-    return 0;
-  else
-    return 1;
-}]])],[glib_cv_have_qsort_r=yes],[glib_cv_have_qsort_r=no])])
+    if (arr[0] == 0 && arr[1] == 1 && arr[2] == 2)
+      return 0;
+    else
+      return 1;
+  }]])],[glib_cv_have_qsort_r=yes],[glib_cv_have_qsort_r=no])])
+fi
 
-if test $glib_cv_have_qsort_r = yes ; then
-  AC_MSG_RESULT([yes])
-    AC_DEFINE(HAVE_QSORT_R, 1, [Define to 1 if you have the 'qsort_r' function])
-else
-  AC_MSG_RESULT([no])
+if test x$glib_cv_have_qsort_r = xyes ; then
+  AC_DEFINE(HAVE_QSORT_R, 1, [Define to 1 if you have the 'qsort_r' function])
 fi
 
 AC_CHECK_SIZEOF(char)
@@ -997,11 +1000,39 @@ 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 statvfs statfs utimes getgrgid getpwuid)
+AC_CHECK_FUNCS(chown lchmod lchown fchmod fchown link utimes getgrgid getpwuid)
 AC_CHECK_FUNCS(getmntent_r setmntent endmntent hasmntopt getmntinfo)
 # Check for high-resolution sleep functions
 AC_CHECK_FUNCS(splice)
 
+# To avoid finding a compatibility unusable statfs, which typically
+# successfully compiles, but warns to use the newer statvfs interface:
+AS_IF([test $ac_cv_header_sys_statvfs_h = yes], [AC_CHECK_FUNCS([statvfs])])
+AS_IF([test $ac_cv_header_sys_statfs_h  = yes], [AC_CHECK_FUNCS([statfs])])
+
+AC_MSG_CHECKING([whether to use statfs or statvfs])
+# Some systems have both statfs and statvfs, pick the most "native" for these
+AS_IF([test x$ac_cv_func_statfs = xyes && test x$ac_cv_func_statvfs = yes],
+   [
+   # on solaris and irix, statfs doesn't even have the f_bavail field
+   AS_IF([test $ac_cv_member_struct_statfs_f_bavail = yes],
+      [ac_cv_func_statfs=no],
+   # else, at least on linux, statfs is the actual syscall
+      [ac_cv_func_statvfs=no])
+   ])
+
+AS_IF([test x$ac_cv_func_statfs = xyes],
+      [
+         AC_DEFINE([USE_STATFS], [1], [Define to use statfs()])
+         AC_MSG_RESULT([statfs])
+      ],
+      [test x$ac_cv_func_statvfs = xyes],
+      [
+         AC_DEFINE([USE_STATVFS], [1], [Define to use statvfs()])
+         AC_MSG_RESULT([statvfs])
+      ],
+      [  AC_MSG_RESULT([neither])])
+
 AC_CHECK_HEADERS(crt_externs.h)
 AC_CHECK_FUNCS(_NSGetEnviron)
 
@@ -2468,9 +2499,6 @@ if test x"$GCC" = xyes; then
              [glib_cv_gcc_has_builtin_atomic_operations=no])
 
   AC_MSG_RESULT($glib_cv_gcc_has_builtin_atomic_operations)
-  if test $glib_cv_gcc_has_builtin_atomic_operations = yes; then
-    glib_memory_barrier_needed=yes
-  else
     case $host_cpu in
       i386)
         AC_MSG_RESULT([none])
@@ -2567,7 +2595,6 @@ if test x"$GCC" = xyes; then
         glib_memory_barrier_needed=yes
         ;;
     esac
-  fi
 else
   if test $glib_native_win32 = yes; then
     # For Windows but not using gcc. No barriers needed then either.
@@ -2581,28 +2608,39 @@ AM_CONDITIONAL(HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS,
 dnl ************************
 dnl ** Check for futex(2) **
 dnl ************************
-AC_MSG_CHECKING([for futex(2) system call])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+AC_CACHE_CHECK(for futex(2) system call,
+    glib_cv_futex,AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
 #include <linux/futex.h>
-#include <syscall.h>
+#include <sys/syscall.h>
 #include <unistd.h>
 ],[
 int
 main (void)
 {
-  /* it's not like this actually runs or anything... */
-  syscall (SYS_futex, NULL, FUTEX_WAKE, FUTEX_WAIT);
+  /* it is not like this actually runs or anything... */
+  syscall (__NR_futex, NULL, FUTEX_WAKE, FUTEX_WAIT);
   return 0;
 }
-])],
-[
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(HAVE_FUTEX, [test "$have_futex" = "yes"],
-            [we have the futex(2) system call])
-],
-[
-  AC_MSG_RESULT(no)
-])
+])],glib_cv_futex=yes,glib_cv_futex=no))
+if test x"$glib_cv_futex" = xyes; then
+  AC_DEFINE(HAVE_FUTEX, 1, [we have the futex(2) system call])
+fi
+
+AC_CACHE_CHECK(for eventfd(2) system call,
+    glib_cv_eventfd,AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+#include <sys/eventfd.h>
+#include <unistd.h>
+],[
+int
+main (void)
+{
+  eventfd (0, EFD_CLOEXEC);
+  return 0;
+}
+])],glib_cv_eventfd=yes,glib_cv_eventfd=no))
+if test x"$glib_cv_eventfd" = x"yes"; then
+  AC_DEFINE(HAVE_EVENTFD, 1, [we have the eventfd(2) system call])
+fi
 
 dnl ****************************************
 dnl *** GLib POLL* compatibility defines ***
@@ -3256,7 +3294,10 @@ _______EOF
          echo >>$outfile
          echo "#define G_ATOMIC_OP_MEMORY_BARRIER_NEEDED 1" >>$outfile
        fi
-
+       if test x"$g_gcc_atomic_ops" != xno; then
+          echo >>$outfile
+          echo "#define G_ATOMIC_OP_USE_GCC_BUILTINS 1" >>$outfile
+        fi
        echo >>$outfile
        g_bit_sizes="16 32 64"
        for bits in $g_bit_sizes; do
@@ -3633,6 +3674,7 @@ g_system_thread_sizeof="$glib_cv_sizeof_system_thread"
 g_mutex_contents="$glib_cv_byte_contents_gmutex"
 
 g_memory_barrier_needed="$glib_memory_barrier_needed"
+g_gcc_atomic_ops="$glib_cv_gcc_has_builtin_atomic_operations"
 
 g_module_suffix="$glib_gmodule_suffix"
 
@@ -3785,6 +3827,7 @@ gio/fen/Makefile
 gio/fam/Makefile
 gio/win32/Makefile
 gio/tests/Makefile
+gio/tests/gdbus-object-manager-example/Makefile
 po/Makefile.in
 docs/Makefile
 docs/reference/Makefile
@@ -3793,6 +3836,7 @@ docs/reference/glib/version.xml
 docs/reference/gobject/Makefile
 docs/reference/gobject/version.xml
 docs/reference/gio/Makefile
+docs/reference/gio/gdbus-object-manager-example/Makefile
 docs/reference/gio/version.xml
 tests/Makefile
 tests/gobject/Makefile