Added gmodule-no-export-2.0-uninstalled.pc.in to allow building of other
[platform/upstream/glib.git] / configure.in
index 5db6be0..18cc760 100644 (file)
@@ -26,7 +26,7 @@ m4_include(m4macros/glib-gettext.m4)dnl
 # set glib_binary_age _and_ glib_interface_age to 0.
 #
 m4_define([glib_major_version], [2])
-m4_define([glib_minor_version], [3])
+m4_define([glib_minor_version], [7])
 m4_define([glib_micro_version], [0])
 m4_define([glib_interface_age], [0])
 m4_define([glib_binary_age],
@@ -131,6 +131,7 @@ case "$host" in
     GOBJECT_DEF=gobject.def
     GTHREAD_DEF=gthread.def
     TESTGMODULE_EXP=testgmodule.exp
+    glib_pid_type='void *'
     ;;
   *)
     glib_native_win32=no
@@ -143,10 +144,20 @@ case "$host" in
     GOBJECT_DEF=
     GTHREAD_DEF=
     TESTGMODULE_EXP=
+    glib_pid_type=int
     ;;
 esac
+case $host in
+  *-*-linux*)
+    glib_os_linux=yes
+    ;;
+esac
+
+
 AC_MSG_RESULT([$glib_native_win32])
 AM_CONDITIONAL(OS_WIN32, [test "$glib_native_win32" = "yes"])
+AM_CONDITIONAL(OS_UNIX, [test "$glib_native_win32" != "yes"])
+AM_CONDITIONAL(OS_LINUX, [test "$glib_os_linux" = "yes"])
 AC_SUBST(G_LIB_WIN32_RESOURCE)
 AC_SUBST(G_MODULE_WIN32_RESOURCE)
 AC_SUBST(G_OBJECT_WIN32_RESOURCE)
@@ -158,10 +169,25 @@ AC_SUBST(GTHREAD_DEF)
 AC_SUBST(TESTGMODULE_EXP)
 
 if test "$glib_native_win32" = "yes"; then
+  AC_CHECK_TOOL(NM, nm, no)
+  if test "$NM" = no; then
+    AC_MSG_ERROR([*** Could not find an implementation of nm in your PATH.])
+  fi
+  AC_CHECK_TOOL(RANLIB, ranlib, :)
   AC_CHECK_PROG(ms_librarian, [lib.exe], [yes], [no])
 fi
 AM_CONDITIONAL(MS_LIB_AVAILABLE, [test x$ms_librarian = xyes])
 
+if test "$glib_native_win32" != yes; then
+    # libtool option to control which symbols are exported
+    # right now, symbols starting with _ are not exported
+    LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
+else
+    # We currently use .def files on Windows
+    LIBTOOL_EXPORT_OPTIONS=
+fi
+AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
+
 dnl declare --enable-* args and collect ac_help strings
 AC_ARG_ENABLE(debug,
               AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
@@ -176,10 +202,6 @@ AC_ARG_ENABLE(mem_pools,
               [AC_HELP_STRING([--disable-mem-pools],
                              [disable all glib memory pools])],,
              [disable_mem_pools=no])
-AC_ARG_ENABLE(ansi,
-              [AC_HELP_STRING([--enable-ansi],
-                              [turn on strict ansi [default=no]])],,
-             [enable_ansi=no])
 AC_ARG_ENABLE(threads,
               [AC_HELP_STRING([--enable-threads],
                               [turn on basic thread support [default=yes]
@@ -189,6 +211,10 @@ AC_ARG_ENABLE(rebuilds,
               [AC_HELP_STRING([--disable-rebuilds],
                               [disable all source autogeneration rules])],,
               [enable_rebuilds=yes])
+AC_ARG_ENABLE(visibility,
+              [AC_HELP_STRING([--disable-visibility],
+                              [don't use ELF visibility attributes])],,
+              [enable_visibility=yes])
 
 if test "x$enable_threads" != "xyes"; then
   enable_threads=no
@@ -273,6 +299,10 @@ else
   fi
 fi
 
+if test "x$enable_visibility" = "xno"; then
+  GLIB_DEBUG_FLAGS="$GLIB_DEBUG_FLAGS -DDISABLE_VISIBILITY"
+fi
+
 # Ensure MSVC-compatible struct packing convention is used when
 # compiling for Win32 with gcc.
 # What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
@@ -308,7 +338,6 @@ if test x"$glib_native_win32" = xyes; then
   fi
 fi
 
-AC_CYGWIN
 AC_EXEEXT
 
 # define a MAINT-like variable REBUILD which is set if Perl
@@ -379,7 +408,7 @@ dnl
 dnl gettext support
 dnl
 
-ALL_LINGUAS="am ar az be bg bn ca cs cy da de el eo es et eu fa fi fr gl he hi id is it ja ko lt lv mk mn ms nl nn no pl pt pt_BR ro ru sk sl sq sr sr@Latn sv ta tr uk vi yi zh_CN zh_TW"
+ALL_LINGUAS="am ar az be bg bn bs ca cs cy da de el en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu id is it ja ko lt lv mk mn ms nb ne nl nn no or pa pl pt pt_BR ro ru rw sk sl sq sr sr@ije sr@Latn sv ta tl tr uk vi wa xh yi zh_CN zh_TW"
 GLIB_GNU_GETTEXT
 
 if test "$gt_cv_have_gettext" != "yes" ; then
@@ -421,6 +450,7 @@ esac
 
 dnl Initialize libtool
 AM_DISABLE_STATIC
+AC_LIBTOOL_WIN32_DLL
 AM_PROG_LIBTOOL
 
 if test "x$GCC" = "xyes"; then
@@ -428,18 +458,6 @@ if test "x$GCC" = "xyes"; then
   *[[\ \       ]]-Wall[[\ \    ]]*) ;;
   *) CFLAGS="$CFLAGS -Wall" ;;
   esac
-
-  if test "x$enable_ansi" = "xyes"; then
-    case " $CFLAGS " in
-    *[[\ \     ]]-ansi[[\ \    ]]*) ;;
-    *) CFLAGS="$CFLAGS -ansi" ;;
-    esac
-
-    case " $CFLAGS " in
-    *[[\ \     ]]-pedantic[[\ \        ]]*) ;;
-    *) CFLAGS="$CFLAGS -pedantic" ;;
-    esac
-  fi
 fi
 
 dnl
@@ -505,7 +523,7 @@ else
 ])
 fi
 
-if test x$ac_cv_sizeof_long_long = x8; then
+if test x$glib_native_win32 != xyes && test x$ac_cv_sizeof_long_long = x8; then
        # long long is a 64 bit integer.
        AC_MSG_CHECKING(for format to printf and scanf a guint64)
        AC_CACHE_VAL(glib_cv_long_long_format,[
@@ -527,16 +545,20 @@ if test x$ac_cv_sizeof_long_long = x8; then
        if test -n "$glib_cv_long_long_format"; then
          AC_MSG_RESULT(%${glib_cv_long_long_format}u)
          AC_DEFINE(HAVE_LONG_LONG_FORMAT,1,[define if system printf can print long long])
+         if test x"$glib_cv_long_long_format" = xI64; then
+           AC_DEFINE(HAVE_INT64_AND_I64,1,[define to support printing 64-bit integers with format I64])
+         fi
         else
          AC_MSG_RESULT(none)
         fi
 elif test x$ac_cv_sizeof___int64 = x8; then
        # __int64 is a 64 bit integer.
        AC_MSG_CHECKING(for format to printf and scanf a guint64)
-       # We know this is MSVC, and what the formats are
+       # We know this is MSVCRT.DLL, and what the formats are
        glib_cv_long_long_format=I64
        AC_MSG_RESULT(%${glib_cv_long_long_format}u)
         AC_DEFINE(HAVE_LONG_LONG_FORMAT,1,[define if system printf can print long long])
+       AC_DEFINE(HAVE_INT64_AND_I64,1,[define to support printing 64-bit integers with format I64])
 fi
 
 dnl long doubles were not used, and a portability problem
@@ -630,6 +652,34 @@ case x$glib_cv_hasinline in
 xyes) AC_DEFINE(G_HAVE_INLINE,1,[Have inline keyword])
 esac
 
+# if we can use inline functions in headers
+AC_MSG_CHECKING(if inline functions in headers work)
+AC_LINK_IFELSE([
+#if defined (G_HAVE_INLINE) && defined (__GNUC__) && defined (__STRICT_ANSI__)
+#  undef inline
+#  define inline __inline__
+#elif !defined (G_HAVE_INLINE)
+#  undef inline
+#  if defined (G_HAVE___INLINE__)
+#    define inline __inline__
+#  elif defined (G_HAVE___INLINE)
+#    define inline __inline
+#  endif
+#endif
+
+int glib_test_func2 (int);
+
+static inline int
+glib_test_func1 (void) {
+  return glib_test_func2 (1);
+}
+
+int
+main (void) {
+  int i = 1;
+}],[g_can_inline=yes],[g_can_inline=no])
+AC_MSG_RESULT($g_can_inline)
+
 # check for flavours of varargs macros
 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
 AC_TRY_COMPILE([],[
@@ -662,6 +712,41 @@ call_a(2,3);
 ],g_have_gnuc_varargs=yes,g_have_gnuc_varargs=no)
 AC_MSG_RESULT($g_have_gnuc_varargs)
 
+# check for GNUC visibility support
+AC_MSG_CHECKING(for GNUC visibility attribute)
+GLIB_CHECK_COMPILE_WARNINGS([
+void
+__attribute__ ((visibility ("hidden")))
+     f_hidden (void)
+{
+}
+void
+__attribute__ ((visibility ("internal")))
+     f_internal (void)
+{
+}
+void
+__attribute__ ((visibility ("protected")))
+     f_protected (void)
+{
+}
+void
+__attribute__ ((visibility ("default")))
+     f_default (void)
+{
+}
+int main (int argc, char **argv)
+{
+       f_hidden();
+       f_internal();
+       f_protected();
+       f_default();
+       return 0;
+}
+],g_have_gnuc_visibility=yes,g_have_gnuc_visibility=no)
+AC_MSG_RESULT($g_have_gnuc_visibility)
+AM_CONDITIONAL(HAVE_GNUC_VISIBILITY, [test x$g_have_gnuc_visibility = xyes])
+
 # check for bytesex stuff
 AC_C_BIGENDIAN
 
@@ -675,21 +760,6 @@ jm_GLIBC21
 AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
 AC_CHECK_FUNCS(setlocale)
 
-AC_MSG_CHECKING(whether make is GNU Make)
-STRIP_BEGIN=
-STRIP_END=
-if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
-        STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
-        STRIP_END=')'
-        AC_MSG_RESULT(yes)
-else
-        AC_MSG_RESULT(no)
-fi
-STRIP_DUMMY=
-AC_SUBST(STRIP_DUMMY)
-AC_SUBST(STRIP_BEGIN)
-AC_SUBST(STRIP_END)
-
 # check additional type sizes
 AC_CHECK_SIZEOF(size_t)
 
@@ -781,7 +851,9 @@ AM_CONDITIONAL(HAVE_GOOD_PRINTF, test "$enable_included_printf" != "yes")
 if test "$enable_included_printf" != "yes" ; then 
   AC_DEFINE(HAVE_GOOD_PRINTF,1,[define to use system printf])
 else
-  glib_cv_long_long_format="ll"
+  if test -z "$glib_cv_long_long_format" ; then
+    glib_cv_long_long_format="ll"
+  fi
   AC_DEFINE(HAVE_VASPRINTF,1)
 fi
 
@@ -1017,6 +1089,13 @@ if test -z "$G_MODULE_IMPL"; then
   *-*-mingw*|*-*-cygwin*) G_MODULE_IMPL=G_MODULE_IMPL_WIN32 ;;
   esac
 fi
+dnl *** force native AIX library loader
+dnl *** dlopen() filepath must be of the form /path/libname.a(libname.so)
+if test -z "$G_MODULE_IMPL"; then
+  case "$host" in
+  *-*-aix*) G_MODULE_IMPL=G_MODULE_IMPL_AR ;;
+  esac
+fi
 dnl *** dlopen() and dlsym() in system libraries
 if test -z "$G_MODULE_IMPL"; then
        AC_CHECK_FUNC(dlopen,
@@ -1062,6 +1141,9 @@ if test "$G_MODULE_IMPL" = "G_MODULE_IMPL_DL"; then
        LIBS="$G_MODULE_LIBS $LIBS"
        LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
 dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness
+       echo "void glib_plugin_test(void) { }" > plugin.c
+       ${SHELL} ./libtool --mode=compile ${CC} -shared \
+               -export-dynamic -o plugin.o plugin.c 2>&1 >/dev/null
        AC_CACHE_CHECK([for RTLD_GLOBAL brokenness],
                glib_cv_rtldglobal_broken,[
                AC_TRY_RUN([
@@ -1072,19 +1154,20 @@ dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness
 #ifndef RTLD_LAZY
 #  define RTLD_LAZY 0
 #endif
-int pthread_create;
+int glib_plugin_test;
 int main () {
     void *handle, *global, *local;
-    global = &pthread_create;
-    handle = dlopen ("libpthread.so", RTLD_GLOBAL | RTLD_LAZY);
+    global = &glib_plugin_test;
+    handle = dlopen ("./.libs/plugin.o", RTLD_GLOBAL | RTLD_LAZY);
     if (!handle) return 0;
-    local = dlsym (handle, "pthread_create");
+    local = dlsym (handle, "glib_plugin_test");
     return global == local;
 }                       ],
                        [glib_cv_rtldglobal_broken=no],
                        [glib_cv_rtldglobal_broken=yes],
                        [glib_cv_rtldglobal_broken=no])
-               rm -f plugin.c plugin.o plugin.lo
+               rm -f plugin.c plugin.o plugin.lo .libs/plugin.o
+               rmdir .libs 2>/dev/null
        ])
        if test "x$glib_cv_rtldglobal_broken" = "xyes"; then
                G_MODULE_BROKEN_RTLD_GLOBAL=1
@@ -1139,6 +1222,9 @@ case "$host_os" in
   cygwin* | mingw*)
     glib_gmodule_suffix='dll'
     ;;
+  aix*)
+    glib_gmodule_suffix='a'
+    ;;
   *)
     glib_gmodule_suffix='so'    
     ;;
@@ -1188,27 +1274,6 @@ esac
 AC_MSG_RESULT($GIO)
 AC_SUBST(GIO)
 
-dnl check for cpu to enable double checked locking when possible
-dnl ************************************************************
-
-if test x"$have_threads" != xno; then
-       AC_MSG_CHECKING(whether double checked locking is safe)
-       # According to glibc/linuxthreads the following platforms do
-       # not have the notion of a read or write memory barrier and
-       # therefore the double checked locking should be safe. Have a
-       # look at pthread_once in glibc/linuxthreads/mutex.c to see,
-       # what this means.
-       case $host_cpu in
-               arm|hppa|i386|i686|ia64|m68k|sh|cris|x86_64)
-                       g_use_double_checked_locking=yes
-               ;;
-               *)
-                       g_use_double_checked_locking=no
-               ;;
-       esac
-       AC_MSG_RESULT($g_use_double_checked_locking)
-fi
-
 dnl ****************************************
 dnl *** platform dependent source checks ***
 dnl ****************************************
@@ -1412,21 +1477,28 @@ if test x"$have_threads" != xno; then
     # both CPPFLAG and LIBS. 
     # One of them does for most gcc versions and some other platforms/compilers
     # too and could be considered as the canonical way to go. 
-    for flag in pthread pthreads; do
-      glib_save_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -$flag"
-      AC_TRY_RUN(glib_thread_test(0),
-                 glib_flag_works=yes,
-                 glib_flag_works=no,
-                 [AC_LINK_IFELSE(glib_thread_test(0),
-                                 glib_flag_works=yes,
-                                 glib_flag_works=no)])
-      CFLAGS="$glib_save_CFLAGS"
-      if test $glib_flag_works = yes ; then
-         G_THREAD_CFLAGS=-$flag
-        G_THREAD_LIBS=-$flag
-      fi
-    done
+    case $host in
+      *-*-cygwin*)
+         # skip cygwin -pthread or -pthreads test
+         ;;
+      *)
+        for flag in pthread pthreads; do
+          glib_save_CFLAGS="$CFLAGS"
+          CFLAGS="$CFLAGS -$flag"
+          AC_TRY_RUN(glib_thread_test(0),
+                     glib_flag_works=yes,
+                     glib_flag_works=no,
+                     [AC_LINK_IFELSE(glib_thread_test(0),
+                                     glib_flag_works=yes,
+                                     glib_flag_works=no)])
+          CFLAGS="$glib_save_CFLAGS"
+          if test $glib_flag_works = yes ; then
+             G_THREAD_CFLAGS=-$flag
+            G_THREAD_LIBS=-$flag
+          fi
+        done
+         ;;
+    esac 
   fi
 
   if test x"$G_THREAD_CFLAGS" = x; then
@@ -1761,32 +1833,6 @@ int main () {
                fi
                AC_DEFINE_UNQUOTED(POSIX_YIELD_FUNC,$posix_yield_func,[The POSIX RT yield function])
                CPPFLAGS="$glib_save_CPPFLAGS"
-
-               AC_CACHE_CHECK([whether to use the PID niceness surrogate for thread priorities], 
-                               glib_cv_use_pid_surrogate, 
-                 [AC_TRY_RUN([
-#include <pthread.h> 
-#include <sys/types.h>
-#include <unistd.h>
-pid_t other_pid = 0;
-
-void* func(void* data) {other_pid = getpid();}
-main()
-{ pthread_t t; 
-  void *ret;
-  pthread_create (&t, 0, func, NULL);
-  pthread_join (t, &ret);
-  exit (getpid()==other_pid || 
-       $posix_priority_min != $posix_priority_max);
-}               ],
-               [glib_cv_use_pid_surrogate=yes],
-                [glib_cv_use_pid_surrogate=no],
-                [])])
-         GLIB_ASSERT_SET(glib_cv_use_pid_surrogate)
-          if test "$glib_cv_use_pid_surrogate" = "yes" ; then
-           AC_DEFINE(G_THREAD_USE_PID_SURROGATE, 1, 
-                      [whether to use the PID niceness surrogate for thread priorities])
-          fi
            
        elif test x"$have_threads" = xwin32; then
                # It's a pointer to a private struct
@@ -1817,14 +1863,13 @@ fi
 # 
 #  a) GCC < 3.3 for Linux doesn't include -lpthread when
 #     building shared libraries with linux.
-#  b) libtool doesn't recognize -pthread as a library dependency.
 #
 case $host in
   *-*-linux*)
     G_THREAD_LIBS_FOR_GTHREAD="`echo $G_THREAD_LIBS | sed s/-pthread/-lpthread/`"
     ;;
-  *)
-    G_THREAD_LIBS_FOR_GTHREAD="`echo $G_THREAD_LIBS | sed s/-pthread/-Wc,-pthread/`"
+  *)    
+    G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS"          
     ;;
 esac
 
@@ -1861,6 +1906,76 @@ if test $mutex_has_default = yes ; then
        LIBS="$glib_save_LIBS"
 fi
 
+dnl ********************************
+dnl *** g_atomic_* tests for gcc ***
+dnl ********************************
+
+AC_MSG_CHECKING([whether to use assembler code for atomic operations])
+
+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
+      ;;       
+    ia64)
+      AC_MSG_RESULT([ia64])
+      AC_DEFINE_UNQUOTED(G_ATOMIC_IA64, 1,
+                        [ia64 atomic implementation])
+      glib_memory_barrier_needed=yes
+      ;;       
+    *)
+      AC_MSG_RESULT([none])
+      glib_memory_barrier_needed=yes
+      ;;
+  esac
+fi
+
 dnl ****************************************
 dnl *** GLib POLL* compatibility defines ***
 dnl ****************************************
@@ -1900,7 +2015,7 @@ case $host in
        G_LIBS_EXTRA="-luser32 -lkernel32"
     ;;
   *-*-mingw*)
-       G_LIBS_EXTRA="-lwsock32"
+       G_LIBS_EXTRA="-lws2_32 -lole32"
     ;;
   *)
        G_LIBS_EXTRA=""
@@ -1943,19 +2058,23 @@ AC_ARG_ENABLE(man,
               [AC_HELP_STRING([--enable-man],
                               [regenerate man pages from Docbook [default=no]])],enable_man=yes,
               enable_man=no)
+
+if test "${enable_man}" != no; then
 dnl
 dnl Check for xsltproc
 dnl
 AC_PATH_PROG([XSLTPROC], [xsltproc])
-if test -z "$XSLTPROC"; then
-  enable_man=no
+  if test -z "$XSLTPROC"; then
+    enable_man=no
+  fi
+
+  dnl check for DocBook DTD and stylesheets 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)
+  JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
+     [DocBook XSL Stylesheets],,enable_man=no)
 fi
 
-dnl check for DocBook DTD and stylesheets 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)
-JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
-   [DocBook XSL Stylesheets],,enable_man=no)
 AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
 
 dnl ******************************
@@ -2014,10 +2133,6 @@ G_BEGIN_DECLS
 #define G_MAXLONG      $glib_Ml
 #define G_MAXULONG     $glib_Mul
 
-#define G_MININT64     G_GINT64_CONSTANT(0x8000000000000000)
-#define G_MAXINT64     G_GINT64_CONSTANT(0x7fffffffffffffff)
-#define G_MAXUINT64    G_GINT64_CONSTANT(0xffffffffffffffffU)
-
 _______EOF
 
 
@@ -2080,8 +2195,15 @@ _______EOF
 
 _______EOF
 
-echo "typedef signed $glib_size_type_define gssize;" >> $outfile
-echo "typedef unsigned $glib_size_type_define gsize;" >> $outfile
+        cat >>$outfile <<_______EOF
+typedef signed $glib_size_type_define gssize;
+typedef unsigned $glib_size_type_define gsize;
+#define G_GSIZE_MODIFIER $gsize_modifier
+#define G_GSSIZE_FORMAT $gssize_format
+#define G_GSIZE_FORMAT $gsize_format
+
+#define G_MAXSIZE      G_MAXU$glib_msize_type
+_______EOF
 
        if test -z "$glib_unknown_void_p"; then
          cat >>$outfile <<_______EOF
@@ -2112,6 +2234,20 @@ $glib_vacopy
 $glib_inline
 #endif /* !__cplusplus */
 
+#ifdef __cplusplus
+#define G_CAN_INLINE   1
+_______EOF
+
+       if test x$g_can_inline = xyes ; then
+               cat >>$outfile <<_______EOF
+#else  /* !__cplusplus */
+#define G_CAN_INLINE   1
+_______EOF
+       fi
+
+       cat >>$outfile <<_______EOF
+#endif
+
 _______EOF
 
        if test x$g_have_iso_c_varargs = xyes ; then
@@ -2163,6 +2299,18 @@ _______EOF
 
        fi
 
+       if test x$g_have_gnuc_visibility = xyes ; then
+               cat >>$outfile <<_______EOF
+#define G_HAVE_GNUC_VISIBILITY 1
+#define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
+_______EOF
+       else
+               cat >>$outfile <<_______EOF
+#define G_GNUC_INTERNAL
+_______EOF
+       fi
+
+
        echo >>$outfile
        if test x$g_mutex_has_default = xyes; then
                cat >>$outfile <<_______EOF
@@ -2195,24 +2343,6 @@ typedef struct _GMutex* GStaticMutex;
 _______EOF
        fi
 
-       if test x$g_use_double_checked_locking = xyes; then
-               cat >>$outfile <<_______EOF
-/* double checked locking can be used on this platform */
-#define g_once(once, func, arg) \\
-  ((once)->status == G_ONCE_STATUS_READY ? (once)->retval : \\
-   g_once_impl (once, func, arg))
-#define g_static_mutex_get_mutex_impl_shortcut(mutex) \\
-  (*(mutex) ? *(mutex) : g_static_mutex_get_mutex_impl (mutex))
-_______EOF
-       else
-               cat >>$outfile <<_______EOF
-/* double checked locking is unsafe to use on this platform, do full locking */
-#define g_once(once, func, arg) (g_once_impl(once, func, arg))
-#define g_static_mutex_get_mutex_impl_shortcut(mutex) \\
-  (g_static_mutex_get_mutex_impl (mutex))
-_______EOF
-fi             
-
        cat >>$outfile <<_______EOF
 /* This represents a system thread as used by the implementation. An
  * alien implementaion, as loaded by g_thread_init can only count on
@@ -2227,6 +2357,10 @@ union _GSystemThread
   long   dummy_long;
 };
 _______EOF
+       if test x"$g_memory_barrier_needed" != xno; then
+         echo >>$outfile
+         echo "#define G_ATOMIC_OP_MEMORY_BARRIER_NEEDED 1" >>$outfile
+       fi
 
        echo >>$outfile
        g_bit_sizes="16 32 64"
@@ -2259,6 +2393,8 @@ _______EOF
 
 #define G_MODULE_SUFFIX "$g_module_suffix"
 
+typedef $g_pid_type GPid;
+
 G_END_DECLS
 
 #endif /* GLIBCONFIG_H */
@@ -2393,6 +2529,27 @@ glib_size_type_define=$glib_size_type
 glib_void_p=$ac_cv_sizeof_long
 glib_long=$ac_cv_sizeof_void_p
 
+case $glib_size_type in
+short)
+  gsize_modifier='"h"'
+  gsize_format='"hu"'
+  gssize_format='"hi"'
+  glib_msize_type='SHRT'
+  ;;
+int)
+  gsize_modifier='""'
+  gsize_format='"u"'
+  gssize_format='"i"'
+  glib_msize_type='INT'
+  ;;
+long)
+  gsize_modifier='"l"'
+  gsize_format='"lu"'
+  gssize_format='"li"'
+  glib_msize_type='LONG'
+  ;;
+esac
+
 gintbits=`expr $ac_cv_sizeof_int \* 8`
 glongbits=`expr $ac_cv_sizeof_long \* 8`
 
@@ -2422,7 +2579,7 @@ esac
 case xyes in
 x$ac_cv_func_memmove)
   glib_memmove='
-#define g_memmove(d,s,n) G_STMT_START { memmove ((d), (s), (n)); } G_STMT_END'
+#define g_memmove(dest,src,len) G_STMT_START { memmove ((dest), (src), (len)); } G_STMT_END'
   ;;
 x$glib_cv_working_bcopy)
   glib_memmove="
@@ -2470,6 +2627,9 @@ g_have_gnuc_varargs=$g_have_gnuc_varargs
 g_have_iso_c_varargs=$g_have_iso_c_varargs
 g_have_iso_cxx_varargs=$g_have_iso_cxx_varargs
 
+g_can_inline=$g_can_inline
+g_have_gnuc_visibility=$g_have_gnuc_visibility
+
 case xyes in
 x$ac_cv_c_bigendian)
   g_byte_order=G_BIG_ENDIAN
@@ -2500,15 +2660,17 @@ xno)    g_enable_threads_def="#undef";;
 esac
 
 g_threads_impl_def=$g_threads_impl
-g_use_double_checked_locking=$g_use_double_checked_locking
 
 g_mutex_has_default="$mutex_has_default"
 g_mutex_sizeof="$glib_cv_sizeof_gmutex"
 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_module_suffix="$glib_gmodule_suffix"
 
+g_pid_type="$glib_pid_type"
 case $host in
   *-*-beos*)
     glib_os="#define G_OS_BEOS"
@@ -2532,7 +2694,10 @@ AC_CONFIG_FILES([
 glib-2.0.pc
 glib-2.0-uninstalled.pc
 gmodule-2.0.pc
+gmodule-export-2.0.pc
+gmodule-no-export-2.0.pc
 gmodule-2.0-uninstalled.pc
+gmodule-no-export-2.0-uninstalled.pc
 gthread-2.0.pc
 gthread-2.0-uninstalled.pc
 gobject-2.0.pc
@@ -2577,19 +2742,14 @@ if false; then
     README
     config.h.win32
     glibconfig.h.win32
-    glib/makefile.mingw
     glib/makefile.msc
     glib/glib.rc
-    gmodule/makefile.mingw
     gmodule/makefile.msc
     gmodule/gmodule.rc
-    gobject/makefile.mingw
     gobject/makefile.msc
     gobject/gobject.rc
-    gthread/makefile.mingw
     gthread/makefile.msc
     gthread/gthread.rc
-    tests/makefile.mingw
     tests/makefile.msc
   ])
 fi