summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/CMake
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmcurl/CMake')
-rw-r--r--Utilities/cmcurl/CMake/CurlSymbolHiding.cmake6
-rw-r--r--Utilities/cmcurl/CMake/CurlTests.c17
-rw-r--r--Utilities/cmcurl/CMake/FindNGTCP2.cmake6
-rw-r--r--Utilities/cmcurl/CMake/OtherTests.cmake92
-rw-r--r--Utilities/cmcurl/CMake/Platforms/WindowsCache.cmake20
5 files changed, 112 insertions, 29 deletions
diff --git a/Utilities/cmcurl/CMake/CurlSymbolHiding.cmake b/Utilities/cmcurl/CMake/CurlSymbolHiding.cmake
index 142e919..8289b49 100644
--- a/Utilities/cmcurl/CMake/CurlSymbolHiding.cmake
+++ b/Utilities/cmcurl/CMake/CurlSymbolHiding.cmake
@@ -26,6 +26,12 @@ include(CheckCSourceCompiles)
option(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON)
mark_as_advanced(CURL_HIDDEN_SYMBOLS)
+if(WIN32 AND ENABLE_CURLDEBUG)
+ # We need to export internal debug functions (e.g. curl_dbg_*), so disable
+ # symbol hiding for debug builds.
+ set(CURL_HIDDEN_SYMBOLS OFF)
+endif()
+
if(CURL_HIDDEN_SYMBOLS)
set(SUPPORTS_SYMBOL_HIDING FALSE)
diff --git a/Utilities/cmcurl/CMake/CurlTests.c b/Utilities/cmcurl/CMake/CurlTests.c
index 38be522..ea80ec8 100644
--- a/Utilities/cmcurl/CMake/CurlTests.c
+++ b/Utilities/cmcurl/CMake/CurlTests.c
@@ -21,23 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#ifdef TIME_WITH_SYS_TIME
-/* Time with sys/time test */
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-
-int
-main ()
-{
-if ((struct tm *) 0)
-return 0;
- ;
- return 0;
-}
-
-#endif
#ifdef HAVE_FCNTL_O_NONBLOCK
diff --git a/Utilities/cmcurl/CMake/FindNGTCP2.cmake b/Utilities/cmcurl/CMake/FindNGTCP2.cmake
index ae92e41..7ea4665 100644
--- a/Utilities/cmcurl/CMake/FindNGTCP2.cmake
+++ b/Utilities/cmcurl/CMake/FindNGTCP2.cmake
@@ -31,8 +31,10 @@ Find the ngtcp2 library
This module accepts optional COMPONENTS to control the crypto library (these are
mutually exclusive)::
- OpenSSL: Use libngtcp2_crypto_quictls
- GnuTLS: Use libngtcp2_crypto_gnutls
+ quictls, LibreSSL: Use libngtcp2_crypto_quictls
+ BoringSSL, AWS-LC: Use libngtcp2_crypto_boringssl
+ wolfSSL: Use libngtcp2_crypto_wolfssl
+ GnuTLS: Use libngtcp2_crypto_gnutls
Result Variables
^^^^^^^^^^^^^^^^
diff --git a/Utilities/cmcurl/CMake/OtherTests.cmake b/Utilities/cmcurl/CMake/OtherTests.cmake
index 762e6d1..d67a905 100644
--- a/Utilities/cmcurl/CMake/OtherTests.cmake
+++ b/Utilities/cmcurl/CMake/OtherTests.cmake
@@ -22,6 +22,8 @@
#
###########################################################################
include(CheckCSourceCompiles)
+include(CheckCSourceRuns)
+
# The begin of the sources (macros and includes)
set(_source_epilogue "#undef inline")
@@ -57,10 +59,9 @@ check_c_source_compiles("${_source_epilogue}
if(NOT HAVE_WINDOWS_H)
add_header_include(HAVE_SYS_TIME_H "sys/time.h")
- add_header_include(TIME_WITH_SYS_TIME "time.h")
- add_header_include(HAVE_TIME_H "time.h")
endif()
check_c_source_compiles("${_source_epilogue}
+#include <time.h>
int main(void) {
struct timeval ts;
ts.tv_sec = 0;
@@ -90,7 +91,6 @@ if(NOT CMAKE_CROSSCOMPILING)
# only try this on non-apple platforms
# if not cross-compilation...
- include(CheckCSourceRuns)
set(CMAKE_REQUIRED_FLAGS "")
if(HAVE_SYS_POLL_H)
set(CMAKE_REQUIRED_FLAGS "-DHAVE_SYS_POLL_H")
@@ -133,3 +133,89 @@ if(NOT CMAKE_CROSSCOMPILING)
}" HAVE_POLL_FINE)
endif()
endif()
+
+# Detect HAVE_GETADDRINFO_THREADSAFE
+
+if(WIN32)
+ set(HAVE_GETADDRINFO_THREADSAFE ${HAVE_GETADDRINFO})
+elseif(NOT HAVE_GETADDRINFO)
+ set(HAVE_GETADDRINFO_THREADSAFE FALSE)
+elseif(CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
+ CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR
+ CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
+ CMAKE_SYSTEM_NAME STREQUAL "HP-UX" OR
+ CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR
+ CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
+ CMAKE_SYSTEM_NAME STREQUAL "SunOS")
+ set(HAVE_GETADDRINFO_THREADSAFE TRUE)
+elseif(CMAKE_SYSTEM_NAME MATCHES "BSD")
+ set(HAVE_GETADDRINFO_THREADSAFE FALSE)
+endif()
+
+if(NOT DEFINED HAVE_GETADDRINFO_THREADSAFE)
+
+ set(_save_epilogue "${_source_epilogue}")
+ set(_source_epilogue "#undef inline")
+
+ add_header_include(HAVE_SYS_SOCKET_H "sys/socket.h")
+ add_header_include(HAVE_SYS_TIME_H "sys/time.h")
+ add_header_include(HAVE_NETDB_H "netdb.h")
+
+ check_c_source_compiles("${_source_epilogue}
+ int main(void)
+ {
+ #ifdef h_errno
+ return 0;
+ #else
+ force compilation error
+ #endif
+ }" HAVE_H_ERRNO)
+
+ if(NOT HAVE_H_ERRNO)
+ check_c_source_runs("${_source_epilogue}
+ int main(void)
+ {
+ h_errno = 2;
+ return h_errno != 0 ? 1 : 0;
+ }" HAVE_H_ERRNO_ASSIGNABLE)
+
+ if(NOT HAVE_H_ERRNO_ASSIGNABLE)
+ check_c_source_compiles("${_source_epilogue}
+ int main(void)
+ {
+ #if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
+ return 0;
+ #elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700)
+ return 0;
+ #else
+ force compilation error
+ #endif
+ }" HAVE_H_ERRNO_SBS_ISSUE_7)
+ endif()
+ endif()
+
+ if(HAVE_H_ERRNO OR HAVE_H_ERRNO_ASSIGNABLE OR HAVE_H_ERRNO_SBS_ISSUE_7)
+ set(HAVE_GETADDRINFO_THREADSAFE TRUE)
+ endif()
+
+ set(_source_epilogue "${_save_epilogue}")
+endif()
+
+if(NOT DEFINED HAVE_CLOCK_GETTIME_MONOTONIC_RAW)
+ set(_save_epilogue "${_source_epilogue}")
+ set(_source_epilogue "#undef inline")
+
+ add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
+ add_header_include(HAVE_SYS_TIME_H "sys/time.h")
+
+ check_c_source_compiles("${_source_epilogue}
+ #include <time.h>
+ int main(void)
+ {
+ struct timespec ts;
+ (void)clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
+ return 0;
+ }" HAVE_CLOCK_GETTIME_MONOTONIC_RAW)
+
+ set(_source_epilogue "${_save_epilogue}")
+endif()
diff --git a/Utilities/cmcurl/CMake/Platforms/WindowsCache.cmake b/Utilities/cmcurl/CMake/Platforms/WindowsCache.cmake
index 44a1fc9..5daec0e 100644
--- a/Utilities/cmcurl/CMake/Platforms/WindowsCache.cmake
+++ b/Utilities/cmcurl/CMake/Platforms/WindowsCache.cmake
@@ -33,6 +33,7 @@ if(NOT UNIX)
set(HAVE_UNISTD_H 1)
set(HAVE_INTTYPES_H 1)
set(HAVE_STRTOLL 1)
+ set(HAVE_BASENAME 1)
elseif(MSVC)
if(NOT MSVC_VERSION LESS 1800)
set(HAVE_INTTYPES_H 1)
@@ -46,30 +47,32 @@ if(NOT UNIX)
else()
set(HAVE_SNPRINTF 0)
endif()
+ set(HAVE_BASENAME 0)
endif()
set(HAVE_LIBSOCKET 0)
set(HAVE_GETHOSTNAME 1)
set(HAVE_LIBZ 0)
+ set(HAVE_ARC4RANDOM 0)
+ set(HAVE_FNMATCH 0)
+ set(HAVE_SCHED_YIELD 0)
set(HAVE_ARPA_INET_H 0)
- set(HAVE_ARPA_TFTP_H 0)
set(HAVE_FCNTL_H 1)
set(HAVE_IFADDRS_H 0)
set(HAVE_IO_H 1)
set(HAVE_NETDB_H 0)
set(HAVE_NETINET_IN_H 0)
set(HAVE_NETINET_TCP_H 0)
+ set(HAVE_NETINET_UDP_H 0)
set(HAVE_NET_IF_H 0)
set(HAVE_IOCTL_SIOCGIFADDR 0)
set(HAVE_POLL_H 0)
+ set(HAVE_POLL_FINE 0)
set(HAVE_PWD_H 0)
- set(HAVE_SETJMP_H 1)
- set(HAVE_SIGNAL_H 1)
- set(HAVE_STDLIB_H 1)
set(HAVE_STRINGS_H 0)
- set(HAVE_STRING_H 1)
set(HAVE_SYS_FILIO_H 0)
+ set(HAVE_SYS_WAIT_H 0)
set(HAVE_SYS_IOCTL_H 0)
set(HAVE_SYS_PARAM_H 0)
set(HAVE_SYS_POLL_H 0)
@@ -84,14 +87,16 @@ if(NOT UNIX)
set(HAVE_SYS_UTIME_H 1)
set(HAVE_TERMIOS_H 0)
set(HAVE_TERMIO_H 0)
- set(HAVE_TIME_H 1)
set(HAVE_UTIME_H 0)
+ set(HAVE_FSEEKO 0)
+ set(HAVE__FSEEKI64 1)
set(HAVE_SOCKET 1)
set(HAVE_SELECT 1)
set(HAVE_STRDUP 1)
set(HAVE_STRICMP 1)
set(HAVE_STRCMPI 1)
+ set(HAVE_MEMRCHR 0)
set(HAVE_GETTIMEOFDAY 0)
set(HAVE_CLOSESOCKET 1)
set(HAVE_SIGSETJMP 0)
@@ -101,11 +106,13 @@ if(NOT UNIX)
set(HAVE_GETEUID 0)
set(HAVE_UTIME 1)
set(HAVE_GMTIME_R 0)
+ set(HAVE_CLOCK_GETTIME_MONOTONIC_RAW 0)
set(HAVE_GETHOSTBYNAME_R 0)
set(HAVE_SIGNAL 1)
set(HAVE_LINUX_TCP_H 0)
set(HAVE_GLIBC_STRERROR_R 0)
set(HAVE_MACH_ABSOLUTE_TIME 0)
+ set(HAVE_GETIFADDRS 0)
set(HAVE_GETHOSTBYNAME_R_3 0)
set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
@@ -114,7 +121,6 @@ if(NOT UNIX)
set(HAVE_GETHOSTBYNAME_R_6 0)
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
- set(TIME_WITH_SYS_TIME 0)
set(HAVE_O_NONBLOCK 0)
set(HAVE_IN_ADDR_T 0)
set(STDC_HEADERS 1)