Index: Makefile.in
--- Makefile.in.orig	2012-05-15 00:09:32.000000000 +0200
+++ Makefile.in	2012-07-13 20:35:15.000000000 +0200
@@ -820,7 +820,7 @@
 
 @ENABLE_INSTALLED_TESTS_TRUE@installed_test_meta_DATA = $(installed_testcases:=.test)
 ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS}
-SUBDIRS = . m4macros glib gmodule gthread gobject gio po docs tests
+SUBDIRS = . m4macros glib gmodule gthread gobject gio po
 DIST_SUBDIRS = $(SUBDIRS) build
 bin_SCRIPTS = glib-gettextize
 AM_CPPFLAGS = \
Index: gio/Makefile.in
--- gio/Makefile.in.orig	2012-05-15 00:09:29.000000000 +0200
+++ gio/Makefile.in	2012-07-13 20:35:15.000000000 +0200
@@ -798,8 +798,7 @@
     *) \
       b='$*';; \
   esac
-DIST_SUBDIRS = gdbus-2.0/codegen xdgmime inotify kqueue fen win32 . \
-	tests fam
+DIST_SUBDIRS = xdgmime inotify kqueue fen win32 . fam
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -1172,8 +1171,8 @@
 @ENABLE_INSTALLED_TESTS_TRUE@                      $(dist_test_scripts) $(dist_installed_test_scripts)
 
 @ENABLE_INSTALLED_TESTS_TRUE@installed_test_meta_DATA = $(installed_testcases:=.test)
-SUBDIRS = gdbus-2.0/codegen $(am__append_15) $(am__append_19) \
-	$(am__append_22) $(am__append_26) $(am__append_29) . tests \
+SUBDIRS = $(am__append_15) $(am__append_19) \
+	$(am__append_22) $(am__append_26) $(am__append_29) . \
 	$(am__append_32)
 @MS_LIB_AVAILABLE_TRUE@@OS_WIN32_AND_DLL_COMPILATION_TRUE@install_ms_lib_cmd = $(INSTALL) gio-2.0.lib $(DESTDIR)$(libdir)
 @MS_LIB_AVAILABLE_TRUE@@OS_WIN32_AND_DLL_COMPILATION_TRUE@uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gio-2.0.lib
Index: gio/glib-compile-schemas.c
--- gio/glib-compile-schemas.c.orig	2012-04-13 15:39:41.000000000 +0200
+++ gio/glib-compile-schemas.c	2012-07-13 20:35:15.000000000 +0200
@@ -1534,7 +1534,7 @@
 }
 /* Text {{{2 */
 static void
-text (GMarkupParseContext  *context,
+XXXtext (GMarkupParseContext  *context,
       const gchar          *text,
       gsize                 text_len,
       gpointer              user_data,
@@ -1699,7 +1699,7 @@
 parse_gschema_files (gchar    **files,
                      gboolean   strict)
 {
-  GMarkupParser parser = { start_element, end_element, text };
+  GMarkupParser parser = { start_element, end_element, XXXtext };
   ParseState state = { 0, };
   const gchar *filename;
   GError *error = NULL;
Index: gio/tests/gdbus-peer.c
--- gio/tests/gdbus-peer.c.orig	2012-05-14 23:58:01.000000000 +0200
+++ gio/tests/gdbus-peer.c	2012-07-13 20:35:15.000000000 +0200
@@ -39,6 +39,8 @@
 #include <gio/gunixsocketaddress.h>
 #include <gio/gunixfdlist.h>
 
+#include <sys/socket.h>
+
 #ifdef G_OS_UNIX
 #include <gio/gunixconnection.h>
 #include <errno.h>
Index: gio/xdgmime/xdgmimecache.h
--- gio/xdgmime/xdgmimecache.h.orig	2011-08-16 02:51:30.000000000 +0200
+++ gio/xdgmime/xdgmimecache.h	2012-07-13 20:35:15.000000000 +0200
@@ -46,6 +46,9 @@
 #define _xdg_mime_cache_get_icon                      XDG_RESERVED_ENTRY(cache_get_icon)
 #define _xdg_mime_cache_get_generic_icon              XDG_RESERVED_ENTRY(cache_get_generic_icon)
 #define _xdg_mime_cache_glob_dump                     XDG_RESERVED_ENTRY(cache_glob_dump)
+#define _xdg_mime_cache_is_valid_mime_type            XDG_RESERVED_ENTRY(cache_is_valid_mime_type)
+#define _xdg_mime_cache_mime_type_equal               XDG_RESERVED_ENTRY(cache_mime_type_equal)
+#define _xdg_mime_cache_media_type_equal              XDG_RESERVED_ENTRY(cache_media_type_equal)
 #endif
 
 extern XdgMimeCache **_caches;
Index: glib/gatomic.c
--- glib/gatomic.c.orig	2012-03-12 01:42:41.000000000 +0100
+++ glib/gatomic.c	2012-07-13 20:35:15.000000000 +0200
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include "gthread.h"
 #include "gatomic.h"
 
 /**
Index: gmodule/gmodule-dl.c
--- gmodule/gmodule-dl.c.orig	2011-08-16 02:51:30.000000000 +0200
+++ gmodule/gmodule-dl.c	2012-07-13 20:35:15.000000000 +0200
@@ -107,6 +107,7 @@
 static gpointer
 _g_module_self (void)
 {
+#ifndef __FreeBSD__
   gpointer handle;
   
   /* to query symbols from the program itself, special link options
@@ -122,6 +123,9 @@
     g_module_set_error (fetch_dlerror (TRUE));
   
   return handle;
+#else
+  return RTLD_DEFAULT;
+#endif
 }
 
 static void
diff -Nau gio/gsocket.c.orig gio/gsocket.c
Index: gio/gsocket.c
--- gio/gsocket.c.orig	2012-08-03 11:38:08.419548195 +0200
+++ gio/gsocket.c	2012-08-03 11:38:11.307357875 +0200
@@ -52,6 +52,10 @@
 #include <sys/uio.h>
 #endif
 
+#if defined (__SVR4) && defined (__sun)
+#include <sys/filio.h>
+#endif
+
 #include "gcancellable.h"
 #include "gioenumtypes.h"
 #include "ginetaddress.h"
diff -Nau gio/gresource-tool.c.orig gio/gresource-tool.c
Index: gio/gresource-tool.c
--- gio/gresource-tool.c.orig	2012-08-03 11:25:31.632225248 +0200
+++ gio/gresource-tool.c	2012-08-03 11:38:12.657797557 +0200
@@ -31,6 +31,11 @@
 #include <locale.h>
 
 #ifdef HAVE_LIBELF
+/* Solaris libelf does not support largefile in 32-bit mode */
+#if defined (__SVR4) && defined (__sun) && defined (__i386)
+#undef  _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS   32
+#endif
 #include <libelf.h>
 #include <gelf.h>
 #include <sys/mman.h>
diff -Nau gio/glocalfile.c.orig gio/glocalfile.c
Index: gio/glocalfile.c.orig
--- gio/glocalfile.c.orig	2013-06-16 16:34:39.000000000 +0200
+++ gio/glocalfile.c	2013-06-30 22:51:06.165031107 +0200
@@ -2427,6 +2427,7 @@
 is_remote_fs (const gchar *filename)
 {
   const char *fsname = NULL;
+  int statfs_result = 0;
 
 #ifdef USE_STATFS
   struct statfs statfs_buffer;
