diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2015-08-30 14:39:55 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2015-08-30 14:42:33 +0200 |
commit | 38ed45d3b9c64d38888b967f63b92e6c69141211 (patch) | |
tree | b410bc7568983939fd9b7411d82421ee60afea8b | |
parent | 07665de5d8669895633b3655abdd87306ab0977b (diff) | |
download | tdelibs-38ed45d3b9c64d38888b967f63b92e6c69141211.tar.gz tdelibs-38ed45d3b9c64d38888b967f63b92e6c69141211.zip |
Fix dlerror and crypt detection for CMake build
This resolves Bug 654
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 4925611808ccb524a6c0bd225fb39b52ae1cf1ae)
-rw-r--r-- | CMakeLists.txt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b743de7b8..c366aa04c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -396,7 +396,28 @@ check_function_exists( madvise HAVE_MADVISE ) check_function_exists( getgroups HAVE_GETGROUPS ) check_function_exists( getcwd HAVE_GETCWD ) 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 ) check_function_exists( crypt HAVE_CRYPT ) +if( NOT HAVE_CRYPT ) + check_library_exists( crypt crypt "" HAVE_CRYPT_LIB ) + if( HAVE_CRYPT_LIB ) + set( HAVE_CRYPT 1 ) + set( CRYPT_LIBRARIES crypt ) + endif( HAVE_CRYPT_LIB ) +endif( NOT HAVE_CRYPT ) +if( NOT HAVE_CRYPT ) + check_library_exists( c crypt "" HAVE_CRYPT_LIBC ) + if( HAVE_CRYPT_LIBC ) + set( HAVE_CRYPT 1 ) + set( CRYPT_LIBRARIES c ) + endif( HAVE_CRYPT_LIBC ) +endif( NOT HAVE_CRYPT ) check_function_exists( bcopy HAVE_BCOPY ) check_function_exists( mmap HAVE_MMAP ) check_function_exists( munmap HAVE_MUNMAP ) |