diff options
-rw-r--r-- | ConfigureChecks.cmake | 22 | ||||
-rw-r--r-- | libssh/CMakeLists.txt | 8 |
2 files changed, 17 insertions, 13 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) diff --git a/libssh/CMakeLists.txt b/libssh/CMakeLists.txt index 2fc8adb..fc355bf 100644 --- a/libssh/CMakeLists.txt +++ b/libssh/CMakeLists.txt @@ -35,19 +35,19 @@ if (WIN32) ) endif (WIN32) -if (HAVE_LIB_GETHOSTBYNAME) +if (HAVE_LIBNSL) set(LIBSSH_LINK_LIBRARIES ${LIBSSH_LINK_LIBRARIES} nsl ) -endif (HAVE_LIB_GETHOSTBYNAME) +endif (HAVE_LIBNSL) -if (HAVE_LIB_GETADDRINFO) +if (HAVE_LIBSOCKET) set(LIBSSH_LINK_LIBRARIES ${LIBSSH_LINK_LIBRARIES} socket ) -endif (HAVE_LIB_GETADDRINFO) +endif (HAVE_LIBSOCKET) if (CRYPTO_LIBRARY) set(LIBSSH_PRIVATE_INCLUDE_DIRS |