ac-g-module-supported.m4 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. g_module_supported=""
  8. if test x"$no_x" = xyes; then
  9. textmode_x11_support="no"
  10. else
  11. found_gmodule=no
  12. PKG_CHECK_MODULES(GMODULE, [gmodule-no-export-2.0 >= 2.8], [found_gmodule=yes], [:])
  13. if test x"$found_gmodule" = xyes; then
  14. g_module_supported="gmodule-no-export-2.0"
  15. else
  16. dnl try fallback to the generic gmodule
  17. PKG_CHECK_MODULES(GMODULE, [gmodule-2.0 >= 2.8], [found_gmodule=yes], [:])
  18. if test x"$found_gmodule" = xyes; then
  19. g_module_supported="gmodule-2.0"
  20. fi
  21. fi
  22. CPPFLAGS="$CPPFLAGS $X_CFLAGS"
  23. case x"$g_module_supported" in
  24. xgmodule-no-export-2.0|xgmodule-2.0)
  25. if test x`$PKG_CONFIG --variable=gmodule_supported "$g_module_supported"` = xtrue; then
  26. AC_DEFINE([HAVE_GMODULE], [1], [Defined if gmodule functionality is supported])
  27. else
  28. g_module_supported=""
  29. fi
  30. ;;
  31. *)
  32. MCLIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
  33. g_module_supported=""
  34. ;;
  35. esac
  36. AC_DEFINE([HAVE_TEXTMODE_X11_SUPPORT], [1],
  37. [Define to enable getting events from X Window System])
  38. textmode_x11_support="yes"
  39. fi
  40. AM_CONDITIONAL([HAVE_GMODULE], [test x"$g_module_supported" != x])
  41. ])