From 3130108bc885cb345f789ec5826a49ac3e9db3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sun, 14 Sep 2014 20:09:06 +0200 Subject: [PATCH] Fix hardcoded link flag to "dl" library Fix "dlopen" function detection (cherry picked from commit c73ca85a7664deae18d4b5a1671e84c558160167) --- CMakeLists.txt | 6 +++++- artsc/CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e33152..80d2254 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,6 +78,10 @@ set( DL_LIBRARIES dl ) check_library_exists( ${DL_LIBRARIES} dlopen /lib HAVE_LIBDL ) if( NOT HAVE_LIBDL ) unset( DL_LIBRARIES ) + check_function_exists( dlopen HAVE_DLOPEN ) + if( HAVE_DLOPEN ) + set( HAVE_LIBDL 1 ) + endif( HAVE_DLOPEN ) endif( NOT HAVE_LIBDL ) find_package( Threads ) @@ -87,7 +91,7 @@ find_package( Threads ) include( CheckFunctionExists ) set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ) -set( CMAKE_REQUIRED_LIBRARIES dl ) +set( CMAKE_REQUIRED_LIBRARIES ${DL_LIBRARIES} ) check_function_exists( dlerror HAVE_DLERROR ) check_function_exists( strcmp HAVE_STRCMP ) check_function_exists( strchr HAVE_STRCHR ) diff --git a/artsc/CMakeLists.txt b/artsc/CMakeLists.txt index 855c302..59833c1 100644 --- a/artsc/CMakeLists.txt +++ b/artsc/CMakeLists.txt @@ -65,7 +65,7 @@ install( FILES tde_add_library( artsdsp SHARED SOURCES artsdsp.c VERSION 0.0.0 - LINK artsc-shared dl + LINK artsc-shared ${DL_LIBRARIES} DESTINATION ${LIB_INSTALL_DIR} )