diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-10-06 17:03:16 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-10-06 17:03:16 (GMT) |
commit | 99b444b07371f96425d467c4c8701e059c3de8d0 (patch) | |
tree | 6c77ee1659eb6670f8192b51668d65ea3e02bb15 /Source/CTest/Curl | |
parent | 84f04477b260f1c11ba140f7028e649a86211a26 (diff) | |
download | CMake-99b444b07371f96425d467c4c8701e059c3de8d0.zip CMake-99b444b07371f96425d467c4c8701e059c3de8d0.tar.gz CMake-99b444b07371f96425d467c4c8701e059c3de8d0.tar.bz2 |
COMP: Attempt to fix non-blocking tests
Diffstat (limited to 'Source/CTest/Curl')
-rw-r--r-- | Source/CTest/Curl/CMake/CurlTests.c | 17 | ||||
-rw-r--r-- | Source/CTest/Curl/CMakeLists.txt | 44 |
2 files changed, 38 insertions, 23 deletions
diff --git a/Source/CTest/Curl/CMake/CurlTests.c b/Source/CTest/Curl/CMake/CurlTests.c index d8a12f6..981f9f3 100644 --- a/Source/CTest/Curl/CMake/CurlTests.c +++ b/Source/CTest/Curl/CMake/CurlTests.c @@ -458,3 +458,20 @@ main () return 0; } #endif +#ifdef HAVE_FIONBIO +/* headers for FIONBIO test */ +#include <unistd.h> +#include <stropts.h> + +int +main () +{ + +/* FIONBIO source test (old-style unix) */ + int socket; + int flags = ioctl(socket, FIONBIO, &flags); + + ; + return 0; +} +#endif diff --git a/Source/CTest/Curl/CMakeLists.txt b/Source/CTest/Curl/CMakeLists.txt index 5156960..32145ff 100644 --- a/Source/CTest/Curl/CMakeLists.txt +++ b/Source/CTest/Curl/CMakeLists.txt @@ -361,11 +361,19 @@ MACRO(CURL_INTERNAL_TEST CURL_TEST) ENDMACRO(CURL_INTERNAL_TEST) # Do curl specific tests -FOREACH(CURL_TEST - TIME_WITH_SYS_TIME - HAVE_O_NONBLOCK +#OPTION(CURL_HAVE_DISABLED_NONBLOCKING "Disable non-blocking socket detection" OFF) +SET(CURL_NONBLOCKING_TESTS) +IF(NOT CURL_HAVE_DISABLED_NONBLOCKING) + SET(CURL_NONBLOCKING_TESTS + HAVE_FIONBIO HAVE_IOCTLSOCKET HAVE_IOCTLSOCKET_CASE + HAVE_O_NONBLOCK + ) +ENDIF(NOT CURL_HAVE_DISABLED_NONBLOCKING) +FOREACH(CURL_TEST + ${CURL_NONBLOCKING_TESTS} + TIME_WITH_SYS_TIME HAVE_O_NONBLOCKHAVE_GETHOSTBYADDR_R_5 HAVE_GETHOSTBYADDR_R_7 HAVE_GETHOSTBYADDR_R_8 @@ -461,26 +469,16 @@ SET(CMAKE_REQUIRED_FLAGS) # Check for nonblocking -#OPTION(CURL_HAVE_DISABLED_NONBLOCKING "Disable non-blocking socket detection" OFF) -SET(HAVE_DISABLED_NONBLOCKING) -IF(WIN32) - SET(CURL_HAVE_DISABLED_NONBLOCKING 1) -ENDIF(WIN32) -IF(CURL_HAVE_DISABLED_NONBLOCKING) - SET(HAVE_SOME_NONBLOCK 0) - FOREACH(CURL_TEST - HAVE_FIONBIO - HAVE_IOCTLSOCKET - HAVE_IOCTLSOCKET_CASE - HAVE_O_NONBLOCK) - IF(${CURL_TEST}) - SET(HAVE_SOME_NONBLOCK 1) - ENDIF(${CURL_TEST}) - ENDFOREACH(CURL_TEST) - IF(NOT HAVE_SOME_NONBLOCK) - SET(HAVE_DISABLED_NONBLOCKING 1) - ENDIF(NOT HAVE_SOME_NONBLOCK) -ENDIF(CURL_HAVE_DISABLED_NONBLOCKING) +SET(HAVE_DISABLED_NONBLOCKING 1) +IF(HAVE_FIONBIO OR + HAVE_IOCTLSOCKET OR + HAVE_IOCTLSOCKET_CASE OR + HAVE_O_NONBLOCK) + SET(HAVE_DISABLED_NONBLOCKING) +ENDIF(HAVE_FIONBIO OR + HAVE_IOCTLSOCKET OR + HAVE_IOCTLSOCKET_CASE OR + HAVE_O_NONBLOCK) IF(RETSIGTYPE_TEST) SET(RETSIGTYPE void) |