plugins.m4 641 B

12345678910111213141516171819202122
  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([dlopen], [dl])
  19. fi
  20. ])