From: Viktor Szakats Date: Fri, 14 Oct 2022 18:06:30 +0000 (+0000) Subject: cmake: sync HAVE_SIGNAL detection with autotools X-Git-Tag: curl-7_86_0~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=790779fc3444a5cbf0208dd8b06785bea7f25681;p=thirdparty%2Fcurl.git cmake: sync HAVE_SIGNAL detection with autotools `HAVE_SIGNAL` means the availability of the `signal()` function in autotools, while in CMake it meant the availability of that function _and_ the symbol `SIGALRM`. The latter is not available on Windows, but the function is, which means on Windows, autotools did define `HAVE_SIGNAL`, but CMake did not, introducing a slight difference into the binaries. This patch syncs CMake behaviour with autotools to look for the function only. The logic came with the initial commit adding CMake support to curl, so the commit history doesn't reveal the reason behind it. In any case, it's best to check the existence of `SIGALRM` directly in the source before use. For now, curl builds fine with `HAVE_SIGNAL` enabled and `SIGALRM` missing. Follow-up to 68fa9bf3f5d7b4fcbb57619f70cb4aabb79a51f6 Closes #9725 --- diff --git a/CMake/Platforms/WindowsCache.cmake b/CMake/Platforms/WindowsCache.cmake index d6dc5a0fa8..a9930f0b2a 100644 --- a/CMake/Platforms/WindowsCache.cmake +++ b/CMake/Platforms/WindowsCache.cmake @@ -71,8 +71,7 @@ if(NOT UNIX) set(HAVE_RAND_EGD 0) set(HAVE_GMTIME_R 0) set(HAVE_GETHOSTBYNAME_R 0) - set(HAVE_SIGNAL_FUNC 1) - set(HAVE_SIGNAL_MACRO 0) + set(HAVE_SIGNAL 1) set(HAVE_GETHOSTBYNAME_R_3 0) set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0) diff --git a/CMakeLists.txt b/CMakeLists.txt index 70ef457cf4..e1704e34ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1039,11 +1039,7 @@ check_symbol_exists(gmtime_r "${CURL_INCLUDES}" HAVE_GMTIME_R) check_symbol_exists(gethostbyname_r "${CURL_INCLUDES}" HAVE_GETHOSTBYNAME_R) -check_symbol_exists(signal "${CURL_INCLUDES}" HAVE_SIGNAL_FUNC) -check_symbol_exists(SIGALRM "${CURL_INCLUDES}" HAVE_SIGNAL_MACRO) -if(HAVE_SIGNAL_FUNC AND HAVE_SIGNAL_MACRO) - set(HAVE_SIGNAL 1) -endif() +check_symbol_exists(signal "${CURL_INCLUDES}" HAVE_SIGNAL) check_symbol_exists(strtoll "${CURL_INCLUDES}" HAVE_STRTOLL) check_symbol_exists(_strtoi64 "${CURL_INCLUDES}" HAVE__STRTOI64) check_symbol_exists(strerror_r "${CURL_INCLUDES}" HAVE_STRERROR_R)