aboutsummaryrefslogtreecommitdiff
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-08-21 15:15:18 +0200
committerAndreas Schneider <mail@cynapses.org>2009-08-21 15:15:18 +0200
commitc497f057a06f33d47123935375fe55806be18d9e (patch)
tree75b2ba724295f65ba94fdca1a5b8f23510a777bc /ConfigureChecks.cmake
parentfc0af0f0d879fbb207f7d4c236d191590a639e1a (diff)
downloadlibssh-c497f057a06f33d47123935375fe55806be18d9e.tar.gz
libssh-c497f057a06f33d47123935375fe55806be18d9e.tar.xz
libssh-c497f057a06f33d47123935375fe55806be18d9e.zip
Improve detection for required libraries on Solaris.
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake22
1 files changed, 13 insertions, 9 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index b1935c6..07bcaec 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -41,20 +41,24 @@ set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
check_include_file(openssl/des.h HAVE_OPENSSL_DES_H)
# FUNCTIONS
-check_function_exists(cfmakeraw HAVE_CFMAKERAW)
+
if (UNIX)
+ # libsocket (Solaris)
+ check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET)
+ if (HAVE_LIBSOCKET)
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} socket)
+ endif (HAVE_LIBSOCKET)
+ # libnsl (Solaris)
+ check_library_exists(nsl gethostbyname "" HAVE_LIBNSL)
+ if (HAVE_LIBNSL)
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} nsl)
+ endif (HAVE_LIBNSL)
+
check_function_exists(getaddrinfo HAVE_GETADDRINFO)
- if (NOT HAVE_GETADDRINFO)
- check_library_exists("socket" "getaddrinfo" "" HAVE_LIB_GETADDRINFO)
- set(HAVE_GETADDRINFO 1)
- endif (NOT HAVE_GETADDRINFO)
check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
- if (NOT HAVE_GETHOSTBYNAME)
- check_library_exists("nsl" "gethostbyname" "" HAVE_LIB_GETHOSTBYNAME)
- set(HAVE_GETHOSTBYNAME 1)
- endif (NOT HAVE_GETHOSTBYNAME)
check_function_exists(poll HAVE_POLL)
check_function_exists(select HAVE_SELECT)
+ check_function_exists(cfmakeraw HAVE_CFMAKERAW)
check_function_exists(regcomp HAVE_REGCOMP)
endif (UNIX)