r22944 - gnucash/trunk - Bug #698781 can't build with glib 2.36: error: 'g_type_init' is deprecated

Geert Janssens gjanssens at code.gnucash.org
Fri May 3 08:04:03 EDT 2013


Author: gjanssens
Date: 2013-05-03 08:04:03 -0400 (Fri, 03 May 2013)
New Revision: 22944
Trac: http://svn.gnucash.org/trac/changeset/22944

Modified:
   gnucash/trunk/configure.ac
   gnucash/trunk/src/libqof/qof/qofutil.c
Log:
Bug #698781 can't build with glib 2.36: error: 'g_type_init' is deprecated

Modified: gnucash/trunk/configure.ac
===================================================================
--- gnucash/trunk/configure.ac	2013-05-03 12:03:53 UTC (rev 22943)
+++ gnucash/trunk/configure.ac	2013-05-03 12:04:03 UTC (rev 22944)
@@ -229,15 +229,26 @@
 ### --------------------------------------------------------------------------
 ### Glib checks.
 
-# We require glib >= 2.28, released together with gtk-2.24; There are
-# some thread deprecations that affect us in 2.32, so we check for
-# that first.
-PKG_CHECK_MODULES(GLIB,
-                  glib-2.0 >= 2.32 gthread-2.0 gobject-2.0 gmodule-2.0,
-		  [AC_DEFINE([HAVE_GLIB_2_32], [1],
-		             [Configure gthread deprecations])],
-		  [PKG_CHECK_MODULES(GLIB,
-		   glib-2.0 >= 2.28 gthread-2.0 gobject-2.0 gmodule-2.0)])
+# We require glib >= 2.28, released together with gtk-2.24;
+# We first check for other versions due to deprecations.
+# 2.36 deprecated g_type_init
+# 2.32 deprecated some gthread functions
+PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.36 gthread-2.0 gobject-2.0 gmodule-2.0,
+[
+  AC_DEFINE([HAVE_GLIB_2_36], [1], [Configure g_type_init deprecation])
+  AC_DEFINE([HAVE_GLIB_2_32], [1], [Configure gthread deprecations])
+],
+[
+  PKG_CHECK_MODULES(GLIB,
+                        glib-2.0 >= 2.32 gthread-2.0 gobject-2.0 gmodule-2.0,
+  [
+    AC_DEFINE([HAVE_GLIB_2_32], [1], [Configure gthread deprecations])
+  ],
+  [
+    PKG_CHECK_MODULES(GLIB,
+                        glib-2.0 >= 2.28 gthread-2.0 gobject-2.0 gmodule-2.0)
+  ])
+])
 
 AC_CHECK_HEADERS(dirent.h dlfcn.h dl.h utmp.h locale.h mcheck.h unistd.h wctype.h)
 

Modified: gnucash/trunk/src/libqof/qof/qofutil.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qofutil.c	2013-05-03 12:03:53 UTC (rev 22943)
+++ gnucash/trunk/src/libqof/qof/qofutil.c	2013-05-03 12:04:03 UTC (rev 22944)
@@ -258,7 +258,9 @@
 void
 qof_init (void)
 {
-    g_type_init();
+#ifndef HAVE_GLIB_2_36
+    g_type_init(); /* Automatic as of GLib 2.36 */
+#endif
     qof_log_init();
     qof_string_cache_init();
     guid_init ();



More information about the gnucash-changes mailing list