+dnl ------------------------------------------------------------------------
+dnl DLL support
+dnl ------------------------------------------------------------------------
+
+dnl under MSW we always have LoadLibrary/GetProcAddress
+if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
+
+ HAVE_DL_FUNCS=0
+ HAVE_SHL_FUNCS=0
+ if test "$wxUSE_DYNAMIC_LOADER" = "yes" -o "$wxUSE_DYNLIB_CLASS" = "yes" ; then
+ if test "$USE_DARWIN" = 1; then
+ dnl dlopen/dlerror is implemented in dynlib.cpp for Darwin/Mac OS X
+ HAVE_DL_FUNCS=1
+ else
+ dnl the test is a bit complicated because we check for dlopen() both with
+ dnl and without -ldl and we also try to find shl_load() if there is no
+ dnl dlopen() on this system
+ AC_CHECK_FUNCS(dlopen,
+ [
+ AC_DEFINE(HAVE_DLOPEN)
+ HAVE_DL_FUNCS=1
+ ],
+ [
+ AC_CHECK_LIB(dl, dlopen,
+ [
+ AC_DEFINE(HAVE_DLOPEN)
+ HAVE_DL_FUNCS=1
+ DL_LINK=" -ldl$DL_LINK"
+ ],
+ [
+ AC_CHECK_FUNCS(shl_load,
+ [
+ AC_DEFINE(HAVE_SHL_LOAD)
+ HAVE_SHL_FUNCS=1
+ ],
+ [
+ AC_CHECK_LIB(shl_load, dld,
+ [
+ HAVE_SHL_FUNCS=1
+ DL_LINK=" -ldld$DL_LINK"
+ ])
+ ])
+ ])
+ ])
+
+ dnl check also for dlerror()
+ if test "$HAVE_DL_FUNCS" = 1; then
+ AC_CHECK_FUNCS(dlerror,
+ AC_DEFINE(HAVE_DLERROR),
+ [
+ AC_CHECK_LIB(dl, dlerror, AC_DEFINE(HAVE_DLERROR))
+ ]
+ )
+ fi
+ fi
+
+ if test "$HAVE_DL_FUNCS" = 0; then
+ if test "$HAVE_SHL_FUNCS" = 0; then
+ if test "$USE_UNIX" = 1; then
+ AC_MSG_WARN([Missing dynamic loading support, several features will be disabled])
+ wxUSE_DYNAMIC_LOADER=no
+ wxUSE_DYNLIB_CLASS=no
+ else
+ AC_MSG_WARN([Assuming wxLibrary class works on this platform])
+ fi
+ fi
+ fi
+ fi
+fi
+
+if test "$wxUSE_DYNAMIC_LOADER" = "yes" ; then
+ AC_DEFINE(wxUSE_DYNAMIC_LOADER)
+fi
+if test "$wxUSE_DYNLIB_CLASS" = "yes" ; then
+ AC_DEFINE(wxUSE_DYNLIB_CLASS)
+fi
+
+
+dnl ---------------------------------------------------------------------------
+dnl Verify consistency of plugins/monolithic/shared settings:
+dnl ---------------------------------------------------------------------------
+
+if test "$wxUSE_PLUGINS" = "yes" ; then
+ if test "$wxUSE_SHARED" = "no" ; then
+ AC_MSG_WARN([plugins supported only in shared build, disabling])
+ wxUSE_PLUGINS=no
+ fi
+ if test "$wxUSE_MONOLITHIC" = "yes" ; then
+ AC_MSG_WARN([plugins not supported monolithic build, disabling])
+ wxUSE_PLUGINS=no
+ fi
+ if test "$wxUSE_DYNLIB_CLASS" = "no" ; then
+ AC_MSG_WARN([plugins require wxDynamicLibrary, disabling])
+ wxUSE_PLUGINS=no
+ fi
+ if test "$wxUSE_PLUGINS" = "yes" ; then
+ AC_DEFINE(wxUSE_PLUGINS)
+ fi
+fi
+