Bug #698781 can't build with glib 2.36: error: 'g_type_init' is deprecated

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22944 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens
2013-05-03 12:04:03 +00:00
parent 84b2428192
commit 1b80da7f94
2 changed files with 23 additions and 10 deletions

View File

@@ -229,15 +229,26 @@ fi
### --------------------------------------------------------------------------
### 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)

View File

@@ -258,7 +258,9 @@ static gboolean qof_util_str_equal(gconstpointer v, gconstpointer v2)
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 ();