Not every platform is guaranteed to have dlopen/dlsym, so we should
conditionalize its use. Suprisingly it is actually present for Win32
via the mingw-dlfcn add on, but we should still conditionalize it.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
BuildRequires: mingw64-libxml2
BuildRequires: mingw32-portablexdr
BuildRequires: mingw64-portablexdr
+BuildRequires: mingw32-dlfcn
+BuildRequires: mingw64-dlfcn
BuildRequires: pkgconfig
# Need native version for msgfmt
/* XXX re-implement this for other OS, or use libtools helper lib ? */
-
-#include <dlfcn.h>
#define DEFAULT_DRIVER_DIR LIBDIR "/libvirt/connection-driver"
+#ifdef HAVE_DLFCN_H
+# include <dlfcn.h>
+
static void *
virDriverLoadModuleFile(const char *file)
return ret;
}
+#else /* ! HAVE_DLFCN_H */
+int
+virDriverLoadModuleFull(const char *path ATTRIBUTE_UNUSED,
+ const char *regfunc ATTRIBUTE_UNUSED,
+ void **handle)
+{
+ VIR_DEBUG("dlopen not available on this platform");
+ if (handle)
+ *handle = NULL;
+ return -1;
+}
+#endif /* ! HAVE_DLFCN_H */
+
int
virDriverLoadModule(const char *name,