Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@samba.org>
# SYSTEM LIBRARIES
-check_library_exists(dl dlopen "" HAVE_LIBDL)
-if (HAVE_LIBDL)
- find_library(DLFCN_LIBRARY dl)
+find_library(DLFCN_LIBRARY dl)
+if (DLFCN_LIBRARY)
list(APPEND _REQUIRED_LIBRARIES ${DLFCN_LIBRARY})
-endif (HAVE_LIBDL)
+else()
+ check_function_exists(dlopen HAVE_DLOPEN)
+ if (NOT HAVE_DLOPEN)
+ message(FATAL_ERROR "FATAL: No dlopen() function detected")
+ endif()
+endif()
if (OSX)
set(HAVE_APPLE 1)