summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-12-21 18:59:47 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2010-12-21 18:59:47 (GMT)
commit5615ecf31189c97d79958a99a349a42aa249a853 (patch)
tree79735ecdfc1a55fc83253d84861bf526bf337c5f /Utilities
parent1f401294d4829ff5240b7123e7c2f7e98a2f7775 (diff)
parent7e0b0014664d7db64ab13a31d0624e5d61b4227c (diff)
downloadCMake-5615ecf31189c97d79958a99a349a42aa249a853.zip
CMake-5615ecf31189c97d79958a99a349a42aa249a853.tar.gz
CMake-5615ecf31189c97d79958a99a349a42aa249a853.tar.bz2
Merge topic 'dev/fix-cmcurl-try_run'
7e0b001 Fix missed _POLL_EMUL_H_ and HAVE_POLL combo 8a61950 Toss out strerror_r macros 44fca8b Check for poll when looking for _POLL_EMUL_H_ 8d36890 Use _POLL_EMUL_H_ instead of HAVE_POLL_FINE c5cbb31 Ignore strerror_r since CMake isn't threaded
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmcurl/CMake/OtherTests.cmake8
-rw-r--r--Utilities/cmcurl/CMakeLists.txt43
-rw-r--r--Utilities/cmcurl/config.h.in12
-rw-r--r--Utilities/cmcurl/select.c6
4 files changed, 3 insertions, 66 deletions
diff --git a/Utilities/cmcurl/CMake/OtherTests.cmake b/Utilities/cmcurl/CMake/OtherTests.cmake
index ea1613d..7d2c66f 100644
--- a/Utilities/cmcurl/CMake/OtherTests.cmake
+++ b/Utilities/cmcurl/CMake/OtherTests.cmake
@@ -193,14 +193,6 @@ SET(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
CURL_CHECK_C_SOURCE_COMPILES("struct timeval ts;\nts.tv_sec = 0;\nts.tv_usec = 0" HAVE_STRUCT_TIMEVAL)
-INCLUDE(CurlCheckCSourceRuns)
-SET(EXTRA_DEFINES)
-SET(HEADER_INCLUDES)
-IF(HAVE_SYS_POLL_H)
- SET(HEADER_INCLUDES "sys/poll.h")
-ENDIF(HAVE_SYS_POLL_H)
-CURL_CHECK_C_SOURCE_RUNS("return poll((void *)0, 0, 10 /*ms*/)" HAVE_POLL_FINE)
-
SET(HAVE_SIG_ATOMIC_T 1)
SET(EXTRA_DEFINES)
SET(HEADER_INCLUDES)
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index 0f98e5a..454d2d1 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -521,42 +521,6 @@ MACRO(CURL_INTERNAL_TEST CURL_TEST)
ENDIF("${CURL_TEST}" MATCHES "^${CURL_TEST}$")
ENDMACRO(CURL_INTERNAL_TEST)
-MACRO(CURL_INTERNAL_TEST_RUN CURL_TEST)
- IF("${CURL_TEST}_COMPILE" MATCHES "^${CURL_TEST}_COMPILE$")
- SET(MACRO_CHECK_FUNCTION_DEFINITIONS
- "-D${CURL_TEST} ${CMAKE_REQUIRED_FLAGS}")
- IF(CMAKE_REQUIRED_LIBRARIES)
- SET(CURL_TEST_ADD_LIBRARIES
- "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
- ENDIF(CMAKE_REQUIRED_LIBRARIES)
-
- MESSAGE(STATUS "Performing Curl Test ${CURL_TEST}")
- TRY_RUN(${CURL_TEST} ${CURL_TEST}_COMPILE
- ${CMAKE_BINARY_DIR}
- ${LIBCURL_SOURCE_DIR}/CMake/CurlTests.c
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
- "${CURL_TEST_ADD_LIBRARIES}"
- OUTPUT_VARIABLE OUTPUT)
- IF(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
- SET(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}")
- MESSAGE(STATUS "Performing Curl Test ${CURL_TEST} - Success")
- ELSE(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
- MESSAGE(STATUS "Performing Curl Test ${CURL_TEST} - Failed")
- SET(${CURL_TEST} "" CACHE INTERNAL "Curl test ${FUNCTION}")
- FILE(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
- "Performing Curl Test ${CURL_TEST} failed with the following output:\n"
- "${OUTPUT}")
- IF(${CURL_TEST}_COMPILE)
- FILE(APPEND
- "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
- "There was a running problem of this test\n")
- ENDIF(${CURL_TEST}_COMPILE)
- FILE(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
- "\n\n")
- ENDIF(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
- ENDIF("${CURL_TEST}_COMPILE" MATCHES "^${CURL_TEST}_COMPILE$")
-ENDMACRO(CURL_INTERNAL_TEST_RUN)
-
# Do curl specific tests
#OPTION(CURL_HAVE_DISABLED_NONBLOCKING "Disable non-blocking socket detection" OFF)
SET(CURL_NONBLOCKING_TESTS)
@@ -599,13 +563,6 @@ IF(HAVE_FILE_OFFSET_BITS)
SET(_FILE_OFFSET_BITS 64)
ENDIF(HAVE_FILE_OFFSET_BITS)
-FOREACH(CURL_TEST
- HAVE_GLIBC_STRERROR_R
- HAVE_POSIX_STRERROR_R
- )
- CURL_INTERNAL_TEST_RUN(${CURL_TEST})
-ENDFOREACH(CURL_TEST)
-
# Check for reentrant
FOREACH(CURL_TEST
HAVE_GETHOSTBYADDR_R_5
diff --git a/Utilities/cmcurl/config.h.in b/Utilities/cmcurl/config.h.in
index e3efdc1..6e74935 100644
--- a/Utilities/cmcurl/config.h.in
+++ b/Utilities/cmcurl/config.h.in
@@ -171,9 +171,6 @@
/* Define to 1 if you have the `gettimeofday' function. */
#cmakedefine HAVE_GETTIMEOFDAY ${HAVE_GETTIMEOFDAY}
-/* we have a glibc-style strerror_r() */
-#cmakedefine HAVE_GLIBC_STRERROR_R ${HAVE_GLIBC_STRERROR_R}
-
/* Define to 1 if you have the `gmtime_r' function. */
#cmakedefine HAVE_GMTIME_R ${HAVE_GMTIME_R}
@@ -348,12 +345,6 @@
/* Define to 1 if you have the `poll' function. */
#cmakedefine HAVE_POLL ${HAVE_POLL}
-/* If you have a fine poll */
-#cmakedefine HAVE_POLL_FINE ${HAVE_POLL_FINE}
-
-/* we have a POSIX-style strerror_r() */
-#cmakedefine HAVE_POSIX_STRERROR_R ${HAVE_POSIX_STRERROR_R}
-
/* Define to 1 if you have the <process.h> header file. */
#cmakedefine HAVE_PROCESS_H ${HAVE_PROCESS_H}
@@ -444,9 +435,6 @@
/* Define to 1 if you have the `strdup' function. */
#cmakedefine HAVE_STRDUP ${HAVE_STRDUP}
-/* Define to 1 if you have the `strerror_r' function. */
-#cmakedefine HAVE_STRERROR_R ${HAVE_STRERROR_R}
-
/* Define to 1 if you have the `stricmp' function. */
#cmakedefine HAVE_STRICMP ${HAVE_STRICMP}
diff --git a/Utilities/cmcurl/select.c b/Utilities/cmcurl/select.c
index d3967ed..51adbcf 100644
--- a/Utilities/cmcurl/select.c
+++ b/Utilities/cmcurl/select.c
@@ -78,7 +78,7 @@
*/
int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
{
-#if defined(HAVE_POLL_FINE) || defined(CURL_HAVE_WSAPOLL)
+#if (defined(HAVE_POLL) && !defined(_POLL_EMUL_H_)) || defined(CURL_HAVE_WSAPOLL)
struct pollfd pfd[2];
int num;
int r;
@@ -96,7 +96,7 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
num++;
}
-#ifdef HAVE_POLL_FINE
+#if defined(HAVE_POLL) && !defined(_POLL_EMUL_H_)
do {
r = poll(pfd, num, timeout_ms);
} while((r == -1) && (errno == EINTR));
@@ -220,7 +220,7 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
{
int r;
-#ifdef HAVE_POLL_FINE
+#if defined(HAVE_POLL) && !defined(_POLL_EMUL_H_)
do {
r = poll(ufds, nfds, timeout_ms);
} while((r == -1) && (errno == EINTR));