Ticket #2097: ChangeLog in its current form does not strictly make any sense
[midnight-commander.git] / m4.include / ac-g-module-supported.m4
blobf8c15fcf42aaa657c16bd344cc7063927446ead6
1 dnl
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.
5 dnl
6 AC_DEFUN([AC_G_MODULE_SUPPORTED], [
7     AC_CACHE_CHECK([if gmodule functionality is supported], mc_cv_g_module_supported, [
8         ac_save_CFLAGS="$CFLAGS"
9         ac_save_LIBS="$LIBS"
10         CFLAGS="$CFLAGS $GMODULE_CFLAGS"
11         LIBS="$GMODULE_LIBS $LIBS"
12         AC_TRY_RUN([
13 #include <gmodule.h>
15 int main ()
17     int ret = (g_module_supported () == TRUE) ? 0 : 1;
18     return ret;
20         ],
21             [mc_cv_g_module_supported=yes],
22             [mc_cv_g_module_supported=no],
23             [mc_cv_g_module_supported=no]
24         )
25         CFLAGS="$ac_save_CFLAGS"
26         LIBS="$ac_save_LIBS"
27     ])
29 if test x"$mc_cv_g_module_supported" = xyes; then
30     AC_DEFINE(HAVE_GMODULE, 1,
31               [Define if gmodule functionality is supported])