s48_glib.m4 754 B

12345678910111213141516171819202122
  1. ### s48_glib.m4 --- S48_GLIB macro -*- Autoconf -*-
  2. # serial 1
  3. dnl
  4. dnl
  5. dnl
  6. AC_DEFUN([S48_GLIB], [dnl
  7. AC_ARG_ENABLE([glib],
  8. [AC_HELP_STRING([--enable-glib],
  9. [Use the glib event loop])],
  10. [if test "$enable_glib" != no; then
  11. dnl Check for glib-2.0
  12. PKG_CHECK_MODULES(GLIB, glib-2.0, AC_DEFINE(HAVE_GLIB), AC_MSG_WARN(glib-2.0 not found))
  13. dnl Set GLIB flags
  14. LIBS="$LIBS $GLIB_LIBS"
  15. CFLAGS="$CFLAGS $GLIB_CFLAGS"
  16. dnl Check if we still are able to compile, link, and run with glib's build options
  17. AC_MSG_CHECKING([whether the GLIB flags work])
  18. AC_TRY_RUN([int main() { return 0;}], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR(Failed to compile with GLIB flags.)], [])
  19. fi])
  20. ])
  21. ### s48_glib.m4 ends here