2 dnl Check whether the g_module_* family of functions works
3 dnl on this system. We need to know that at the compile time to
4 dnl decide whether to link with X11.
6 AC_DEFUN([mc_G_MODULE_SUPPORTED], [
11 PKG_CHECK_MODULES(GMODULE, [gmodule-no-export-2.0 >= 2.30], [found_gmodule=yes], [:])
12 if test x"$found_gmodule" = xyes; then
13 g_module_supported="gmodule-no-export-2.0"
15 dnl try fallback to the generic gmodule
16 PKG_CHECK_MODULES(GMODULE, [gmodule-2.0 >= 2.30], [found_gmodule=yes], [:])
17 if test x"$found_gmodule" = xyes; then
18 g_module_supported="gmodule-2.0"
22 case x"$g_module_supported" in
23 xgmodule-no-export-2.0|xgmodule-2.0)
24 if test x`$PKG_CONFIG --variable=gmodule_supported "$g_module_supported"` = xtrue; then
25 AC_DEFINE([HAVE_GMODULE], [1], [Defined if gmodule functionality is supported])
36 dnl Try to find static libraries for glib and gmodule.
38 if test x$with_glib_static = xyes; then
40 for i in $GLIB_LIBS; do
51 if test -n "$lib"; then
52 lib1=`echo $i | sed 's/^-l//'`
53 if test -f "$GLIB_LIBDIR/lib${lib1}.a"; then
54 add="$GLIB_LIBDIR/lib${lib1}.a"
56 if test -f "$GLIB_LIBDIR/lib${lib}.a"; then
57 add="$GLIB_LIBDIR/lib${lib}.a"
59 AC_MSG_ERROR([Cannot find static $lib])
63 new_GLIB_LIBS="$new_GLIB_LIBS $add"
65 GLIB_LIBS="$new_GLIB_LIBS"
70 AC_DEFUN([mc_CHECK_GLIB], [
72 dnl First try glib 2.x.
73 dnl Keep this check close to the beginning, so that the users
74 dnl without any glib won't have their time wasted by other checks.
77 AC_ARG_WITH([glib_static],
78 AS_HELP_STRING([--with-glib-static], [Link glib statically @<:@no@:>@]))
81 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.30], [glib_found=yes], [:])
82 if test x"$glib_found" = xno; then
83 AC_MSG_ERROR([glib-2.0 not found or version too old (must be >= 2.30)])