summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrançois Andriot <francois.andriot@free.fr>2014-10-05 14:44:34 +0200
committerSlávek Banko <slavek.banko@axis.cz>2015-12-23 02:22:50 +0100
commite4213f01b9eaa5100c31d497f15d87695d18f4cd (patch)
tree5a8790cbe81fa5ae42696b54011e8209449f4222
parentf3635faf14a7521e7e9263f197d071a98bdda171 (diff)
downloadtdelibs-e4213f01b9eaa5100c31d497f15d87695d18f4cd.tar.gz
tdelibs-e4213f01b9eaa5100c31d497f15d87695d18f4cd.zip
Fix hardcoded link flag to "dl" library
Fix "dlopen" function detection (cherry picked from commit af2c2afb25ce2b62767cdc639cf6d0c4fb967eaa)
-rw-r--r--CMakeLists.txt13
-rw-r--r--kstyles/kthemestyle/CMakeLists.txt2
2 files changed, 10 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e8b2ff73b..ea892a911 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -463,10 +463,15 @@ set( kde_socklen_t socklen_t )
##### check for libdl ###########################
-find_library( HAVE_LIBDL dl )
-if( NOT HAVE_LIBDL-NOTFOUND )
- set( DL_LIBRARIES dl )
-endif( NOT HAVE_LIBDL-NOTFOUND )
+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 )
##### check for utempter ########################
diff --git a/kstyles/kthemestyle/CMakeLists.txt b/kstyles/kthemestyle/CMakeLists.txt
index 9bfb5cb17..bf6cc0317 100644
--- a/kstyles/kthemestyle/CMakeLists.txt
+++ b/kstyles/kthemestyle/CMakeLists.txt
@@ -36,6 +36,6 @@ set( ${target}_SRCS
tde_add_kpart( ${target} AUTOMOC
SOURCES ${${target}_SRCS}
- LINK kdefx-shared kdecore-shared dl
+ LINK kdefx-shared kdecore-shared ${DL_LIBRARIES}
DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/styles
)