aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-07-23 11:57:17 +0200
committerAndreas Schneider <mail@cynapses.org>2009-07-23 11:57:17 +0200
commit1939a55c3cae415ae295134d54e34a2daec43438 (patch)
treede6fe577a4d471afae38a50b41c6be689a43fa24
parent2a116bb2917e755282b29fcca46c76e85e7aa383 (diff)
downloadlibssh-1939a55c3cae415ae295134d54e34a2daec43438.tar.gz
libssh-1939a55c3cae415ae295134d54e34a2daec43438.tar.xz
libssh-1939a55c3cae415ae295134d54e34a2daec43438.zip
Fix getaddrinfo and gethostbyname build problems on Solaris.
-rw-r--r--ConfigureChecks.cmake8
-rw-r--r--libssh/CMakeLists.txt14
2 files changed, 22 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 15ec4ca..679dea7 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -35,7 +35,15 @@ if (WIN32)
set(HAVE_SELECT TRUE)
else (WIN32)
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(regcomp HAVE_REGCOMP)
diff --git a/libssh/CMakeLists.txt b/libssh/CMakeLists.txt
index 0aceca8..89288db 100644
--- a/libssh/CMakeLists.txt
+++ b/libssh/CMakeLists.txt
@@ -35,6 +35,20 @@ if (WIN32)
)
endif (WIN32)
+if (HAVE_LIB_GETHOSTBYNAME)
+ set(LIBSSH_LINK_LIBRARIES
+ ${LIBSSH_LINK_LIBRARIES}
+ nsl
+ )
+endif (HAVE_LIB_GETHOSTBYNAME)
+
+if (HAVE_LIB_GETADDRINFO)
+ set(LIBSSH_LINK_LIBRARIES
+ ${LIBSSH_LINK_LIBRARIES}
+ socket
+ )
+endif (HAVE_LIB_GETADDRINFO)
+
if (CRYPTO_LIBRARY)
set(LIBSSH_PRIVATE_INCLUDE_DIRS
${LIBSSH_PRIVATE_INCLUDE_DIRS}