summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2024-12-27 12:43:59 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2024-12-27 20:45:05 +0900
commit307060d9ab90e76131f0292e1133fa894d59d8d6 (patch)
tree9e231ecb10a6caa873b12c5b33403b5ccc71b580 /CMakeLists.txt
parent226e5aa1552ce0a4207638cb492cc6498cbc7d80 (diff)
downloadtdelibs-307060d9ab90e76131f0292e1133fa894d59d8d6.tar.gz
tdelibs-307060d9ab90e76131f0292e1133fa894d59d8d6.zip
Replace dl linking with cmake-based variable
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 95c36461d4175c62f4d9bf5303b28f56040dbe71)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt24
1 files changed, 3 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 41a4ed3ad..7f7acf0b7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -487,14 +487,10 @@ check_function_exists( madvise HAVE_MADVISE )
check_function_exists( getgroups HAVE_GETGROUPS )
check_symbol_exists( posix_fadvise "fcntl.h" HAVE_FADVISE )
check_function_exists( getcwd HAVE_GETCWD )
+tde_save_and_set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS} )
+check_function_exists( dlopen HAVE_LIBDL
check_function_exists( dlerror HAVE_DLERROR )
-if( NOT HAVE_DLERROR )
- check_library_exists( dl dlerror "" HAVE_DLERROR_LIB )
- if( HAVE_DLERROR_LIB )
- set( HAVE_DLERROR 1 )
- set( DLERROR_LIBRARIES dl )
- endif( HAVE_DLERROR_LIB )
-endif( NOT HAVE_DLERROR )
+tde_restore( CMAKE_REQUIRED_LIBRARIES )
check_function_exists( crypt HAVE_CRYPT )
if( NOT HAVE_CRYPT )
check_library_exists( crypt crypt "" HAVE_CRYPT_LIB )
@@ -652,20 +648,6 @@ if( WITH_TDEHWLIB )
endif( WITH_TDEHWLIB )
-##### check for libdl ###########################
-
-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_library_exists( dld, dld_link "" HAVE_DLD )
-
-
##### check for magic ###########################
set( MAGIC_LIBRARIES magic )