dnl _GLIB_TRY_VERSION(min-version)
AC_DEFUN([_GLIB_TRY_VERSION], [dnl
-sedhead='s/@<:@0-9@:>@@<:@0-9@:>@*/<<<&>>>/'
-sedtail='s/.*<<<\(.*\)>>>.*/\1/;t;s/.*/0/'
-glib_min_major=`printf '%s' '$1' | sed -e "$sedhead"1 -e "$sedtail"`
-glib_min_minor=`printf '%s' '$1' | sed -e "$sedhead"2 -e "$sedtail"`
-glib_min_release=`printf '%s' '$1' | sed -e "$sedhead"3 -e "$sedtail"`
+shead='s/@<:@0-9@:>@@<:@0-9@:>@*/<<<&>>>/'
+sbody='s/.*<<<\(.*\)>>>.*/\1/;t'
+stail='s/.*/0/'
+glib_min_major=`printf '%s' '$1' | sed -e "$shead"1 -e "$sbody" -e "$stail"`
+glib_min_minor=`printf '%s' '$1' | sed -e "$shead"2 -e "$sbody" -e "$stail"`
+glib_min_release=`printf '%s' '$1' | sed -e "$shead"3 -e "$sbody" -e "$stail"`
AC_CACHE_CHECK([for glib version at least $1],
[glib_cv_sufficient_ver],
])
])
+ifelse([$1], [gthread], [dnl
+ m4_append([_GLIB_MAIN], [dnl
+g_thread_init(NULL);
+])
+])
+
if test x"$PKG_CONFIG" != x; then
AC_MSG_CHECKING([pkg-config database for $1-2.0])
_PKG_CONFIG([lib$1_cflags], [cflags], [$1-2.0])
_GLIB_MODULE([glib], [glib])
_GLIB_MODULE([gobject], [$2])
+_GLIB_MODULE([gthread], [$2])
AC_LANG_PUSH([C])
old_cflags=$CFLAGS