diff --git a/configure.ac b/configure.ac index 0335446da..c7611abaf 100644 --- a/configure.ac +++ b/configure.ac @@ -82,9 +82,6 @@ AC_ARG_ENABLE(debug, [ --enable-debug Build debugger (.mdb) files for ) fi -CSFLAGS="$DEBUG_FLAGS $WIN64DEFINES" -AC_SUBST(CSFLAGS) - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test "x$PKG_CONFIG" = "xno"; then AC_MSG_ERROR([You need to install pkg-config]) @@ -176,6 +173,15 @@ PKG_CHECK_MODULES(GIO, gio-2.0 >= $GLIB_REQUIRED_VERSION) AC_SUBST(GIO_CFLAGS) AC_SUBST(GIO_LIBS) +CSFLAGS="$DEBUG_FLAGS $WIN64DEFINES" +PKG_CHECK_MODULES(GLIB_2_31, + glib-2.0 >= 2.31, + HAVE_GLIB_2_31_OR_HIGHER=yes, HAVE_GLIB_2_31_OR_HIGHER=no) +if test "x$HAVE_GLIB_2_31_OR_HIGHER" = "xyes" ; then + CSFLAGS="$CSFLAGS -define:DISABLE_GTHREAD_CHECK" +fi +AC_SUBST(CSFLAGS) + PKG_CHECK_MODULES(PANGO, pango) AC_SUBST(PANGO_CFLAGS) AC_SUBST(PANGO_LIBS) diff --git a/glib/Thread.cs b/glib/Thread.cs index 7ce2ce21a..249dd048e 100644 --- a/glib/Thread.cs +++ b/glib/Thread.cs @@ -28,6 +28,18 @@ namespace GLib { private Thread () {} +#if DISABLE_GTHREAD_CHECK + public static void Init () + { + // GLib automatically inits threads in 2.31 and above + // http://developer.gnome.org/glib/unstable/glib-Deprecated-Thread-APIs.html#g-thread-init + } + + public static bool Supported + { + get { return true; } + } +#else [DllImport ("libgthread-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern void g_thread_init (IntPtr i); @@ -45,5 +57,7 @@ namespace GLib return g_thread_get_initialized (); } } +#endif + } }