summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2010-12-31 18:11:30 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2010-12-31 18:11:30 +0100
commit930bb01fffd23a04d744fab62e94ce8a4bd9e04c (patch)
tree14e8ac81d91b6b0b20321acfad031a6c6887e2eb
parent0be70a290dfe9228cbbe2702132f77f41bdbf962 (diff)
downloadeurephia-930bb01fffd23a04d744fab62e94ce8a4bd9e04c.tar.gz
eurephia-930bb01fffd23a04d744fab62e94ce8a4bd9e04c.tar.xz
eurephia-930bb01fffd23a04d744fab62e94ce8a4bd9e04c.zip
Only look for dlopen() and dlclose() in libdl on Linux
Other platforms, like FreeBDS, have these functions in the standard libc library. Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
-rw-r--r--CMakeLists.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ab21b37..08110c3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,6 +50,8 @@ INCLUDE(CheckIncludeFile)
INCLUDE(CheckLibraryExists)
FIND_PACKAGE(PkgConfig)
+MESSAGE(STATUS "Build Platform: ${CMAKE_SYSTEM_NAME}")
+
#
# Add support for extra eurephia modules
#
@@ -105,8 +107,13 @@ ENDIF(PLUGIN)
# Check that we have dynamic loader available
CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
-CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_DLOPEN)
-CHECK_LIBRARY_EXISTS(dl dlclose "" HAVE_DLCLOSE)
+IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_DLOPEN)
+ CHECK_LIBRARY_EXISTS(dl dlclose "" HAVE_DLCLOSE)
+ELSE(!${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ CHECK_LIBRARY_EXISTS(c dlopen "" HAVE_DLOPEN)
+ CHECK_LIBRARY_EXISTS(c dlclose "" HAVE_DLCLOSE)
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
IF(NOT HAVE_DLOPEN OR NOT HAVE_DLCLOSE)
message(FATAL_ERROR "Missing proper dl library")
ENDIF(NOT HAVE_DLOPEN OR NOT HAVE_DLCLOSE)