aboutsummaryrefslogtreecommitdiff
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-08-20 11:50:49 +0200
committerAndreas Schneider <mail@cynapses.org>2009-08-20 11:50:49 +0200
commitfd83d694403834493da20eb4977c7269c2b2ff43 (patch)
tree361a15c24c9a80f66db29f5ae0f1d01fb0a79a62 /ConfigureChecks.cmake
parent461e46b814a5b49ffaebd308ddb6ed886f2913fd (diff)
downloadlibssh-fd83d694403834493da20eb4977c7269c2b2ff43.tar.gz
libssh-fd83d694403834493da20eb4977c7269c2b2ff43.tar.xz
libssh-fd83d694403834493da20eb4977c7269c2b2ff43.zip
Improve the configure checks.
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake15
1 files changed, 8 insertions, 7 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index c2a2def4..1e8fbf5b 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -23,7 +23,12 @@ endif(CMAKE_COMPILER_IS_GNUC)
# HEADER FILES
check_include_file(pty.h HAVE_PTY_H)
check_include_file(terminos.h HAVE_TERMIOS_H)
-check_include_file(wspiapi.h HAVE_WSPIAPI_H)
+if (WIN32)
+ check_include_file(wspiapi.h HAVE_WSPIAPI_H)
+ set(HAVE_GETADDRINFO TRUE)
+ set(HAVE_GETHOSTBYNAME TRUE)
+ set(HAVE_SELECT TRUE)
+endif (WIN32)
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
check_include_file(openssl/aes.h HAVE_OPENSSL_AES_H)
@@ -34,11 +39,7 @@ check_include_file(openssl/des.h HAVE_OPENSSL_DES_H)
# FUNCTIONS
check_function_exists(cfmakeraw HAVE_CFMAKERAW)
-if (WIN32)
- set(HAVE_GETADDRINFO TRUE)
- set(HAVE_GETHOSTBYNAME TRUE)
- set(HAVE_SELECT TRUE)
-else (WIN32)
+if (UNIX)
check_function_exists(getaddrinfo HAVE_GETADDRINFO)
if (NOT HAVE_GETADDRINFO)
check_library_exists("socket" "getaddrinfo" "" HAVE_LIB_GETADDRINFO)
@@ -52,7 +53,7 @@ else (WIN32)
check_function_exists(poll HAVE_POLL)
check_function_exists(select HAVE_SELECT)
check_function_exists(regcomp HAVE_REGCOMP)
-endif (WIN32)
+endif (UNIX)
# LIBRARIES
if (CRYPTO_FOUND)