diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2013-07-27 10:52:56 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2013-07-27 11:27:09 +0200 |
commit | 1067591480fdd17f0b4cc5a8a4924db38fd2a43a (patch) | |
tree | 7e263b9aee11b31a785936dcd1bc8c5360ff98d0 | |
parent | 7375de0b056cf3cab937f789101a16fd838c749c (diff) | |
download | libssh-1067591480fdd17f0b4cc5a8a4924db38fd2a43a.tar.gz libssh-1067591480fdd17f0b4cc5a8a4924db38fd2a43a.tar.xz libssh-1067591480fdd17f0b4cc5a8a4924db38fd2a43a.zip |
cmake: Fix configure check for ntohll and htonll.
-rw-r--r-- | ConfigureChecks.cmake | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 90cc8401..1c89c4c7 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -57,14 +57,6 @@ if (WIN32) message(STATUS "WARNING: Without wspiapi.h, this build will only work on Windows XP and newer versions") endif (NOT HAVE_WSPIAPI_H) check_include_files("winsock2.h;ws2tcpip.h" HAVE_WS2TCPIP_H) - if (HAVE_WSPIAPI_H OR HAVE_WS2TCPIP_H) - set(HAVE_GETADDRINFO TRUE) - set(HAVE_GETHOSTBYNAME TRUE) - set(HAVE_NTOHLL TRUE) - set(HAVE_HTONLL TRUE) - endif (HAVE_WSPIAPI_H OR HAVE_WS2TCPIP_H) - - set(HAVE_SELECT TRUE) endif (WIN32) set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS}) @@ -107,6 +99,8 @@ check_function_exists(snprintf HAVE_SNPRINTF) check_function_exists(poll HAVE_POLL) check_function_exists(select HAVE_SELECT) check_function_exists(getaddrinfo HAVE_GETADDRINFO) +check_function_exists(ntohll HAVE_NTOHLL) +check_function_exists(htonll HAVE_HTONLL) if (WIN32) check_function_exists(_strtoui64 HAVE__STRTOUI64) @@ -115,6 +109,17 @@ if (WIN32) check_function_exists(_vsnprintf HAVE__VSNPRINTF) check_function_exists(_snprintf HAVE__SNPRINTF) check_function_exists(_snprintf_s HAVE__SNPRINTF_S) + + if (HAVE_WSPIAPI_H OR HAVE_WS2TCPIP_H) + set(HAVE_GETADDRINFO TRUE) + set(HAVE_GETHOSTBYNAME TRUE) + if (MSVC) + set(HAVE_NTOHLL TRUE) + set(HAVE_HTONLL TRUE) + endif (MSVC) + endif (HAVE_WSPIAPI_H OR HAVE_WS2TCPIP_H) + + set(HAVE_SELECT TRUE) endif (WIN32) if (UNIX) @@ -122,7 +127,7 @@ if (UNIX) # libsocket (Solaris) check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET) if (HAVE_LIBSOCKET) - set(HAVE_GETADDRINFO 1) + set(HAVE_GETADDRINFO TRUE) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} socket) endif (HAVE_LIBSOCKET) |