changeset 3183:96e96221fe09

Update glib mingw native and cross compile * src/mingw-glib-2-fixes.patch: New file for MemoryBarrier call. * src/mingw-glib-1-fixes.patch: update to use latest mxe devel branch glib patch. * src/glib.mk: run autogen.sh on native build, build just cross version of everything if cross mingw.
author John Donoghue <john.donoghue@ieee.org>
date Mon, 29 Jul 2013 13:54:19 -0400
parents 23a5b6df3061
children 6c87330db7c6
files src/glib.mk src/mingw-glib-1-fixes.patch src/mingw-glib-2-fixes.patch
diffstat 3 files changed, 250 insertions(+), 310 deletions(-) [+]
line wrap: on
line diff
--- a/src/glib.mk	Sat Jul 27 19:49:58 2013 -0400
+++ b/src/glib.mk	Mon Jul 29 13:54:19 2013 -0400
@@ -15,43 +15,6 @@
     head -1
 endef
 
-define $(PKG)_NATIVE_BUILD
-    cp -Rp '$(1)' '$(1).native'
-
-    # native build of libiconv (used by glib-genmarshal)
-    cd '$(1).native' && $(call UNPACK_PKG_ARCHIVE,libiconv,$(TAR))
-    cd '$(1).native/$(libiconv_SUBDIR)' && ./configure \
-        $(ENABLE_SHARED_OR_STATIC) \
-        --disable-nls
-    $(MAKE) -C '$(1).native/$(libiconv_SUBDIR)' -j '$(JOBS)'
-
-    # native build for glib-genmarshal, without pkg-config, gettext and zlib
-    cd '$(1).native' && ./configure \
-        $(ENABLE_SHARED_OR_STATIC) \
-        --prefix='$(HOST_PREFIX)' \
-        --enable-regex \
-        --disable-threads \
-        --disable-selinux \
-        --disable-inotify \
-        --disable-fam \
-        --disable-xattr \
-        --disable-dtrace \
-        --with-libiconv=gnu \
-        --with-pcre=internal \
-        CPPFLAGS='-I$(1).native/$(libiconv_SUBDIR)/include' \
-        LDFLAGS='-L$(1).native/$(libiconv_SUBDIR)/lib/.libs'
-    $(SED) -i 's,#define G_ATOMIC.*,,' '$(1).native/config.h'
-    $(MAKE) -C '$(1).native/glib'    -j '$(JOBS)'
-    $(MAKE) -C '$(1).native/gthread' -j '$(JOBS)'
-    $(MAKE) -C '$(1).native/gmodule' -j '$(JOBS)'
-    $(MAKE) -C '$(1).native/gobject' -j '$(JOBS)' lib_LTLIBRARIES= install-exec
-    $(MAKE) -C '$(1).native/gio/xdgmime'     -j '$(JOBS)'
-    $(MAKE) -C '$(1).native/gio'     -j '$(JOBS)' glib-compile-schemas
-    $(MAKE) -C '$(1).native/gio'     -j '$(JOBS)' glib-compile-resources
-    $(INSTALL) -m755 '$(1).native/gio/glib-compile-schemas' '$(HOST_BINDIR)'
-    $(INSTALL) -m755 '$(1).native/gio/glib-compile-resources' '$(HOST_BINDIR)'
-endef
-
 define $(PKG)_SYMLINK
     $(LN_SF) `which glib-genmarshal`        '$(HOST_BINDIR)'
     $(LN_SF) `which glib-compile-schemas`   '$(HOST_BINDIR)'
@@ -60,6 +23,7 @@
 
 ifeq ($(MXE_NATIVE_MINGW_BUILD),yes)
 define $(PKG)_BUILD
+    cd $(1) && ./autogen.sh
     cd '$(1)' && PKG_CONFIG_PATH='$(HOST_LIBDIR)/pkgconfig' ./configure \
         $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
         $(ENABLE_SHARED_OR_STATIC) \
@@ -75,33 +39,24 @@
 endef
 else
 define $(PKG)_BUILD
-    cd '$(1)' && ./autogen.sh
+    cd '$(1)' && NOCONFIGURE=true ./autogen.sh
     rm -f '$(HOST_BINDIR)/glib-*'
-    $(if $(findstring y,\
-            $(shell [ -x "`which glib-genmarshal`" ] && \
-                    [ -x "`which glib-compile-schemas`" ] && \
-                    [ -x "`which glib-compile-resources`" ] && echo y)), \
-        $($(PKG)_SYMLINK), \
-        $($(PKG)_NATIVE_BUILD))
     # cross build
     cd '$(1)' && ./configure \
         $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
         $(ENABLE_SHARED_OR_STATIC) \
+        $(CONFIGURE_CPPFLAGS) $(CONFIGURE_LDFLAGS) \
         --prefix='$(HOST_PREFIX)' \
         --with-threads=win32 \
         --with-pcre=system \
         --with-libiconv=gnu \
         --disable-inotify \
-        CXX='$(MXE_CXX)' \
+        --disable-modular-tests \
         PKG_CONFIG='$(MXE_PKG_CONFIG)' \
-        GLIB_GENMARSHAL='$(HOST_BINDIR)/glib-genmarshal' \
-        GLIB_COMPILE_SCHEMAS='$(HOST_BINDIR)/glib-compile-schemas' \
-        GLIB_COMPILE_RESOURCES='$(HOST_BINDIR)/glib-compile-resources'
-    $(MAKE) -C '$(1)/glib'    -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
-    $(MAKE) -C '$(1)/gmodule' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
-    $(MAKE) -C '$(1)/gthread' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
-    $(MAKE) -C '$(1)/gobject' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
-    $(MAKE) -C '$(1)/gio'     -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= MISC_STUFF=
-    $(MAKE) -C '$(1)'         -j '$(JOBS)' install-pkgconfigDATA
+        PKG_CONFIG_PATH='$(HOST_LIBDIR)/pkgconfig' 
+
+    $(MAKE) -C '$(1)'    -j '$(JOBS)' 
+    $(MAKE) -C '$(1)'    -j 1 install 
 endef
+
 endif
--- a/src/mingw-glib-1-fixes.patch	Sat Jul 27 19:49:58 2013 -0400
+++ b/src/mingw-glib-1-fixes.patch	Mon Jul 29 13:54:19 2013 -0400
@@ -3,31 +3,29 @@
 
 Contains ad hoc patches for cross building.
 
-From eacb3702acc44de8e5a3c9a324cb9a81333e3737 Mon Sep 17 00:00:00 2001
-From: "a@mxe.cc" <a@mxe.cc>
+From 55d5dab8f12c55064b48da8a4a42bfe8fa97f8f9 Mon Sep 17 00:00:00 2001
+From: MXE
 Date: Thu, 23 Sep 2010 21:41:51 +0200
 Subject: [PATCH 1/8] optional gettext
 
 
-diff --git a/configure.ac b/configure.ac
-index 054485f..9321fbc 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -482,8 +482,8 @@ AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
+diff -ur a/configure.ac b/configure.ac
+--- a/configure.ac	2013-06-10 00:53:13.000000000 +0200
++++ b/configure.ac	2013-06-29 05:15:59.920660258 +0200
+@@ -483,8 +483,8 @@
  GLIB_GNU_GETTEXT
  
  if test "$gt_cv_have_gettext" != "yes" ; then
 -  AC_MSG_ERROR([
 -*** You must have either have gettext support in your C library, or use the 
 +  AC_MSG_WARN([
-+*** You should have either have gettext support in your C library, or use the
++*** You should have either have gettext support in your C library, or use the 
  *** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html
  ])
  fi
-diff --git a/glib/gi18n.h b/glib/gi18n.h
-index c710046..269bfdf 100644
---- a/glib/gi18n.h
-+++ b/glib/gi18n.h
+diff -ur a/glib/gi18n.h b/glib/gi18n.h
+--- a/glib/gi18n.h	2011-08-16 02:51:30.000000000 +0200
++++ b/glib/gi18n.h	2013-06-29 05:17:17.620663625 +0200
 @@ -22,7 +22,12 @@
  
  #include <glib.h>
@@ -41,21 +39,18 @@
  #include <string.h>
  
  #define  _(String) gettext (String)
--- 
-1.7.10.4
 
 
-From c88a15fbac3076f772894ebcd2003786b37603d4 Mon Sep 17 00:00:00 2001
-From: "a@mxe.cc" <a@mxe.cc>
+From 4dee17aeb7c45a84a44e3fe2dcca4d8bfd1916a3 Mon Sep 17 00:00:00 2001
+From: MXE
 Date: Thu, 23 Sep 2010 21:42:46 +0200
 Subject: [PATCH 2/8] fix tool paths
 
 
-diff --git a/glib-2.0.pc.in b/glib-2.0.pc.in
-index 4a8898e..5164bae 100644
---- a/glib-2.0.pc.in
-+++ b/glib-2.0.pc.in
-@@ -3,9 +3,9 @@ exec_prefix=@exec_prefix@
+diff -ur a/glib-2.0.pc.in b/glib-2.0.pc.in
+--- a/glib-2.0.pc.in	2012-03-12 01:42:41.000000000 +0100
++++ b/glib-2.0.pc.in	2013-06-29 05:18:02.624665578 +0200
+@@ -3,9 +3,9 @@
  libdir=@libdir@
  includedir=@includedir@
  
@@ -68,110 +63,108 @@
  
  Name: GLib
  Description: C Utility Library
--- 
-1.7.10.4
 
 
-From fdf03eb9fff0532fa6dea660a5665242f6ccac9e Mon Sep 17 00:00:00 2001
-From: Hans Petter Jansson <hpj@cl.no>
+From 981260cfec055fbd58986d9e1b7ef27cdc036e30 Mon Sep 17 00:00:00 2001
+From: MXE
 Date: Fri, 15 Jun 2012 15:25:01 +0200
 Subject: [PATCH 3/8] Avoid DllMain symbol conflict when linking statically
 
 
-diff --git a/gio/giomodule.c b/gio/giomodule.c
-index 37a9e70..2e5ef9b 100644
---- a/gio/giomodule.c
-+++ b/gio/giomodule.c
-@@ -782,10 +782,8 @@ extern GType _g_network_monitor_netlink_get_type (void);
+diff -ur a/gio/giomodule.c b/gio/giomodule.c
+--- a/gio/giomodule.c	2013-06-03 01:20:49.000000000 +0200
++++ b/gio/giomodule.c	2013-06-29 05:19:55.560670478 +0200
+@@ -900,14 +900,12 @@
  
  static HMODULE gio_dll = NULL;
  
 -#ifdef DLL_EXPORT
 -
+-BOOL WINAPI DllMain (HINSTANCE hinstDLL,
++BOOL WINAPI gio_DllMain (HINSTANCE hinstDLL,
+                      DWORD     fdwReason,
+                      LPVOID    lpvReserved);
+ 
  BOOL WINAPI
 -DllMain (HINSTANCE hinstDLL,
 +gio_DllMain (HINSTANCE hinstDLL,
  	 DWORD     fdwReason,
  	 LPVOID    lpvReserved)
  {
-@@ -801,8 +799,6 @@ _g_io_win32_get_module (void)
-   return gio_dll;
+@@ -917,8 +915,6 @@
+   return TRUE;
  }
  
 -#endif
 -
- #undef GIO_MODULE_DIR
+ void *
+ _g_io_win32_get_module (void)
+ {
+diff -ur a/glib/glib-init.c b/glib/glib-init.c
+--- a/glib/glib-init.c	2013-06-10 00:03:17.000000000 +0200
++++ b/glib/glib-init.c	2013-06-29 05:20:43.480672556 +0200
+@@ -223,14 +223,14 @@
  
- /* GIO_MODULE_DIR is used only in code called just once,
-diff --git a/glib/glib-init.c b/glib/glib-init.c
-index f4edd5c..02bf678 100644
---- a/glib/glib-init.c
-+++ b/glib/glib-init.c
-@@ -226,9 +226,9 @@ glib_init (void)
+ #if defined (G_OS_WIN32)
+ 
+-BOOL WINAPI DllMain (HINSTANCE hinstDLL,
++BOOL WINAPI glib_DllMain (HINSTANCE hinstDLL,
+                      DWORD     fdwReason,
+                      LPVOID    lpvReserved);
+ 
  HMODULE glib_dll;
  
  BOOL WINAPI
 -DllMain (HINSTANCE hinstDLL,
--         DWORD     fdwReason,
--         LPVOID    lpvReserved)
 +glib_DllMain (HINSTANCE hinstDLL,
-+              DWORD     fdwReason,
-+              LPVOID    lpvReserved)
+          DWORD     fdwReason,
+          LPVOID    lpvReserved)
  {
-   switch (fdwReason)
-     {
--- 
-1.7.10.4
 
 
-From 64c337b9654441cc1b90ed3ac86f928073ec208e Mon Sep 17 00:00:00 2001
-From: Hans Petter Jansson <hpj@cl.no>
+From 1b51f3ef3e38d5db3c15cde0fe4429dab1f7a6d0 Mon Sep 17 00:00:00 2001
+From: MXE
 Date: Fri, 15 Jun 2012 15:27:22 +0200
 Subject: [PATCH 4/8] Allow building without inotify support
 
 
-diff --git a/configure.ac b/configure.ac
-index 9321fbc..5c6bb3e 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1712,11 +1712,18 @@ dnl *****************************
+diff -ur a/configure.ac b/configure.ac
+--- a/configure.ac	2013-06-10 00:53:13.000000000 +0200
++++ b/configure.ac	2013-06-29 05:23:45.264680443 +0200
+@@ -1726,11 +1726,17 @@
  dnl ** Check for inotify (GIO) **
  dnl *****************************
  inotify_support=no
 -AC_CHECK_HEADERS([sys/inotify.h],
 -[
-+
 +AC_ARG_ENABLE(inotify,
 +              AC_HELP_STRING([--disable-inotify],
 +                             [build without inotify support]))
 +
 +if test "x$enable_inotify" != "xno"; then
-+ AC_CHECK_HEADERS([sys/inotify.h],
-+ [
++  AC_CHECK_HEADERS([sys/inotify.h],
++  [
  	inotify_support=yes
  	AC_CHECK_FUNCS(inotify_init1)
 -])
-+ ])
++  ])
 +fi
  
  AM_CONDITIONAL(HAVE_INOTIFY, [test "$inotify_support" = "yes"])
  
--- 
-1.7.10.4
 
 
-From c80c435bd8d92857eeb54273024ca8782fa089c6 Mon Sep 17 00:00:00 2001
-From: Hans Petter Jansson <hpj@cl.no>
+From 5ec5d101cb75c096f39228da85d2caba52b9002f Mon Sep 17 00:00:00 2001
+From: MXE
 Date: Fri, 15 Jun 2012 15:28:14 +0200
 Subject: [PATCH 5/8] Make sure STDC_HEADERS is set for AC_CHECK_ALIGNOF.
  Backported from upstream
 
 
-diff --git a/configure.ac b/configure.ac
-index 5c6bb3e..8754c21 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -455,6 +455,8 @@ fi
+diff -ur a/configure.ac b/configure.ac
+--- a/configure.ac	2013-06-10 00:53:13.000000000 +0200
++++ b/configure.ac	2013-06-29 05:24:29.720682366 +0200
+@@ -456,6 +456,8 @@
  
  AC_MSG_RESULT($enable_iconv_cache)
  
@@ -180,21 +173,18 @@
  
  dnl
  dnl zlib support
--- 
-1.7.10.4
 
 
-From e7e2c1c881813a2a17bfec7b63c673eb979b3833 Mon Sep 17 00:00:00 2001
-From: Hans Petter Jansson <hpj@cl.no>
+From d5c7bf3b57ced0c6dfb416cf7b439fba210d2a8b Mon Sep 17 00:00:00 2001
+From: MXE
 Date: Fri, 15 Jun 2012 15:29:06 +0200
 Subject: [PATCH 6/8] Link with dnsapi
 
 
-diff --git a/gio-2.0.pc.in b/gio-2.0.pc.in
-index 9f7123f..b0d5779 100644
---- a/gio-2.0.pc.in
-+++ b/gio-2.0.pc.in
-@@ -13,6 +13,6 @@ Description: glib I/O library
+diff -ur a/gio-2.0.pc.in b/gio-2.0.pc.in
+--- a/gio-2.0.pc.in	2013-01-20 20:48:44.000000000 +0100
++++ b/gio-2.0.pc.in	2013-06-29 05:25:16.328684390 +0200
+@@ -13,6 +13,6 @@
  Version: @VERSION@
  Requires: glib-2.0 gobject-2.0
  Requires.private: gmodule-no-export-2.0
@@ -202,28 +192,26 @@
 +Libs: -L${libdir} -lgio-2.0 -ldnsapi
  Libs.private: @ZLIB_LIBS@ @NETWORK_LIBS@
  Cflags:
--- 
-1.7.10.4
+
 
 
-From c1f83b6ae587c99fefd482d0b1bfbe1d962320d4 Mon Sep 17 00:00:00 2001
-From: Hans Petter Jansson <hpj@cl.no>
+From e0338b4fdd95e8273c84ba1daeea660c589d152a Mon Sep 17 00:00:00 2001
+From: MXE
 Date: Fri, 15 Jun 2012 15:29:38 +0200
 Subject: [PATCH 7/8] Ensure globals are initialized even when DllMain is not
  being run
 
 
-diff --git a/glib/gmain.c b/glib/gmain.c
-index c0c4581..bef8b99 100644
---- a/glib/gmain.c
-+++ b/glib/gmain.c
-@@ -2157,12 +2157,15 @@ g_get_real_time (void)
+diff -ur a/glib/gmain.c b/glib/gmain.c
+--- a/glib/gmain.c	2013-06-10 00:03:18.000000000 +0200
++++ b/glib/gmain.c	2013-06-29 05:33:10.568704963 +0200
+@@ -2490,12 +2490,15 @@
  #ifdef G_OS_WIN32
  static ULONGLONG (*g_GetTickCount64) (void) = NULL;
  static guint32 g_win32_tick_epoch = 0;
 +static gboolean g_win32_clock_is_initialized;
  
- G_GNUC_INTERNAL void
+ void
  g_clock_win32_init (void)
  {
    HMODULE kernel32;
@@ -233,7 +221,7 @@
    g_GetTickCount64 = NULL;
    kernel32 = GetModuleHandle ("KERNEL32.DLL");
    if (kernel32 != NULL)
-@@ -2281,6 +2284,9 @@ g_get_monotonic_time (void)
+@@ -2614,6 +2617,9 @@
     *    timeBeginPeriod() to increase it as much as they want
     */
  
@@ -243,11 +231,10 @@
    if (g_GetTickCount64 != NULL)
      {
        guint32 ticks_as_32bit;
-diff --git a/glib/gthread-win32.c b/glib/gthread-win32.c
-index 5a9ac97..e4d1d48 100644
---- a/glib/gthread-win32.c
-+++ b/glib/gthread-win32.c
-@@ -117,18 +117,28 @@ typedef struct
+diff -ur a/glib/gthread-win32.c b/glib/gthread-win32.c
+--- a/glib/gthread-win32.c	2013-06-03 01:20:49.000000000 +0200
++++ b/glib/gthread-win32.c	2013-06-29 05:49:13.580746730 +0200
+@@ -118,18 +118,28 @@
    void     (__stdcall * WakeConditionVariable)       (gpointer cond);
  } GThreadImplVtable;
  
@@ -276,7 +263,7 @@
    if (g_thread_impl_vtable.DeleteSRWLock != NULL)
      g_thread_impl_vtable.DeleteSRWLock (mutex);
  }
-@@ -136,18 +146,27 @@ g_mutex_clear (GMutex *mutex)
+@@ -137,18 +147,27 @@
  void
  g_mutex_lock (GMutex *mutex)
  {
@@ -304,7 +291,7 @@
    g_thread_impl_vtable.ReleaseSRWLockExclusive (mutex);
  }
  
-@@ -158,6 +177,9 @@ g_rec_mutex_impl_new (void)
+@@ -159,6 +178,9 @@
  {
    CRITICAL_SECTION *cs;
  
@@ -314,7 +301,7 @@
    cs = g_slice_new (CRITICAL_SECTION);
    InitializeCriticalSection (cs);
  
-@@ -168,6 +190,10 @@ static void
+@@ -169,6 +191,10 @@
  g_rec_mutex_impl_free (CRITICAL_SECTION *cs)
  {
    DeleteCriticalSection (cs);
@@ -325,7 +312,7 @@
    g_slice_free (CRITICAL_SECTION, cs);
  }
  
-@@ -176,6 +202,9 @@ g_rec_mutex_get_impl (GRecMutex *mutex)
+@@ -177,6 +203,9 @@
  {
    CRITICAL_SECTION *impl = mutex->p;
  
@@ -335,7 +322,7 @@
    if G_UNLIKELY (mutex->p == NULL)
      {
        impl = g_rec_mutex_impl_new ();
-@@ -190,30 +219,45 @@ g_rec_mutex_get_impl (GRecMutex *mutex)
+@@ -191,30 +220,45 @@
  void
  g_rec_mutex_init (GRecMutex *mutex)
  {
@@ -381,7 +368,7 @@
    return TryEnterCriticalSection (g_rec_mutex_get_impl (mutex));
  }
  
-@@ -222,12 +266,18 @@ g_rec_mutex_trylock (GRecMutex *mutex)
+@@ -223,12 +267,18 @@
  void
  g_rw_lock_init (GRWLock *lock)
  {
@@ -400,7 +387,7 @@
    if (g_thread_impl_vtable.DeleteSRWLock != NULL)
      g_thread_impl_vtable.DeleteSRWLock (lock);
  }
-@@ -235,36 +285,54 @@ g_rw_lock_clear (GRWLock *lock)
+@@ -236,36 +286,54 @@
  void
  g_rw_lock_writer_lock (GRWLock *lock)
  {
@@ -455,7 +442,7 @@
    g_thread_impl_vtable.ReleaseSRWLockShared (lock);
  }
  
-@@ -272,12 +340,18 @@ g_rw_lock_reader_unlock (GRWLock *lock)
+@@ -273,12 +341,18 @@
  void
  g_cond_init (GCond *cond)
  {
@@ -474,7 +461,7 @@
    if (g_thread_impl_vtable.DeleteConditionVariable)
      g_thread_impl_vtable.DeleteConditionVariable (cond);
  }
-@@ -285,12 +359,18 @@ g_cond_clear (GCond *cond)
+@@ -286,12 +360,18 @@
  void
  g_cond_signal (GCond *cond)
  {
@@ -493,7 +480,7 @@
    g_thread_impl_vtable.WakeAllConditionVariable (cond);
  }
  
-@@ -298,6 +378,9 @@ void
+@@ -299,6 +379,9 @@
  g_cond_wait (GCond  *cond,
               GMutex *entered_mutex)
  {
@@ -503,7 +490,7 @@
    g_thread_impl_vtable.SleepConditionVariableSRW (cond, entered_mutex, INFINITE, 0);
  }
  
-@@ -308,6 +391,9 @@ g_cond_wait_until (GCond  *cond,
+@@ -309,6 +392,9 @@
  {
    gint64 span;
  
@@ -513,7 +500,7 @@
    span = end_time - g_get_monotonic_time ();
  
    if G_UNLIKELY (span < 0)
-@@ -340,6 +426,9 @@ g_private_get_impl (GPrivate *key)
+@@ -341,6 +427,9 @@
  
    if G_UNLIKELY (impl == 0)
      {
@@ -523,7 +510,7 @@
        EnterCriticalSection (&g_private_lock);
        impl = (DWORD) key->p;
        if (impl == 0)
-@@ -433,6 +522,9 @@ g_system_thread_free (GRealThread *thread)
+@@ -434,6 +523,9 @@
  {
    GThreadWin32 *wt = (GThreadWin32 *) thread;
  
@@ -533,7 +520,7 @@
    win32_check_for_error (CloseHandle (wt->handle));
    g_slice_free (GThreadWin32, wt);
  }
-@@ -440,6 +532,9 @@ g_system_thread_free (GRealThread *thread)
+@@ -441,6 +533,9 @@
  void
  g_system_thread_exit (void)
  {
@@ -543,7 +530,7 @@
    _endthreadex (0);
  }
  
-@@ -448,6 +543,9 @@ g_thread_win32_proxy (gpointer data)
+@@ -449,6 +544,9 @@
  {
    GThreadWin32 *self = data;
  
@@ -553,7 +540,7 @@
    self->proxy (self);
  
    g_system_thread_exit ();
-@@ -465,6 +563,9 @@ g_system_thread_new (GThreadFunc   func,
+@@ -466,6 +564,9 @@
    GThreadWin32 *thread;
    guint ignore;
  
@@ -563,7 +550,7 @@
    thread = g_slice_new0 (GThreadWin32);
    thread->proxy = func;
  
-@@ -494,6 +595,9 @@ g_system_thread_wait (GRealThread *thread)
+@@ -495,6 +596,9 @@
  {
    GThreadWin32 *wt = (GThreadWin32 *) thread;
  
@@ -573,8 +560,8 @@
    win32_check_for_error (WAIT_FAILED != WaitForSingleObject (wt->handle, INFINITE));
  }
  
-@@ -985,6 +1089,8 @@ g_thread_lookup_native_funcs (void)
- G_GNUC_INTERNAL void
+@@ -986,6 +1090,8 @@
+ void
  g_thread_win32_init (void)
  {
 +  g_threads_is_initialized = TRUE;
@@ -582,44 +569,18 @@
    if (!g_thread_lookup_native_funcs ())
      g_thread_xp_init ();
  
--- 
-1.7.10.4
 
 
-From f7b3f3f390131d41855da11622eb18870aec0731 Mon Sep 17 00:00:00 2001
-From: Mark Brand <mabrand@mabrand.nl>
+From ce0f7354ac995f3b21cccabec880413d37f02fb6 Mon Sep 17 00:00:00 2001
+From: MXE
 Date: Mon, 18 Jun 2012 16:02:12 +0200
 Subject: [PATCH 8/8] kill docs and gtk-doc dependence (mxe-specific)
 
 
-diff --git a/Makefile.am b/Makefile.am
-index 55be9d2..f000f10 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -6,7 +6,7 @@ include $(top_srcdir)/Makefile.decl
- 
- ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS}
- 
--SUBDIRS = . m4macros glib gmodule gthread gobject gio po docs
-+SUBDIRS = . m4macros glib gmodule gthread gobject gio po
- DIST_SUBDIRS = $(SUBDIRS) build
- if BUILD_MODULAR_TESTS
- SUBDIRS += tests 
-@@ -67,8 +67,7 @@ BUILT_EXTRA_DIST = 		\
- 	README			\
- 	INSTALL			\
- 	ChangeLog		\
--	config.h.win32		\
--	gtk-doc.make
-+	config.h.win32
- 
- CONFIGURE_DEPENDENCIES = acglib.m4
- 
-diff --git a/autogen.sh b/autogen.sh
-index 4bbc00d..bc0ab0b 100755
---- a/autogen.sh
-+++ b/autogen.sh
-@@ -7,18 +7,6 @@ test -n "$srcdir" || srcdir=.
+diff -urN a/autogen.sh b/autogen.sh
+--- a/autogen.sh	2012-08-18 19:32:04.000000000 +0200
++++ b/autogen.sh	2013-06-29 05:50:43.972750651 +0200
+@@ -7,18 +7,6 @@
  olddir=`pwd`
  cd "$srcdir"
  
@@ -638,11 +599,10 @@
  AUTORECONF=`which autoreconf`
  if test -z $AUTORECONF; then
          echo "*** No autoreconf found, please install it ***"
-diff --git a/configure.ac b/configure.ac
-index 8754c21..4936f3c 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -2605,13 +2605,6 @@ AS_IF([ test $cross_compiling = yes && test x$enable_modular_tests = xyes], [
+diff -urN a/configure.ac b/configure.ac
+--- a/configure.ac	2013-06-10 00:53:13.000000000 +0200
++++ b/configure.ac	2013-06-29 05:52:05.224754174 +0200
+@@ -2645,13 +2645,6 @@
  dnl **************************
  dnl *** Checks for gtk-doc ***
  dnl **************************
@@ -656,11 +616,9 @@
  
  AC_ARG_ENABLE(man,
                [AS_HELP_STRING([--enable-man],
-diff --git a/docs/Makefile.am b/docs/Makefile.am
-deleted file mode 100644
-index 2349f44..0000000
---- a/docs/Makefile.am
-+++ /dev/null
+diff -urN a/docs/Makefile.am b/docs/Makefile.am
+--- a/docs/Makefile.am	2013-06-10 00:03:17.000000000 +0200
++++ b/docs/Makefile.am	1970-01-01 01:00:00.000000000 +0100
 @@ -1,11 +0,0 @@
 -## Process this file with automake to produce Makefile.in
 -include $(top_srcdir)/Makefile.decl
@@ -673,20 +631,81 @@
 -	@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
 -	  echo $$p; \
 -	done
-diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
-deleted file mode 100644
-index 63cf90d..0000000
---- a/docs/reference/Makefile.am
-+++ /dev/null
-@@ -1,3 +0,0 @@
+diff -urN a/docs/reference/gio/gdbus-object-manager-example/Makefile.am b/docs/reference/gio/gdbus-object-manager-example/Makefile.am
+--- a/docs/reference/gio/gdbus-object-manager-example/Makefile.am	2013-06-10 00:03:17.000000000 +0200
++++ b/docs/reference/gio/gdbus-object-manager-example/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+@@ -1,68 +0,0 @@
 -include $(top_srcdir)/Makefile.decl
+-NULL =
 -
--SUBDIRS = glib gobject gio
-diff --git a/docs/reference/gio/Makefile.am b/docs/reference/gio/Makefile.am
-deleted file mode 100644
-index 64d95fe..0000000
---- a/docs/reference/gio/Makefile.am
-+++ /dev/null
+-# The name of the module.
+-DOC_MODULE=gdbus-object-manager-example
+-
+-# The top-level SGML file.
+-DOC_MAIN_SGML_FILE=gdbus-object-manager-example-docs.xml
+-
+-# Extra options to supply to gtkdoc-scan
+-SCAN_OPTIONS=--deprecated-guards="G_DISABLE_DEPRECATED"
+-
+-# The directory containing the source code. Relative to $(srcdir)
+-DOC_SOURCE_DIR=$(top_builddir)/gio/tests/gdbus-object-manager-example
+-
+-HFILE_GLOB=$(top_builddir)/gio/tests/gdbus-object-manager-example/*.h
+-CFILE_GLOB=$(top_builddir)/gio/tests/gdbus-object-manager-example/*.c
+-
+-# Headers to ignore
+-IGNORE_HFILES =				\
+-	$(NULL)
+-
+-# CFLAGS and LDFLAGS for compiling scan program. Only needed
+-# if $(DOC_MODULE).types is non-empty.
+-AM_CPPFLAGS = 				\
+-	$(gio_INCLUDES)			\
+-	$(GLIB_DEBUG_FLAGS)
+-
+-GTKDOC_LIBS = 						\
+-	$(top_builddir)/glib/libglib-2.0.la		\
+-	$(top_builddir)/gobject/libgobject-2.0.la	\
+-	$(top_builddir)/gmodule/libgmodule-2.0.la	\
+-	$(top_builddir)/gio/libgio-2.0.la		\
+-	$(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la \
+-	$(NULL)
+-
+-# Extra options to supply to gtkdoc-mkdb
+-MKDB_OPTIONS = --output-format=xml --sgml-mode --name-space=g \
+-	$(NULL)
+-
+-# Images to copy into HTML directory
+-HTML_IMAGES =			\
+-	$(NULL)
+-
+-content_files =			\
+-	$(NULL)
+-
+-expand_content_files =		\
+-	$(NULL)
+-
+-extra_files =			\
+-	$(NULL)
+-
+-include $(top_srcdir)/gtk-doc.make
+-
+-EXTRA_DIST +=			\
+-	$(NULL)
+-
+-MAINTAINERCLEANFILES = $(BUILT_SOURCES)
+-
+-dist-hook-local: all-local
+-
+-gdbus-object-manager-example-docs-clean: clean
+-	cd $(srcdir) && rm -rf xml html
+-
+-# Nuke installed docs (don't know how to avoid installing them)
+-install-data-hook :
+-	rm -rf $(DESTDIR)$(datadir)/gtk-doc/html/gdbus-object-manager-example
+diff -urN a/docs/reference/gio/Makefile.am b/docs/reference/gio/Makefile.am
+--- a/docs/reference/gio/Makefile.am	2013-06-10 00:03:17.000000000 +0200
++++ b/docs/reference/gio/Makefile.am	1970-01-01 01:00:00.000000000 +0100
 @@ -1,179 +0,0 @@
 -include $(top_srcdir)/Makefile.decl
 -NULL =
@@ -774,7 +793,7 @@
 -
 -# CFLAGS and LDFLAGS for compiling scan program. Only needed
 -# if $(DOC_MODULE).types is non-empty.
--INCLUDES = \
+-AM_CPPFLAGS = 				\
 -	$(gio_INCLUDES)			\
 -	$(GLIB_DEBUG_FLAGS)
 -
@@ -867,85 +886,9 @@
 -
 -gio-docs-clean: clean
 -	cd $(srcdir) && rm -rf xml html
-diff --git a/docs/reference/gio/gdbus-object-manager-example/Makefile.am b/docs/reference/gio/gdbus-object-manager-example/Makefile.am
-deleted file mode 100644
-index 90c10aa..0000000
---- a/docs/reference/gio/gdbus-object-manager-example/Makefile.am
-+++ /dev/null
-@@ -1,68 +0,0 @@
--include $(top_srcdir)/Makefile.decl
--NULL =
--
--# The name of the module.
--DOC_MODULE=gdbus-object-manager-example
--
--# The top-level SGML file.
--DOC_MAIN_SGML_FILE=gdbus-object-manager-example-docs.xml
--
--# Extra options to supply to gtkdoc-scan
--SCAN_OPTIONS=--deprecated-guards="G_DISABLE_DEPRECATED"
--
--# The directory containing the source code. Relative to $(srcdir)
--DOC_SOURCE_DIR=$(top_builddir)/gio/tests/gdbus-object-manager-example
--
--HFILE_GLOB=$(top_builddir)/gio/tests/gdbus-object-manager-example/*.h
--CFILE_GLOB=$(top_builddir)/gio/tests/gdbus-object-manager-example/*.c
--
--# Headers to ignore
--IGNORE_HFILES=				\
--	$(NULL)
--
--# CFLAGS and LDFLAGS for compiling scan program. Only needed
--# if $(DOC_MODULE).types is non-empty.
--INCLUDES = \
--	$(gio_INCLUDES)			\
--	$(GLIB_DEBUG_FLAGS)
--
--GTKDOC_LIBS = \
--	$(top_builddir)/glib/libglib-2.0.la		\
--	$(top_builddir)/gobject/libgobject-2.0.la	\
--	$(top_builddir)/gmodule/libgmodule-2.0.la	\
--	$(top_builddir)/gio/libgio-2.0.la		\
--	$(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la \
--	$(NULL)
--
--# Extra options to supply to gtkdoc-mkdb
--MKDB_OPTIONS = --output-format=xml --sgml-mode --name-space=g \
--	$(NULL)
--
--# Images to copy into HTML directory
--HTML_IMAGES =			\
--	$(NULL)
--
--content_files =			\
--	$(NULL)
--
--expand_content_files =		\
--	$(NULL)
--
--extra_files =			\
--	$(NULL)
--
--include $(top_srcdir)/gtk-doc.make
--
--EXTRA_DIST +=			\
--	$(NULL)
--
--MAINTAINERCLEANFILES = $(BUILT_SOURCES)
--
--dist-hook-local: all-local
--
--gdbus-object-manager-example-docs-clean: clean
--	cd $(srcdir) && rm -rf xml html
--
--# Nuke installed docs (don't know how to avoid installing them)
--install-data-hook :
--	rm -rf $(DESTDIR)$(datadir)/gtk-doc/html/gdbus-object-manager-example
-diff --git a/docs/reference/glib/Makefile.am b/docs/reference/glib/Makefile.am
-deleted file mode 100644
-index 54918c8..0000000
---- a/docs/reference/glib/Makefile.am
-+++ /dev/null
+diff -urN a/docs/reference/glib/Makefile.am b/docs/reference/glib/Makefile.am
+--- a/docs/reference/glib/Makefile.am	2013-06-10 00:03:17.000000000 +0200
++++ b/docs/reference/glib/Makefile.am	1970-01-01 01:00:00.000000000 +0100
 @@ -1,128 +0,0 @@
 -## Process this file with automake to produce Makefile.in
 -include $(top_srcdir)/Makefile.decl
@@ -1075,12 +1018,10 @@
 -
 -glib-docs-clean: clean
 -	cd $(srcdir) && rm -rf xml html
-diff --git a/docs/reference/gobject/Makefile.am b/docs/reference/gobject/Makefile.am
-deleted file mode 100644
-index 48d88f8..0000000
---- a/docs/reference/gobject/Makefile.am
-+++ /dev/null
-@@ -1,103 +0,0 @@
+diff -urN a/docs/reference/gobject/Makefile.am b/docs/reference/gobject/Makefile.am
+--- a/docs/reference/gobject/Makefile.am	2013-06-10 00:03:17.000000000 +0200
++++ b/docs/reference/gobject/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+@@ -1,104 +0,0 @@
 -## Process this file with automake to produce Makefile.in
 -include $(top_srcdir)/Makefile.decl
 -
@@ -1116,11 +1057,12 @@
 -
 -# CFLAGS and LDFLAGS for compiling scan program. Only needed
 -# if $(DOC_MODULE).types is non-empty.
--INCLUDES = \
+-AM_CPPFLAGS = 				\
 -	-I$(srcdir) 			\
 -	$(gobject_INCLUDES) 		\
 -	$(GLIB_DEBUG_FLAGS)
--GTKDOC_LIBS = \
+-
+-GTKDOC_LIBS = 					\
 -	$(top_builddir)/glib/libglib-2.0.la	\
 -	$(top_builddir)/gobject/libgobject-2.0.la
 -
@@ -1184,6 +1126,32 @@
 -
 -gobject-docs-clean: clean
 -	cd $(srcdir) && rm -rf xml html
--- 
-1.7.10.4
-
+diff -urN a/docs/reference/Makefile.am b/docs/reference/Makefile.am
+--- a/docs/reference/Makefile.am	2013-06-10 00:03:17.000000000 +0200
++++ b/docs/reference/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+@@ -1,3 +0,0 @@
+-include $(top_srcdir)/Makefile.decl
+-
+-SUBDIRS = glib gobject gio
+diff -urN a/Makefile.am b/Makefile.am
+--- a/Makefile.am	2013-06-10 00:03:17.000000000 +0200
++++ b/Makefile.am	2013-06-29 05:50:18.224749533 +0200
+@@ -6,7 +6,7 @@
+ 
+ ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS}
+ 
+-SUBDIRS = . m4macros glib gmodule gthread gobject gio po docs
++SUBDIRS = . m4macros glib gmodule gthread gobject gio po
+ DIST_SUBDIRS = $(SUBDIRS) build
+ if BUILD_MODULAR_TESTS
+ SUBDIRS += tests 
+@@ -71,8 +71,7 @@
+ 	README			\
+ 	INSTALL			\
+ 	ChangeLog		\
+-	config.h.win32		\
+-	gtk-doc.make
++	config.h.win32
+ 
+ CONFIGURE_DEPENDENCIES = acglib.m4
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mingw-glib-2-fixes.patch	Mon Jul 29 13:54:19 2013 -0400
@@ -0,0 +1,17 @@
+--- a/glib/gatomic.c.orig	2013-07-29 12:05:27 -0400
++++ a/glib/gatomic.c	2013-07-29 12:07:46 -0400
+@@ -475,6 +475,14 @@
+ 
+ #if !defined (_MSC_VER) || _MSC_VER <= 1200
+ #include "gmessages.h"
++
++#ifndef MemoryBarrier
++static inline void MemoryBarrier (void) {
++  long dummy = 0;
++  InterlockedExchange (&dummy, 1);
++}
++#endif
++
+ /* Inlined versions for older compiler */
+ static LONG
+ _gInterlockedAnd (volatile guint *atomic,