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