diff options
author | Michele Calgaro <[email protected]> | 2024-12-27 12:43:59 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2024-12-27 20:41:18 +0900 |
commit | 95c36461d4175c62f4d9bf5303b28f56040dbe71 (patch) | |
tree | c40befd9eba0b767654025a0a385a1440da22852 /CMakeLists.txt | |
parent | af644c020106e7096d4fe9c648f25eede98c972f (diff) | |
download | tdelibs-95c36461d4175c62f4d9bf5303b28f56040dbe71.tar.gz tdelibs-95c36461d4175c62f4d9bf5303b28f56040dbe71.zip |
Replace dl linking with cmake-based variable
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 24 |
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 ) |