Use -Bsymbolic-functions, drop g*alias PLT hackery
[platform/upstream/glib.git] / configure.in
index 0a3f3fd..6b83c97 100644 (file)
@@ -9,9 +9,9 @@ dnl ***********************************
 m4_define(glib_configure_in)
 
 #
-# The following version number definitions apply to GLib, GModule, GObject 
-# and GThread as a whole, so if changes occoured in any of them, they are all
-# treated with the same interface and binary age.
+# The following version number definitions apply to GLib, GModule, GObject,
+# GThread and GIO as a whole, so if changes occurred in any of them, they are
+# all treated with the same interface and binary age.
 #
 # Making releases:
 #   glib_micro_version += 1;
@@ -22,8 +22,8 @@ m4_define(glib_configure_in)
 # set glib_binary_age _and_ glib_interface_age to 0.
 #
 m4_define([glib_major_version], [2])
-m4_define([glib_minor_version], [19])
-m4_define([glib_micro_version], [9])
+m4_define([glib_minor_version], [25])
+m4_define([glib_micro_version], [10])
 m4_define([glib_interface_age], [0])
 m4_define([glib_binary_age],
           [m4_eval(100 * glib_minor_version + glib_micro_version)])
@@ -58,6 +58,10 @@ AM_INIT_AUTOMAKE([no-define])
 # Specify a configuration file
 AM_CONFIG_HEADER([config.h])
 
+# Support silent build rules, requires at least automake-1.11. Enable
+# by either passing --enable-silent-rules to configure or passing V=0
+# to make
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
 
 GLIB_MAJOR_VERSION=glib_major_version
 GLIB_MINOR_VERSION=glib_minor_version
@@ -245,12 +249,25 @@ else
   AC_MSG_RESULT([yes])
 fi
 
+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],
+                           [Install runtime libraries relative to libdir])],
+           [],
+          [with_runtime_libdir=""])
+GLIB_RUNTIME_LIBDIR="$with_runtime_libdir"
+ABS_GLIB_RUNTIME_LIBDIR="`readlink -f $libdir/$with_runtime_libdir`"
+AC_SUBST(GLIB_RUNTIME_LIBDIR)
+AC_SUBST(ABS_GLIB_RUNTIME_LIBDIR)
+AM_CONDITIONAL(HAVE_GLIB_RUNTIME_LIBDIR, [test "x$with_runtime_libdir" != "x"])
+
 dnl Checks for programs.
 AC_PROG_CC
 AC_PROG_CPP
 
 dnl Check for a working C++ compiler, but do not bail out, if none is found.
-AC_CHECK_PROGS(CXX, [$CCC c++ g++ gcc CC cxx cc++ cl], [gcc])
+AC_CHECK_TOOLS(CXX, [$CCC c++ g++ gcc CC cxx cc++ cl], [gcc])
 AC_LANG_SAVE
 AC_LANG_CPLUSPLUS
 AC_TRY_COMPILE(,[class a { int b; } c;], ,CXX=)
@@ -441,6 +458,17 @@ AC_MSG_RESULT($enable_iconv_cache)
 
 
 dnl
+dnl zlib support
+dnl
+found_zlib=no
+AC_CHECK_LIB(z, inflate, [AC_CHECK_HEADER(zlib.h, found_zlib=yes)])
+
+if test "x$found_zlib" = "xno" ; then
+   AC_MSG_ERROR([*** Working zlib library and headers not found ***])
+fi
+ZLIB_LIBS='-lz'
+AC_SUBST(ZLIB_LIBS)
+dnl
 dnl gettext support
 dnl
 
@@ -559,14 +587,8 @@ AC_HEADER_STDC
 # Checks for library functions.
 AC_FUNC_VPRINTF
 AC_FUNC_ALLOCA
-AC_CHECK_FUNCS(mmap)
-AC_CHECK_FUNCS(posix_memalign)
-AC_CHECK_FUNCS(memalign)
-AC_CHECK_FUNCS(valloc)
-
-AC_CHECK_FUNCS(atexit on_exit)
-
-AC_CHECK_FUNCS(timegm gmtime_r)
+AC_CHECK_FUNCS(mmap posix_memalign memalign valloc fsync pipe2)
+AC_CHECK_FUNCS(atexit on_exit timegm gmtime_r)
 
 AC_CHECK_SIZEOF(char)
 AC_CHECK_SIZEOF(short)
@@ -853,9 +875,10 @@ fi
 # check for header files
 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 sched.h malloc.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/mount.h sys/vmount.h sys/statfs.h sys/statvfs.h])
 AC_CHECK_HEADERS([mntent.h sys/mnttab.h sys/vfstab.h sys/mntctl.h sys/sysctl.h fstab.h])
+AC_CHECK_HEADERS([sys/uio.h])
 
 # check for structure fields
 AC_CHECK_MEMBERS([struct stat.st_mtimensec, struct stat.st_mtim.tv_nsec, struct stat.st_atimensec, struct stat.st_atim.tv_nsec, struct stat.st_ctimensec, struct stat.st_ctim.tv_nsec])
@@ -941,11 +964,12 @@ fi
 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)
-AC_CHECK_FUNCS(chown lchown fchmod fchown link statvfs statfs utimes getgrgid getpwuid)
+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(getmntent_r setmntent endmntent hasmntopt getmntinfo)
 # Check for high-resolution sleep functions
 AC_CHECK_FUNCS(nanosleep nsleep)
+AC_CHECK_FUNCS(splice)
 
 AC_CHECK_HEADERS(crt_externs.h)
 AC_CHECK_FUNCS(_NSGetEnviron)
@@ -953,6 +977,78 @@ AC_CHECK_FUNCS(_NSGetEnviron)
 AC_FUNC_VSNPRINTF_C99
 AC_FUNC_PRINTF_UNIX98
 
+# Internet address families
+if test $glib_native_win32 = yes; then
+  glib_inet_includes=["
+#include <winsock2.h>
+  "]
+else
+  glib_inet_includes=["
+#include <sys/types.h>
+#include <sys/socket.h>
+  "]
+fi
+
+glib_failed=false
+GLIB_CHECK_VALUE(AF_INET, $glib_inet_includes, glib_failed=true)
+GLIB_CHECK_VALUE(AF_INET6, $glib_inet_includes, glib_failed=true)
+# winsock defines this even though it doesn't support it
+GLIB_CHECK_VALUE(AF_UNIX, $glib_inet_includes, glib_failed=true)
+if $glib_failed ; then
+  AC_MSG_ERROR([Could not determine values for AF_INET* constants])
+fi
+
+glib_failed=false
+GLIB_CHECK_VALUE(MSG_PEEK, $glib_inet_includes, glib_failed=true)
+GLIB_CHECK_VALUE(MSG_OOB, $glib_inet_includes, glib_failed=true)
+GLIB_CHECK_VALUE(MSG_DONTROUTE, $glib_inet_includes, glib_failed=true)
+if $glib_failed ; then
+  AC_MSG_ERROR([Could not determine values for MSG_* constants])
+fi
+
+AC_CHECK_FUNCS(getprotobyname_r endservent)
+AC_CHECK_HEADERS([netdb.h wspiapi.h])
+
+# For gio/libasyncns
+if test $glib_native_win32 = no; then
+  AC_CHECK_FUNCS(strndup setresuid setreuid)
+  AC_CHECK_HEADERS(sys/prctl.h arpa/nameser_compat.h)
+
+  # We can't just use AC_CHECK_FUNC/AC_CHECK_LIB here. Bug 586150
+  AC_MSG_CHECKING([for res_query])
+  AC_TRY_LINK([#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>],
+              [res_query("test", 0, 0, (void *)0, 0);],
+              [AC_MSG_RESULT([yes])],
+              [save_libs="$LIBS"
+               LIBS="-lresolv $LIBS"
+               AC_TRY_LINK([#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>],
+                           [res_query("test", 0, 0, (void *)0, 0);],
+                           [AC_MSG_RESULT([in -lresolv])
+                            LIBASYNCNS_LIBADD="-lresolv"],
+                           [LIBS="-lbind $save_libs"
+                            AC_TRY_LINK([#include <resolv.h>],
+                                        [res_query("test", 0, 0, (void *)0, 0);],
+                                        [AC_MSG_RESULT([in -lbind])
+                                         LIBASYNCNS_LIBADD="-lbind"],
+                                        [AC_MSG_ERROR(not found)])])
+               LIBS="$save_libs"])
+  AC_SUBST(LIBASYNCNS_LIBADD)
+fi
+
+case $host in
+  *-*-solaris* )
+     AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, Needed to get declarations for msg_control and msg_controllen on Solaris)
+     AC_DEFINE(_XOPEN_SOURCE,          2, Needed to get declarations for msg_control and msg_controllen on Solaris)
+     AC_DEFINE(__EXTENSIONS__,         1, Needed to get declarations for msg_control and msg_controllen on Solaris)
+     ;;
+esac
+
 dnl
 dnl if statfs() takes 2 arguments (Posix) or 4 (Solaris)
 dnl
@@ -1534,6 +1630,7 @@ inotify_support=no
 AC_CHECK_HEADERS([sys/inotify.h],
 [
        inotify_support=yes
+       AC_CHECK_FUNCS(inotify_init1)
 ])
 
 AM_CONDITIONAL(HAVE_INOTIFY, [test "$inotify_support" = "yes"])
@@ -2261,6 +2358,7 @@ case $host in
     ;;
 esac
 
+AM_CONDITIONAL(HAVE_THREADS, [test "$have_threads" != "none"])
 AC_DEFINE_UNQUOTED(G_THREAD_SOURCE,"gthread-$have_threads.c",
                   [Source file containing theread implementation])
 AC_SUBST(G_THREAD_CFLAGS)
@@ -2324,103 +2422,119 @@ dnl ********************************
 
 AC_MSG_CHECKING([whether to use assembler code for atomic operations])
 
+glib_cv_gcc_has_builtin_atomic_operations=no
 if test x"$GCC" = xyes; then
-  case $host_cpu in
-    i386)
-      AC_MSG_RESULT([none])
-      glib_memory_barrier_needed=no
-      ;;
-    i?86)
-      AC_MSG_RESULT([i486])
-      AC_DEFINE_UNQUOTED(G_ATOMIC_I486, 1,
-                        [i486 atomic implementation])
-      glib_memory_barrier_needed=no
-      ;;
-    sparc*)
-      SPARCV9_WARNING="Try to rerun configure with CFLAGS='-mcpu=v9',
-               when you are using a sparc with v9 instruction set (most
-               sparcs nowadays). This will make the code for atomic
-               operations much faster. The resulting code will not run
-               on very old sparcs though."
-
-      AC_LINK_IFELSE([[
-        main () 
-        {
-         int tmp1, tmp2, tmp3;
-          __asm__ __volatile__("casx [%2], %0, %1" 
-                              : "=&r" (tmp1), "=&r" (tmp2) : "r" (&tmp3));
-        }]],
-       AC_MSG_RESULT([sparcv9])
-        AC_DEFINE_UNQUOTED(G_ATOMIC_SPARCV9, 1,
-                          [sparcv9 atomic implementation]),
-       AC_MSG_RESULT([no])
-        AC_MSG_WARN([[$SPARCV9_WARNING]]))
-      glib_memory_barrier_needed=yes
-      ;;
-    alpha*)
-      AC_MSG_RESULT([alpha])
-      AC_DEFINE_UNQUOTED(G_ATOMIC_ALPHA, 1,
-                        [alpha atomic implementation])
-      glib_memory_barrier_needed=yes
-      ;;
-    x86_64)
-      AC_MSG_RESULT([x86_64])
-      AC_DEFINE_UNQUOTED(G_ATOMIC_X86_64, 1,
-                        [x86_64 atomic implementation])
-      glib_memory_barrier_needed=no
-     ;;
-    powerpc*)
-      AC_MSG_RESULT([powerpc])
-      AC_DEFINE_UNQUOTED(G_ATOMIC_POWERPC, 1,
-                        [powerpc atomic implementation])
-      glib_memory_barrier_needed=yes
-      AC_MSG_CHECKING([whether asm supports numbered local labels])
-      AC_TRY_COMPILE(
-               ,[ 
-                       __asm__ __volatile__ ("1:       nop\n"
-                                             "         bne-    1b")
-               ],[
-                       AC_DEFINE_UNQUOTED(ASM_NUMERIC_LABELS, 1, [define if asm blocks can use numeric local labels])
-                       AC_MSG_RESULT([yes])
-               ],[
-                       AC_MSG_RESULT([no])
-               ])
-      ;;       
-    ia64)
-      AC_MSG_RESULT([ia64])
-      AC_DEFINE_UNQUOTED(G_ATOMIC_IA64, 1,
-                        [ia64 atomic implementation])
-      glib_memory_barrier_needed=yes
-      ;;       
-    s390|s390x)
-      AC_MSG_RESULT([s390])
-      AC_DEFINE_UNQUOTED(G_ATOMIC_S390, 1,
-                        [s390 atomic implementation])
-      glib_memory_barrier_needed=no
-      ;;       
-    arm*)
-      AC_MSG_RESULT([arm])
-      AC_DEFINE_UNQUOTED(G_ATOMIC_ARM, 1,
-                         [arm atomic implementation])
-      glib_memory_barrier_needed=no
-      ;;
-    crisv32*|etraxfs*)
-      AC_MSG_RESULT([crisv32])
-      AC_DEFINE_UNQUOTED(G_ATOMIC_CRISV32, 1,
-                        [crisv32 atomic implementation])
-      glib_memory_barrier_needed=no
-      ;;
-    cris*|etrax*)
-      AC_MSG_RESULT([cris])
-      AC_DEFINE_UNQUOTED(G_ATOMIC_CRIS, 1,
-                        [cris atomic implementation])
-      glib_memory_barrier_needed=no
-      ;;
-    *)
-      AC_MSG_RESULT([none])
-      glib_memory_barrier_needed=yes
-      ;;
-  esac
+  AC_MSG_CHECKING([whether GCC supports build-in atomic intrinsics])
+  AC_TRY_LINK([],
+             [int i;
+              __sync_synchronize ();
+              __sync_bool_compare_and_swap (&i, 0, 1);
+              __sync_fetch_and_add (&i, 1);
+             ],
+             [glib_cv_gcc_has_builtin_atomic_operations=yes],
+             [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])
+        glib_memory_barrier_needed=no
+        ;;
+      i?86)
+        AC_MSG_RESULT([i486])
+        AC_DEFINE_UNQUOTED(G_ATOMIC_I486, 1,
+                          [i486 atomic implementation])
+        glib_memory_barrier_needed=no
+        ;;
+      sparc*)
+        SPARCV9_WARNING="Try to rerun configure with CFLAGS='-mcpu=v9',
+                        when you are using a sparc with v9 instruction set (most
+                        sparcs nowadays). This will make the code for atomic
+                        operations much faster. The resulting code will not run
+                        on very old sparcs though."
+
+        AC_LINK_IFELSE([[
+          main ()
+          {
+            int tmp1, tmp2, tmp3;
+            __asm__ __volatile__("casx [%2], %0, %1"
+                                 : "=&r" (tmp1), "=&r" (tmp2) : "r" (&tmp3));
+          }]],
+          AC_MSG_RESULT([sparcv9])
+          AC_DEFINE_UNQUOTED(G_ATOMIC_SPARCV9, 1,
+                            [sparcv9 atomic implementation]),
+          AC_MSG_RESULT([no])
+          AC_MSG_WARN([[$SPARCV9_WARNING]]))
+        glib_memory_barrier_needed=yes
+        ;;
+      alpha*)
+        AC_MSG_RESULT([alpha])
+        AC_DEFINE_UNQUOTED(G_ATOMIC_ALPHA, 1,
+                          [alpha atomic implementation])
+        glib_memory_barrier_needed=yes
+        ;;
+      x86_64)
+        AC_MSG_RESULT([x86_64])
+        AC_DEFINE_UNQUOTED(G_ATOMIC_X86_64, 1,
+                          [x86_64 atomic implementation])
+        glib_memory_barrier_needed=no
+       ;;
+      powerpc*)
+        AC_MSG_RESULT([powerpc])
+        AC_DEFINE_UNQUOTED(G_ATOMIC_POWERPC, 1,
+                          [powerpc atomic implementation])
+        glib_memory_barrier_needed=yes
+        AC_MSG_CHECKING([whether asm supports numbered local labels])
+        AC_TRY_COMPILE(
+                      ,[
+                      __asm__ __volatile__ ("1:       nop\n"
+                              "         bne-    1b")
+                      ],[
+                      AC_DEFINE_UNQUOTED(ASM_NUMERIC_LABELS, 1, [define if asm blocks can use numeric local labels])
+                      AC_MSG_RESULT([yes])
+                      ],[
+                      AC_MSG_RESULT([no])
+                      ])
+        ;;
+      ia64)
+        AC_MSG_RESULT([ia64])
+        AC_DEFINE_UNQUOTED(G_ATOMIC_IA64, 1,
+                          [ia64 atomic implementation])
+        glib_memory_barrier_needed=yes
+        ;;
+      s390|s390x)
+        AC_MSG_RESULT([s390])
+        AC_DEFINE_UNQUOTED(G_ATOMIC_S390, 1,
+                          [s390 atomic implementation])
+        glib_memory_barrier_needed=no
+        ;;
+      arm*)
+        AC_MSG_RESULT([arm])
+        AC_DEFINE_UNQUOTED(G_ATOMIC_ARM, 1,
+                          [arm atomic implementation])
+        glib_memory_barrier_needed=no
+        ;;
+      crisv32*|etraxfs*)
+        AC_MSG_RESULT([crisv32])
+        AC_DEFINE_UNQUOTED(G_ATOMIC_CRISV32, 1,
+                          [crisv32 atomic implementation])
+        glib_memory_barrier_needed=no
+        ;;
+      cris*|etrax*)
+        AC_MSG_RESULT([cris])
+        AC_DEFINE_UNQUOTED(G_ATOMIC_CRIS, 1,
+                          [cris atomic implementation])
+        glib_memory_barrier_needed=no
+        ;;
+      *)
+        AC_MSG_RESULT([none])
+        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.
@@ -2428,6 +2542,35 @@ else
   fi
 fi
 
+AM_CONDITIONAL(HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS,
+              [test $glib_cv_gcc_has_builtin_atomic_operations = yes])
+
+dnl ************************
+dnl ** Check for futex(2) **
+dnl ************************
+AC_MSG_CHECKING([for futex(2) system call])
+AC_COMPILE_IFELSE([ 
+#include <linux/futex.h>
+#include <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);
+  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)
+])
+
 dnl ****************************************
 dnl *** GLib POLL* compatibility defines ***
 dnl ****************************************
@@ -2589,7 +2732,8 @@ int error = EILSEQ;
 AC_MSG_RESULT($have_eilseq)
 
 dnl ******************************************************************
-dnl *** Look for glib-genmarshal in PATH if we are cross-compiling ***
+dnl *** If we are cross-compiling, look for glib-genmarshal and    ***
+dnl *** glib-compile-schemas in PATH                               ***
 dnl ******************************************************************
 
 AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
@@ -2599,6 +2743,11 @@ if test $cross_compiling = yes; then
   if test x$GLIB_GENMARSHAL = xno; then
     AC_MSG_ERROR(Could not find a glib-genmarshal in your PATH)
   fi
+
+  AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas, no)
+  if test x$GLIB_COMPILE_SCHEMAS = xno; then
+    AC_MSG_ERROR(Could not find a glib-compile-schemas in your PATH)
+  fi
 fi
 
 dnl **************************
@@ -2630,6 +2779,127 @@ fi
 
 AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
 
+dnl
+dnl Tracing
+dnl
+
+AC_ARG_ENABLE([dtrace],
+             [AS_HELP_STRING([--enable-dtrace],
+                              [Enable inclusion of dtrace trace support])])
+have_dtrace=no
+AC_MSG_CHECKING([whether to include dtrace tracing support])
+if test "x$enable_dtrace" != xno; then
+  AC_MSG_RESULT([yes])
+  AC_CHECK_PROGS(DTRACE, dtrace)
+  if test -z "$DTRACE"; then
+    if test "x$enable_dtrace" = xyes; then
+      AC_MSG_ERROR([dtrace not found])
+    fi
+  fi
+  AC_CHECK_HEADER([sys/sdt.h],have_dtrace=yes,
+                  [if test "x$enable_dtrace" = xyes; then
+                     AC_MSG_ERROR([dtrace support needs sys/sdt.h header])
+                   fi])
+else
+  AC_MSG_RESULT([no])
+fi
+if test "x$have_dtrace" = xyes; then
+  AC_DEFINE([HAVE_DTRACE], [1], [Define to 1 if using dtrace probes.])
+fi
+AM_CONDITIONAL([ENABLE_DTRACE], [test x$have_dtrace = xyes ])
+
+AC_MSG_CHECKING([whether to include systemtap tracing support])
+AC_ARG_ENABLE([systemtap],
+             [AS_HELP_STRING([--enable-systemtap],
+                              [Enable inclusion of systemtap trace support])])
+have_systemtap=no
+if test "x$enable_systemtap" != xno -a "x$have_dtrace" = xyes; then
+  have_systemtap=yes
+fi
+AC_MSG_RESULT(${have_systemtap})
+
+AM_CONDITIONAL([ENABLE_SYSTEMTAP], [test x$have_systemtap = xyes])
+
+AC_ARG_WITH([tapset-install-dir],
+            [AS_HELP_STRING([--with-tapset-install-dir],
+            [The absolute path where the systemtap tapsets will be installed])],
+            [if test "x${withval}" = x; then
+              ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset"
+            else
+              ABS_TAPSET_DIR="${withval}"
+             fi],
+           [ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset"])
+AC_SUBST(ABS_TAPSET_DIR)
+
+dnl ************************************
+dnl *** Enable lcov coverage reports ***
+dnl ************************************
+
+AC_ARG_ENABLE(gcov,
+  AS_HELP_STRING([--enable-gcov],
+                [Enable gcov]),
+  [use_gcov=$enableval], [use_gcov=no])
+
+if test "x$use_gcov" = "xyes"; then
+  dnl we need gcc:
+  if test "$GCC" != "yes"; then
+    AC_MSG_ERROR([GCC is required for --enable-gcov])
+  fi
+
+  dnl Check if ccache is being used
+  AC_CHECK_PROG(SHTOOL, shtool, shtool)
+  case `$SHTOOL path $CC` in
+    *ccache*[)] gcc_ccache=yes;;
+    *[)] gcc_ccache=no;;
+  esac
+
+  if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
+    AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
+  fi
+
+  ltp_version_list="1.6 1.7 1.8"
+  AC_CHECK_PROG(LTP, lcov, lcov)
+  AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
+
+  if test "$LTP"; then
+    AC_CACHE_CHECK([for ltp version], glib_cv_ltp_version, [
+      glib_cv_ltp_version=invalid
+      ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
+      for ltp_check_version in $ltp_version_list; do
+        if test "$ltp_version" = "$ltp_check_version"; then
+          glib_cv_ltp_version="$ltp_check_version (ok)"
+        fi
+      done
+    ])
+  else
+    ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
+    AC_MSG_ERROR([$ltp_msg])
+  fi
+
+  case $glib_cv_ltp_version in
+    ""|invalid[)]
+      ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
+      AC_MSG_ERROR([$ltp_msg])
+      LTP="exit 0;"
+      ;;
+  esac
+
+  if test -z "$LTP_GENHTML"; then
+    AC_MSG_ERROR([Could not find genhtml from the LTP package])
+  fi
+
+  AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])
+
+  dnl Remove all optimization flags from CFLAGS
+  changequote({,})
+  CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
+  changequote([,])
+
+  dnl Add the special gcc flags
+  CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
+  LDFLAGS="$LDFLAGS -lgcov"
+fi
+
 dnl ******************************
 dnl *** output the whole stuff ***
 dnl ******************************
@@ -2789,6 +3059,10 @@ _______EOF
 
 typedef signed $glib_intptr_type_define gintptr;
 typedef unsigned $glib_intptr_type_define guintptr;
+
+#define G_GINTPTR_MODIFIER      $gintptr_modifier
+#define G_GINTPTR_FORMAT        $gintptr_format
+#define G_GUINTPTR_FORMAT       $guintptr_format
 _______EOF
        else
          echo '#error SIZEOF_VOID_P unknown - This should never happen' >>$outfile
@@ -2965,6 +3239,10 @@ _______EOF
 #define GUINT_TO_LE(val)       ((guint) GUINT${gintbits}_TO_LE (val))
 #define GINT_TO_BE(val)                ((gint) GINT${gintbits}_TO_BE (val))
 #define GUINT_TO_BE(val)       ((guint) GUINT${gintbits}_TO_BE (val))
+#define GSIZE_TO_LE(val)       ((gsize) GUINT${gsizebits}_TO_LE (val))
+#define GSSIZE_TO_LE(val)      ((gssize) GINT${gsizebits}_TO_LE (val))
+#define GSIZE_TO_BE(val)       ((gsize) GUINT${gsizebits}_TO_BE (val))
+#define GSSIZE_TO_BE(val)      ((gssize) GINT${gsizebits}_TO_BE (val))
 #define G_BYTE_ORDER $g_byte_order
 
 #define GLIB_SYSDEF_POLLIN =$g_pollin
@@ -2985,6 +3263,14 @@ _______EOF
  */
 typedef $g_pid_type GPid;
 
+#define GLIB_SYSDEF_AF_UNIX $g_af_unix
+#define GLIB_SYSDEF_AF_INET $g_af_inet
+#define GLIB_SYSDEF_AF_INET6 $g_af_inet6
+
+#define GLIB_SYSDEF_MSG_OOB $g_msg_oob
+#define GLIB_SYSDEF_MSG_PEEK $g_msg_peek
+#define GLIB_SYSDEF_MSG_DONTROUTE $g_msg_dontroute
+
 G_END_DECLS
 
 #endif /* GLIBCONFIG_H */
@@ -3156,25 +3442,38 @@ esac
 
 gintbits=`expr $ac_cv_sizeof_int \* 8`
 glongbits=`expr $ac_cv_sizeof_long \* 8`
+gsizebits=`expr $ac_cv_sizeof_size_t \* 8`
 
 case $ac_cv_sizeof_void_p in
 $ac_cv_sizeof_int)
   glib_intptr_type_define=int
+  gintptr_modifier='""'
+  gintptr_format='"i"'
+  guintptr_format='"u"'
   glib_gpi_cast=''
   glib_gpui_cast=''
   ;;
 $ac_cv_sizeof_long)
   glib_intptr_type_define=long
+  gintptr_modifier='"l"'
+  gintptr_format='"li"'
+  guintptr_format='"lu"'
   glib_gpi_cast='(glong)'
   glib_gpui_cast='(gulong)'
   ;;
 $ac_cv_sizeof_long_long)
   glib_intptr_type_define='long long'
+  gintptr_modifier='"I64"'
+  gintptr_format='"I64i"'
+  guintptr_format='"I64u"'
   glib_gpi_cast='(gint64)'
   glib_gpui_cast='(guint64)'
   ;;
 $ac_cv_sizeof___int64)
   glib_intptr_type_define=__int64
+  gintptr_modifier='"I64"'
+  gintptr_format='"I64i"'
+  guintptr_format='"I64u"'
   glib_gpi_cast='(gint64)'
   glib_gpui_cast='(guint64)'
   ;;
@@ -3271,6 +3570,14 @@ g_pollhup=$glib_cv_value_POLLHUP
 g_pollerr=$glib_cv_value_POLLERR
 g_pollnval=$glib_cv_value_POLLNVAL
 
+g_af_unix=$glib_cv_value_AF_UNIX
+g_af_inet=$glib_cv_value_AF_INET
+g_af_inet6=$glib_cv_value_AF_INET6
+
+g_msg_peek=$glib_cv_value_MSG_PEEK
+g_msg_oob=$glib_cv_value_MSG_OOB
+g_msg_dontroute=$glib_cv_value_MSG_DONTROUTE
+
 g_stack_grows=$glib_cv_stack_grows
 
 g_have_eilseq=$have_eilseq
@@ -3316,6 +3623,32 @@ if test x$glib_win32_static_compilation = xyes; then
 fi
 ])
 
+# Check for libdbus1 - Optional - is only used in the GDBus test cases
+#
+# 1.2.14 required for dbus_message_set_serial
+PKG_CHECK_MODULES(DBUS1,
+                  dbus-1 >= 1.2.14,
+                  [AC_DEFINE(HAVE_DBUS1, 1, [Define if dbus-1 is available]) have_dbus1=yes],
+                  have_dbus1=no)
+AC_SUBST(DBUS1_CFLAGS)
+AC_SUBST(DBUS1_LIBS)
+AM_CONDITIONAL(HAVE_DBUS1, [test "x$have_dbus1" = "xyes"])
+
+dnl
+dnl Check for -Bsymbolic-functions linker flag used to avoid
+dnl intra-library PLT jumps, if available.
+dnl
+SAVED_LDFLAGS="${LDFLAGS}"
+AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
+LDFLAGS=-Wl,-Bsymbolic-functions
+AC_TRY_LINK([], [int main (void) { return 0; }],
+            GLIB_LINK_FLAGS=-Wl[,]-Bsymbolic-functions
+            AC_MSG_RESULT(yes),
+            GLIB_LINK_FLAGS=
+            AC_MSG_RESULT(no))
+AC_SUBST(GLIB_LINK_FLAGS)
+LDFLAGS="${SAVED_LDFLAGS}"
+
 AC_CONFIG_FILES([
 glib-2.0.pc
 glib-2.0-uninstalled.pc
@@ -3330,6 +3663,7 @@ gobject-2.0.pc
 gobject-2.0-uninstalled.pc
 gio-2.0.pc
 gio-unix-2.0.pc
+gio-windows-2.0.pc
 gio-2.0-uninstalled.pc
 gio-unix-2.0-uninstalled.pc
 glib-zip
@@ -3338,9 +3672,9 @@ Makefile
 build/Makefile
 build/win32/Makefile
 build/win32/dirent/Makefile
-build/win32/vs8/Makefile
 build/win32/vs9/Makefile
 glib/Makefile
+glib/glib.stp
 glib/libcharset/Makefile
 glib/gnulib/Makefile
 glib/pcre/Makefile
@@ -3349,12 +3683,15 @@ glib/tests/Makefile
 gmodule/Makefile
 gmodule/gmoduleconf.h
 gobject/Makefile
+gobject/gobject.stp
 gobject/glib-mkenums
 gobject/tests/Makefile
 gthread/Makefile
+gthread/tests/Makefile
 gio/Makefile
 gio/xdgmime/Makefile
 gio/inotify/Makefile
+gio/libasyncns/Makefile
 gio/fen/Makefile
 gio/fam/Makefile
 gio/win32/Makefile
@@ -3396,6 +3733,7 @@ if false; then
     gobject/gobject.rc
     gthread/makefile.msc
     gthread/gthread.rc
+    gio/gio.rc
     tests/makefile.msc
   ])
 fi