From af2c2afb25ce2b62767cdc639cf6d0c4fb967eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sun, 5 Oct 2014 14:44:34 +0200 Subject: Fix hardcoded link flag to "dl" library Fix "dlopen" function detection --- CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ee04b5c6..5433fe121 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -475,10 +475,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 ######################## -- cgit v1.2.1