plugins.m4 640 B

123456789101112131415161718192021
  1. AC_DEFUN([AC_PLUGINS],
  2. [
  3. maybe_plugins=no
  4. AC_CHECK_HEADERS([dlfcn.h], [maybe_plugins=yes], [], [AC_INCLUDES_DEFAULT])
  5. AC_CHECK_HEADERS([windows.h], [maybe_plugins=yes], [], [AC_INCLUDES_DEFAULT])
  6. AC_ARG_ENABLE([plugins],
  7. AS_HELP_STRING([--enable-plugins], [Enable support for plugins]),
  8. [case "${enableval}" in
  9. no) plugins=no ;;
  10. *) plugins=yes
  11. if test "$maybe_plugins" != "yes" ; then
  12. AC_MSG_ERROR([Building with plugin support requires a host that supports dlopen.])
  13. fi ;;
  14. esac],
  15. [plugins=$maybe_plugins]
  16. )
  17. if test "$plugins" = "yes"; then
  18. AC_SEARCH_LIBS([dlsym], [dl])
  19. fi
  20. ])