|
|
@@ -54,6 +54,7 @@ set(CURL_DISABLE_SHUFFLE_DNS OFF)
|
|
|
set(CURL_DISABLE_SMB OFF)
|
|
|
set(CURL_DISABLE_SMTP ON CACHE INTERNAL "Disable curl smtp protocol?")
|
|
|
set(CURL_DISABLE_SOCKETPAIR OFF)
|
|
|
+set(CURL_DISABLE_SRP OFF)
|
|
|
set(CURL_DISABLE_TELNET ON CACHE INTERNAL "Disable curl telnet protocol?")
|
|
|
set(CURL_DISABLE_TFTP ON CACHE INTERNAL "Disable curl tftp protocol?")
|
|
|
set(CURL_DISABLE_VERBOSE_STRINGS OFF CACHE INTERNAL "Do not disable curl verbosity")
|
|
|
@@ -203,9 +204,9 @@ endif()
|
|
|
# https://cmake.org/cmake/help/latest/module/FetchContent.html#integrating-with-find-package
|
|
|
#
|
|
|
# The following variables are available:
|
|
|
-# HAVE_SSL_SET0_WBIO: `SSL_set0_wbio` present in OpenSSL
|
|
|
-# HAVE_AWSLC: OpenSSL is AWS-LC
|
|
|
-# HAVE_BORINGSSL: OpenSSL is BoringSSL
|
|
|
+# HAVE_SSL_SET0_WBIO: `SSL_set0_wbio` present in OpenSSL/wolfSSL
|
|
|
+# HAVE_OPENSSL_SRP: `SSL_CTX_set_srp_username` present in OpenSSL/wolfSSL
|
|
|
+# HAVE_GNUTLS_SRP: `gnutls_srp_verifier` present in GnuTLS
|
|
|
# HAVE_SSL_CTX_SET_QUIC_METHOD: `SSL_CTX_set_quic_method` present in OpenSSL/wolfSSL
|
|
|
# HAVE_QUICHE_CONN_SET_QLOG_FD: `quiche_conn_set_qlog_fd` present in QUICHE
|
|
|
# HAVE_ZSTD_CREATEDSTREAM: `ZSTD_createDStream` present in Zstd
|
|
|
@@ -256,7 +257,7 @@ option(CURL_WERROR "Turn compiler warnings into errors" OFF)
|
|
|
option(PICKY_COMPILER "Enable picky compiler options" ON)
|
|
|
option(BUILD_CURL_EXE "Set to ON to build curl executable." ON)
|
|
|
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
|
|
|
-option(BUILD_STATIC_LIBS "Build shared libraries" OFF)
|
|
|
+option(BUILD_STATIC_LIBS "Build static libraries" OFF)
|
|
|
option(BUILD_STATIC_CURL "Build curl executable with static libcurl" OFF)
|
|
|
option(ENABLE_ARES "Set to ON to enable c-ares support" OFF)
|
|
|
if(WIN32)
|
|
|
@@ -351,6 +352,8 @@ mark_as_advanced(CURL_ENABLE_EXPORT_TARGET)
|
|
|
|
|
|
option(CURL_DISABLE_ALTSVC "disables alt-svc support" OFF)
|
|
|
mark_as_advanced(CURL_DISABLE_ALTSVC)
|
|
|
+option(CURL_DISABLE_SRP "disables TLS-SRP support" OFF)
|
|
|
+mark_as_advanced(CURL_DISABLE_SRP)
|
|
|
option(CURL_DISABLE_COOKIES "disables cookies support" OFF)
|
|
|
mark_as_advanced(CURL_DISABLE_COOKIES)
|
|
|
option(CURL_DISABLE_BASIC_AUTH "disables Basic authentication" OFF)
|
|
|
@@ -466,7 +469,7 @@ if(ENABLE_IPV6 AND NOT WIN32)
|
|
|
endif()
|
|
|
|
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT ENABLE_ARES)
|
|
|
- set(use_core_foundation ON)
|
|
|
+ set(use_core_foundation_and_core_services ON)
|
|
|
|
|
|
find_library(SYSTEMCONFIGURATION_FRAMEWORK "SystemConfiguration")
|
|
|
if(NOT SYSTEMCONFIGURATION_FRAMEWORK)
|
|
|
@@ -551,25 +554,16 @@ if(WIN32)
|
|
|
if(USE_LIBRTMP)
|
|
|
list(APPEND CURL_LIBS "winmm")
|
|
|
endif()
|
|
|
-
|
|
|
- # Matching logic used for Curl_win32_random()
|
|
|
- if(MINGW)
|
|
|
- check_c_source_compiles("
|
|
|
- #include <_mingw.h>
|
|
|
- #if defined(__MINGW64_VERSION_MAJOR)
|
|
|
- #error
|
|
|
- #endif
|
|
|
- int main(void) {
|
|
|
- return 0;
|
|
|
- }"
|
|
|
- HAVE_MINGW_ORIGINAL)
|
|
|
- endif()
|
|
|
endif()
|
|
|
|
|
|
if(0) # This code not needed for building within CMake.
|
|
|
# check SSL libraries
|
|
|
option(CURL_ENABLE_SSL "Enable SSL support" ON)
|
|
|
|
|
|
+if(CURL_DEFAULT_SSL_BACKEND)
|
|
|
+ set(valid_default_ssl_backend FALSE)
|
|
|
+endif()
|
|
|
+
|
|
|
if(APPLE)
|
|
|
cmake_dependent_option(CURL_USE_SECTRANSP "Enable Apple OS native SSL/TLS" OFF CURL_ENABLE_SSL OFF)
|
|
|
endif()
|
|
|
@@ -581,7 +575,7 @@ endif()
|
|
|
cmake_dependent_option(CURL_USE_MBEDTLS "Enable mbedTLS for SSL/TLS" OFF CURL_ENABLE_SSL OFF)
|
|
|
cmake_dependent_option(CURL_USE_BEARSSL "Enable BearSSL for SSL/TLS" OFF CURL_ENABLE_SSL OFF)
|
|
|
cmake_dependent_option(CURL_USE_WOLFSSL "Enable wolfSSL for SSL/TLS" OFF CURL_ENABLE_SSL OFF)
|
|
|
-cmake_dependent_option(CURL_USE_GNUTLS "Enable GNUTLS for SSL/TLS" OFF CURL_ENABLE_SSL OFF)
|
|
|
+cmake_dependent_option(CURL_USE_GNUTLS "Enable GnuTLS for SSL/TLS" OFF CURL_ENABLE_SSL OFF)
|
|
|
|
|
|
set(openssl_default ON)
|
|
|
if(WIN32 OR CURL_USE_SECTRANSP OR CURL_USE_SCHANNEL OR CURL_USE_MBEDTLS OR CURL_USE_WOLFSSL)
|
|
|
@@ -607,13 +601,17 @@ if(CURL_USE_SCHANNEL)
|
|
|
set(SSL_ENABLED ON)
|
|
|
set(USE_SCHANNEL ON) # Windows native SSL/TLS support
|
|
|
set(USE_WINDOWS_SSPI ON) # CURL_USE_SCHANNEL implies CURL_WINDOWS_SSPI
|
|
|
+
|
|
|
+ if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "schannel")
|
|
|
+ set(valid_default_ssl_backend TRUE)
|
|
|
+ endif()
|
|
|
endif()
|
|
|
if(CURL_WINDOWS_SSPI)
|
|
|
set(USE_WINDOWS_SSPI ON)
|
|
|
endif()
|
|
|
|
|
|
if(CURL_USE_SECTRANSP)
|
|
|
- set(use_core_foundation ON)
|
|
|
+ set(use_core_foundation_and_core_services ON)
|
|
|
|
|
|
find_library(SECURITY_FRAMEWORK "Security")
|
|
|
if(NOT SECURITY_FRAMEWORK)
|
|
|
@@ -623,15 +621,24 @@ if(CURL_USE_SECTRANSP)
|
|
|
set(SSL_ENABLED ON)
|
|
|
set(USE_SECTRANSP ON)
|
|
|
list(APPEND CURL_LIBS "-framework Security")
|
|
|
+
|
|
|
+ if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "secure-transport")
|
|
|
+ set(valid_default_ssl_backend TRUE)
|
|
|
+ endif()
|
|
|
endif()
|
|
|
|
|
|
-if(use_core_foundation)
|
|
|
+if(use_core_foundation_and_core_services)
|
|
|
find_library(COREFOUNDATION_FRAMEWORK "CoreFoundation")
|
|
|
+ find_library(CORESERVICES_FRAMEWORK "CoreServices")
|
|
|
+
|
|
|
if(NOT COREFOUNDATION_FRAMEWORK)
|
|
|
message(FATAL_ERROR "CoreFoundation framework not found")
|
|
|
endif()
|
|
|
+ if(NOT CORESERVICES_FRAMEWORK)
|
|
|
+ message(FATAL_ERROR "CoreServices framework not found")
|
|
|
+ endif()
|
|
|
|
|
|
- list(APPEND CURL_LIBS "-framework CoreFoundation")
|
|
|
+ list(APPEND CURL_LIBS "-framework CoreFoundation -framework CoreServices")
|
|
|
endif()
|
|
|
|
|
|
if(CURL_USE_OPENSSL)
|
|
|
@@ -648,9 +655,11 @@ if(CURL_USE_OPENSSL)
|
|
|
|
|
|
if(WIN32)
|
|
|
list(APPEND CURL_LIBS "ws2_32")
|
|
|
- if(NOT HAVE_MINGW_ORIGINAL)
|
|
|
- list(APPEND CURL_LIBS "bcrypt") # for OpenSSL/LibreSSL
|
|
|
- endif()
|
|
|
+ list(APPEND CURL_LIBS "bcrypt") # for OpenSSL/LibreSSL
|
|
|
+ endif()
|
|
|
+
|
|
|
+ if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "openssl")
|
|
|
+ set(valid_default_ssl_backend TRUE)
|
|
|
endif()
|
|
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
|
|
@@ -677,6 +686,10 @@ if(CURL_USE_MBEDTLS)
|
|
|
set(USE_MBEDTLS ON)
|
|
|
list(APPEND CURL_LIBS ${MBEDTLS_LIBRARIES})
|
|
|
include_directories(${MBEDTLS_INCLUDE_DIRS})
|
|
|
+
|
|
|
+ if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "mbedtls")
|
|
|
+ set(valid_default_ssl_backend TRUE)
|
|
|
+ endif()
|
|
|
endif()
|
|
|
|
|
|
if(CURL_USE_BEARSSL)
|
|
|
@@ -685,6 +698,10 @@ if(CURL_USE_BEARSSL)
|
|
|
set(USE_BEARSSL ON)
|
|
|
list(APPEND CURL_LIBS ${BEARSSL_LIBRARY})
|
|
|
include_directories(${BEARSSL_INCLUDE_DIRS})
|
|
|
+
|
|
|
+ if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "bearssl")
|
|
|
+ set(valid_default_ssl_backend TRUE)
|
|
|
+ endif()
|
|
|
endif()
|
|
|
|
|
|
if(CURL_USE_WOLFSSL)
|
|
|
@@ -693,11 +710,34 @@ if(CURL_USE_WOLFSSL)
|
|
|
set(USE_WOLFSSL ON)
|
|
|
list(APPEND CURL_LIBS ${WolfSSL_LIBRARIES})
|
|
|
include_directories(${WolfSSL_INCLUDE_DIRS})
|
|
|
+
|
|
|
+ if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "wolfssl")
|
|
|
+ set(valid_default_ssl_backend TRUE)
|
|
|
+ endif()
|
|
|
endif()
|
|
|
|
|
|
if(CURL_USE_GNUTLS)
|
|
|
- set(SSL_ENABLED ON)
|
|
|
- set(USE_GNUTLS ON)
|
|
|
+ find_package(GnuTLS REQUIRED)
|
|
|
+ set(SSL_ENABLED ON)
|
|
|
+ set(USE_GNUTLS ON)
|
|
|
+ list(APPEND CURL_LIBS ${GNUTLS_LIBRARIES} "nettle")
|
|
|
+ include_directories(${GNUTLS_INCLUDE_DIRS})
|
|
|
+
|
|
|
+ if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "gnutls")
|
|
|
+ set(valid_default_ssl_backend TRUE)
|
|
|
+ endif()
|
|
|
+
|
|
|
+ if(NOT DEFINED HAVE_GNUTLS_SRP AND NOT CURL_DISABLE_SRP)
|
|
|
+ cmake_push_check_state()
|
|
|
+ set(CMAKE_REQUIRED_INCLUDES ${GNUTLS_INCLUDE_DIRS})
|
|
|
+ set(CMAKE_REQUIRED_LIBRARIES ${GNUTLS_LIBRARIES})
|
|
|
+ check_symbol_exists(gnutls_srp_verifier "gnutls/gnutls.h" HAVE_GNUTLS_SRP)
|
|
|
+ cmake_pop_check_state()
|
|
|
+ endif()
|
|
|
+endif()
|
|
|
+
|
|
|
+if(CURL_DEFAULT_SSL_BACKEND AND NOT valid_default_ssl_backend)
|
|
|
+ message(FATAL_ERROR "CURL_DEFAULT_SSL_BACKEND '${CURL_DEFAULT_SSL_BACKEND}' not enabled.")
|
|
|
endif()
|
|
|
|
|
|
# Keep ZLIB detection after TLS detection,
|
|
|
@@ -743,7 +783,7 @@ option(CURL_ZSTD "Set to ON to enable building curl with zstd support." OFF)
|
|
|
set(HAVE_ZSTD OFF)
|
|
|
if(CURL_ZSTD)
|
|
|
find_package(Zstd REQUIRED)
|
|
|
- if (NOT DEFINED HAVE_ZSTD_CREATEDSTREAM)
|
|
|
+ if(NOT DEFINED HAVE_ZSTD_CREATEDSTREAM)
|
|
|
cmake_push_check_state()
|
|
|
set(CMAKE_REQUIRED_INCLUDES ${Zstd_INCLUDE_DIRS})
|
|
|
set(CMAKE_REQUIRED_LIBRARIES ${Zstd_LIBRARIES})
|
|
|
@@ -768,9 +808,7 @@ macro(openssl_check_symbol_exists SYMBOL FILES VARIABLE)
|
|
|
endif()
|
|
|
if(WIN32)
|
|
|
list(APPEND CMAKE_REQUIRED_LIBRARIES "ws2_32")
|
|
|
- if(NOT HAVE_MINGW_ORIGINAL)
|
|
|
- list(APPEND CMAKE_REQUIRED_LIBRARIES "bcrypt") # for OpenSSL/LibreSSL
|
|
|
- endif()
|
|
|
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "bcrypt") # for OpenSSL/LibreSSL
|
|
|
endif()
|
|
|
elseif(USE_WOLFSSL)
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${WolfSSL_INCLUDE_DIRS}")
|
|
|
@@ -792,6 +830,9 @@ if(USE_OPENSSL OR USE_WOLFSSL)
|
|
|
if(NOT DEFINED HAVE_SSL_SET0_WBIO)
|
|
|
openssl_check_symbol_exists(SSL_set0_wbio "openssl/ssl.h" HAVE_SSL_SET0_WBIO)
|
|
|
endif()
|
|
|
+ if(NOT DEFINED HAVE_OPENSSL_SRP AND NOT CURL_DISABLE_SRP)
|
|
|
+ openssl_check_symbol_exists(SSL_CTX_set_srp_username "openssl/ssl.h" HAVE_OPENSSL_SRP)
|
|
|
+ endif()
|
|
|
endif()
|
|
|
|
|
|
option(USE_NGHTTP2 "Use nghttp2 library" OFF)
|
|
|
@@ -806,7 +847,7 @@ if(USE_NGTCP2)
|
|
|
if(USE_OPENSSL OR USE_WOLFSSL)
|
|
|
if(USE_WOLFSSL)
|
|
|
find_package(NGTCP2 REQUIRED wolfSSL)
|
|
|
- elseif(HAVE_BORINGSSL)
|
|
|
+ elseif(HAVE_BORINGSSL OR HAVE_AWSLC)
|
|
|
find_package(NGTCP2 REQUIRED BoringSSL)
|
|
|
else()
|
|
|
find_package(NGTCP2 REQUIRED quictls)
|
|
|
@@ -823,9 +864,7 @@ if(USE_NGTCP2)
|
|
|
if(NOT HAVE_SSL_CTX_SET_QUIC_METHOD)
|
|
|
message(FATAL_ERROR "QUIC support is missing in OpenSSL/LibreSSL/BoringSSL/wolfSSL. Try setting -DOPENSSL_ROOT_DIR")
|
|
|
endif()
|
|
|
-
|
|
|
elseif(USE_GNUTLS)
|
|
|
- # TODO add GnuTLS support as vtls library.
|
|
|
find_package(NGTCP2 REQUIRED GnuTLS)
|
|
|
else()
|
|
|
message(FATAL_ERROR "ngtcp2 requires OpenSSL, wolfSSL or GnuTLS")
|
|
|
@@ -869,6 +908,10 @@ if(USE_MSH3)
|
|
|
list(APPEND CURL_LIBS ${MSH3_LIBRARIES})
|
|
|
endif()
|
|
|
|
|
|
+if(NOT CURL_DISABLE_SRP AND (HAVE_GNUTLS_SRP OR HAVE_OPENSSL_SRP))
|
|
|
+ set(USE_TLS_SRP 1)
|
|
|
+endif()
|
|
|
+
|
|
|
if(NOT CURL_DISABLE_LDAP)
|
|
|
if(WIN32)
|
|
|
option(USE_WIN32_LDAP "Use Windows LDAP implementation" ON)
|
|
|
@@ -880,15 +923,9 @@ if(NOT CURL_DISABLE_LDAP)
|
|
|
endif()
|
|
|
endif()
|
|
|
|
|
|
- option(CURL_USE_OPENLDAP "Use OpenLDAP code." OFF)
|
|
|
- mark_as_advanced(CURL_USE_OPENLDAP)
|
|
|
set(CMAKE_LDAP_LIB "ldap" CACHE STRING "Name or full path to ldap library")
|
|
|
set(CMAKE_LBER_LIB "lber" CACHE STRING "Name or full path to lber library")
|
|
|
|
|
|
- if(CURL_USE_OPENLDAP AND USE_WIN32_LDAP)
|
|
|
- message(FATAL_ERROR "Cannot use USE_WIN32_LDAP and CURL_USE_OPENLDAP at the same time")
|
|
|
- endif()
|
|
|
-
|
|
|
# Now that we know, we're not using windows LDAP...
|
|
|
if(NOT USE_WIN32_LDAP)
|
|
|
# Check for LDAP
|
|
|
@@ -913,9 +950,6 @@ if(NOT CURL_DISABLE_LDAP)
|
|
|
set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
|
|
|
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_BAK}) #LDAP includes won't be used
|
|
|
else()
|
|
|
- if(CURL_USE_OPENLDAP)
|
|
|
- set(USE_OPENLDAP ON)
|
|
|
- endif()
|
|
|
if(CMAKE_LDAP_INCLUDE_DIR)
|
|
|
include_directories(${CMAKE_LDAP_INCLUDE_DIR})
|
|
|
endif()
|
|
|
@@ -929,13 +963,18 @@ if(NOT CURL_DISABLE_LDAP)
|
|
|
endif()
|
|
|
list(APPEND _HEADER_LIST "ldap.h")
|
|
|
|
|
|
- set(_SRC_STRING "")
|
|
|
+ set(_INCLUDE_STRING "")
|
|
|
foreach(_HEADER ${_HEADER_LIST})
|
|
|
set(_INCLUDE_STRING "${_INCLUDE_STRING}#include <${_HEADER}>\n")
|
|
|
endforeach()
|
|
|
|
|
|
- set(_SRC_STRING
|
|
|
- "
|
|
|
+ list(APPEND CMAKE_REQUIRED_DEFINITIONS -DLDAP_DEPRECATED=1)
|
|
|
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_LDAP_LIB})
|
|
|
+ if(HAVE_LIBLBER)
|
|
|
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_LBER_LIB})
|
|
|
+ endif()
|
|
|
+
|
|
|
+ check_c_source_compiles("
|
|
|
${_INCLUDE_STRING}
|
|
|
int main(int argc, char ** argv)
|
|
|
{
|
|
|
@@ -943,21 +982,27 @@ if(NOT CURL_DISABLE_LDAP)
|
|
|
BerElement *bep = ber_init(bvp);
|
|
|
ber_free(bep, 1);
|
|
|
return 0;
|
|
|
- }"
|
|
|
- )
|
|
|
- list(APPEND CMAKE_REQUIRED_DEFINITIONS -DLDAP_DEPRECATED=1)
|
|
|
- list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_LDAP_LIB})
|
|
|
- if(HAVE_LIBLBER)
|
|
|
- list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_LBER_LIB})
|
|
|
- endif()
|
|
|
- check_c_source_compiles("${_SRC_STRING}" NOT_NEED_LBER_H)
|
|
|
- unset(CMAKE_REQUIRED_LIBRARIES)
|
|
|
-
|
|
|
+ }" NOT_NEED_LBER_H)
|
|
|
if(NOT_NEED_LBER_H)
|
|
|
set(NEED_LBER_H OFF)
|
|
|
else()
|
|
|
set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -DNEED_LBER_H")
|
|
|
endif()
|
|
|
+
|
|
|
+ check_function_exists(ldap_url_parse HAVE_LDAP_URL_PARSE)
|
|
|
+ check_function_exists(ldap_init_fd HAVE_LDAP_INIT_FD)
|
|
|
+
|
|
|
+ unset(CMAKE_REQUIRED_LIBRARIES)
|
|
|
+
|
|
|
+ check_include_file("ldap_ssl.h" HAVE_LDAP_SSL_H)
|
|
|
+
|
|
|
+ if(HAVE_LDAP_INIT_FD)
|
|
|
+ set(USE_OPENLDAP ON)
|
|
|
+ add_definitions("-DLDAP_DEPRECATED=1")
|
|
|
+ endif()
|
|
|
+ if(NOT CURL_DISABLE_LDAPS)
|
|
|
+ set(HAVE_LDAP_SSL ON)
|
|
|
+ endif()
|
|
|
endif()
|
|
|
endif()
|
|
|
endif()
|
|
|
@@ -970,10 +1015,6 @@ if(CURL_DISABLE_LDAP)
|
|
|
endif()
|
|
|
endif()
|
|
|
|
|
|
-if(NOT CURL_DISABLE_LDAPS)
|
|
|
- check_include_file_concat("ldap_ssl.h" HAVE_LDAP_SSL_H)
|
|
|
-endif()
|
|
|
-
|
|
|
# Check for idn2
|
|
|
option(USE_LIBIDN2 "Use libidn2 for IDN support" ON)
|
|
|
if(USE_LIBIDN2)
|
|
|
@@ -1180,9 +1221,13 @@ elseif(CURL_CA_PATH_AUTODETECT OR CURL_CA_BUNDLE_AUTODETECT)
|
|
|
endif()
|
|
|
endif()
|
|
|
|
|
|
-if(CURL_CA_PATH_SET AND NOT USE_OPENSSL AND NOT USE_MBEDTLS)
|
|
|
+if(CURL_CA_PATH_SET AND
|
|
|
+ NOT USE_OPENSSL AND
|
|
|
+ NOT USE_WOLFSSL AND
|
|
|
+ NOT USE_GNUTLS AND
|
|
|
+ NOT USE_MBEDTLS)
|
|
|
message(STATUS
|
|
|
- "CA path only supported by OpenSSL, GnuTLS or mbed TLS. "
|
|
|
+ "CA path only supported by OpenSSL, wolfSSL, GnuTLS or mbedTLS. "
|
|
|
"Set CURL_CA_PATH=none or enable one of those TLS backends.")
|
|
|
endif()
|
|
|
endif()
|
|
|
@@ -1200,6 +1245,7 @@ endif()
|
|
|
|
|
|
check_include_file_concat("inttypes.h" HAVE_INTTYPES_H)
|
|
|
check_include_file_concat("sys/filio.h" HAVE_SYS_FILIO_H)
|
|
|
+check_include_file_concat("sys/wait.h" HAVE_SYS_WAIT_H)
|
|
|
check_include_file_concat("sys/ioctl.h" HAVE_SYS_IOCTL_H)
|
|
|
check_include_file_concat("sys/param.h" HAVE_SYS_PARAM_H)
|
|
|
check_include_file_concat("sys/poll.h" HAVE_SYS_POLL_H)
|
|
|
@@ -1214,7 +1260,6 @@ check_include_file_concat("sys/un.h" HAVE_SYS_UN_H)
|
|
|
check_include_file_concat("sys/utime.h" HAVE_SYS_UTIME_H)
|
|
|
check_include_file_concat("sys/xattr.h" HAVE_SYS_XATTR_H)
|
|
|
check_include_file_concat("arpa/inet.h" HAVE_ARPA_INET_H)
|
|
|
-check_include_file_concat("arpa/tftp.h" HAVE_ARPA_TFTP_H)
|
|
|
check_include_file_concat("fcntl.h" HAVE_FCNTL_H)
|
|
|
check_include_file_concat("idn2.h" HAVE_IDN2_H)
|
|
|
check_include_file_concat("ifaddrs.h" HAVE_IFADDRS_H)
|
|
|
@@ -1225,30 +1270,29 @@ check_include_file_concat("net/if.h" HAVE_NET_IF_H)
|
|
|
check_include_file_concat("netdb.h" HAVE_NETDB_H)
|
|
|
check_include_file_concat("netinet/in.h" HAVE_NETINET_IN_H)
|
|
|
check_include_file_concat("netinet/tcp.h" HAVE_NETINET_TCP_H)
|
|
|
+check_include_file_concat("netinet/udp.h" HAVE_NETINET_UDP_H)
|
|
|
check_include_file("linux/tcp.h" HAVE_LINUX_TCP_H)
|
|
|
|
|
|
check_include_file_concat("poll.h" HAVE_POLL_H)
|
|
|
check_include_file_concat("pwd.h" HAVE_PWD_H)
|
|
|
-check_include_file_concat("setjmp.h" HAVE_SETJMP_H)
|
|
|
-check_include_file_concat("signal.h" HAVE_SIGNAL_H)
|
|
|
check_include_file_concat("stdatomic.h" HAVE_STDATOMIC_H)
|
|
|
check_include_file_concat("stdbool.h" HAVE_STDBOOL_H)
|
|
|
check_include_file_concat("stdint.h" HAVE_STDINT_H)
|
|
|
-check_include_file_concat("stdlib.h" HAVE_STDLIB_H)
|
|
|
-check_include_file_concat("string.h" HAVE_STRING_H)
|
|
|
check_include_file_concat("strings.h" HAVE_STRINGS_H)
|
|
|
check_include_file_concat("stropts.h" HAVE_STROPTS_H)
|
|
|
check_include_file_concat("termio.h" HAVE_TERMIO_H)
|
|
|
check_include_file_concat("termios.h" HAVE_TERMIOS_H)
|
|
|
-check_include_file_concat("time.h" HAVE_TIME_H)
|
|
|
check_include_file_concat("unistd.h" HAVE_UNISTD_H)
|
|
|
check_include_file_concat("utime.h" HAVE_UTIME_H)
|
|
|
|
|
|
-check_include_file_concat("stddef.h" HAVE_STDDEF_H)
|
|
|
-
|
|
|
check_type_size(size_t SIZEOF_SIZE_T)
|
|
|
check_type_size(ssize_t SIZEOF_SSIZE_T)
|
|
|
check_type_size("time_t" SIZEOF_TIME_T)
|
|
|
+check_type_size("suseconds_t" SIZEOF_SUSECONDS_T)
|
|
|
+
|
|
|
+if(SIZEOF_SUSECONDS_T)
|
|
|
+ set(HAVE_SUSECONDS_T 1)
|
|
|
+endif()
|
|
|
|
|
|
if(NOT CMAKE_CROSSCOMPILING)
|
|
|
find_file(RANDOM_FILE urandom /dev)
|
|
|
@@ -1265,45 +1309,50 @@ elseif(HAVE_LIBNETWORK)
|
|
|
endif()
|
|
|
|
|
|
check_symbol_exists(fchmod "${CURL_INCLUDES}" HAVE_FCHMOD)
|
|
|
-check_symbol_exists(basename "${CURL_INCLUDES}" HAVE_BASENAME)
|
|
|
+check_symbol_exists(fnmatch "${CURL_INCLUDES};fnmatch.h" HAVE_FNMATCH)
|
|
|
+check_symbol_exists(basename "${CURL_INCLUDES};string.h" HAVE_BASENAME)
|
|
|
check_symbol_exists(socket "${CURL_INCLUDES}" HAVE_SOCKET)
|
|
|
+check_symbol_exists(sched_yield "${CURL_INCLUDES};sched.h" HAVE_SCHED_YIELD)
|
|
|
check_symbol_exists(socketpair "${CURL_INCLUDES}" HAVE_SOCKETPAIR)
|
|
|
check_symbol_exists(recv "${CURL_INCLUDES}" HAVE_RECV)
|
|
|
check_symbol_exists(send "${CURL_INCLUDES}" HAVE_SEND)
|
|
|
check_symbol_exists(sendmsg "${CURL_INCLUDES}" HAVE_SENDMSG)
|
|
|
check_symbol_exists(select "${CURL_INCLUDES}" HAVE_SELECT)
|
|
|
-check_symbol_exists(strdup "${CURL_INCLUDES}" HAVE_STRDUP)
|
|
|
-check_symbol_exists(strtok_r "${CURL_INCLUDES}" HAVE_STRTOK_R)
|
|
|
-check_symbol_exists(strcasecmp "${CURL_INCLUDES}" HAVE_STRCASECMP)
|
|
|
-check_symbol_exists(stricmp "${CURL_INCLUDES}" HAVE_STRICMP)
|
|
|
-check_symbol_exists(strcmpi "${CURL_INCLUDES}" HAVE_STRCMPI)
|
|
|
+check_symbol_exists(strdup "${CURL_INCLUDES};string.h" HAVE_STRDUP)
|
|
|
+check_symbol_exists(strtok_r "${CURL_INCLUDES};string.h" HAVE_STRTOK_R)
|
|
|
+check_symbol_exists(strcasecmp "${CURL_INCLUDES};string.h" HAVE_STRCASECMP)
|
|
|
+check_symbol_exists(stricmp "${CURL_INCLUDES};string.h" HAVE_STRICMP)
|
|
|
+check_symbol_exists(strcmpi "${CURL_INCLUDES};string.h" HAVE_STRCMPI)
|
|
|
+check_symbol_exists(memrchr "${CURL_INCLUDES};string.h" HAVE_MEMRCHR)
|
|
|
check_symbol_exists(alarm "${CURL_INCLUDES}" HAVE_ALARM)
|
|
|
+check_symbol_exists(arc4random "${CURL_INCLUDES};stdlib.h" HAVE_ARC4RANDOM)
|
|
|
+check_symbol_exists(fcntl "${CURL_INCLUDES}" HAVE_FCNTL)
|
|
|
check_symbol_exists(getppid "${CURL_INCLUDES}" HAVE_GETPPID)
|
|
|
check_symbol_exists(utimes "${CURL_INCLUDES}" HAVE_UTIMES)
|
|
|
|
|
|
check_symbol_exists(gettimeofday "${CURL_INCLUDES}" HAVE_GETTIMEOFDAY)
|
|
|
check_symbol_exists(closesocket "${CURL_INCLUDES}" HAVE_CLOSESOCKET)
|
|
|
-check_symbol_exists(sigsetjmp "${CURL_INCLUDES}" HAVE_SIGSETJMP)
|
|
|
+check_symbol_exists(sigsetjmp "${CURL_INCLUDES};setjmp.h" HAVE_SIGSETJMP)
|
|
|
check_symbol_exists(getpass_r "${CURL_INCLUDES}" HAVE_GETPASS_R)
|
|
|
check_symbol_exists(getpwuid "${CURL_INCLUDES}" HAVE_GETPWUID)
|
|
|
check_symbol_exists(getpwuid_r "${CURL_INCLUDES}" HAVE_GETPWUID_R)
|
|
|
check_symbol_exists(geteuid "${CURL_INCLUDES}" HAVE_GETEUID)
|
|
|
check_symbol_exists(utime "${CURL_INCLUDES}" HAVE_UTIME)
|
|
|
-check_symbol_exists(gmtime_r "${CURL_INCLUDES}" HAVE_GMTIME_R)
|
|
|
+check_symbol_exists(gmtime_r "${CURL_INCLUDES};stdlib.h;time.h" HAVE_GMTIME_R)
|
|
|
|
|
|
check_symbol_exists(gethostbyname_r "${CURL_INCLUDES}" HAVE_GETHOSTBYNAME_R)
|
|
|
|
|
|
-check_symbol_exists(signal "${CURL_INCLUDES}" HAVE_SIGNAL)
|
|
|
-check_symbol_exists(strtoll "${CURL_INCLUDES}" HAVE_STRTOLL)
|
|
|
-check_symbol_exists(strerror_r "${CURL_INCLUDES}" HAVE_STRERROR_R)
|
|
|
-check_symbol_exists(siginterrupt "${CURL_INCLUDES}" HAVE_SIGINTERRUPT)
|
|
|
-check_symbol_exists(getaddrinfo "${CURL_INCLUDES}" HAVE_GETADDRINFO)
|
|
|
-if(WIN32)
|
|
|
- set(HAVE_GETADDRINFO_THREADSAFE ${HAVE_GETADDRINFO})
|
|
|
-endif()
|
|
|
+check_symbol_exists(signal "${CURL_INCLUDES};signal.h" HAVE_SIGNAL)
|
|
|
+check_symbol_exists(strtoll "${CURL_INCLUDES};stdlib.h" HAVE_STRTOLL)
|
|
|
+check_symbol_exists(strerror_r "${CURL_INCLUDES};stdlib.h;string.h" HAVE_STRERROR_R)
|
|
|
+check_symbol_exists(siginterrupt "${CURL_INCLUDES};signal.h" HAVE_SIGINTERRUPT)
|
|
|
+check_symbol_exists(getaddrinfo "${CURL_INCLUDES};stdlib.h;string.h" HAVE_GETADDRINFO)
|
|
|
+check_symbol_exists(getifaddrs "${CURL_INCLUDES};stdlib.h" HAVE_GETIFADDRS)
|
|
|
check_symbol_exists(freeaddrinfo "${CURL_INCLUDES}" HAVE_FREEADDRINFO)
|
|
|
check_symbol_exists(pipe "${CURL_INCLUDES}" HAVE_PIPE)
|
|
|
check_symbol_exists(ftruncate "${CURL_INCLUDES}" HAVE_FTRUNCATE)
|
|
|
+check_symbol_exists(fseeko "${CURL_INCLUDES};stdio.h" HAVE_FSEEKO)
|
|
|
+check_symbol_exists(_fseeki64 "${CURL_INCLUDES};stdio.h" HAVE__FSEEKI64)
|
|
|
check_symbol_exists(getpeername "${CURL_INCLUDES}" HAVE_GETPEERNAME)
|
|
|
check_symbol_exists(getsockname "${CURL_INCLUDES}" HAVE_GETSOCKNAME)
|
|
|
check_symbol_exists(if_nametoindex "${CURL_INCLUDES}" HAVE_IF_NAMETOINDEX)
|
|
|
@@ -1317,11 +1366,11 @@ if(NOT MSVC OR (MSVC_VERSION GREATER_EQUAL 1900))
|
|
|
check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
|
|
|
endif()
|
|
|
check_function_exists(mach_absolute_time HAVE_MACH_ABSOLUTE_TIME)
|
|
|
-check_symbol_exists(inet_ntop "${CURL_INCLUDES}" HAVE_INET_NTOP)
|
|
|
+check_symbol_exists(inet_ntop "${CURL_INCLUDES};stdlib.h;string.h" HAVE_INET_NTOP)
|
|
|
if(MSVC AND (MSVC_VERSION LESS_EQUAL 1600))
|
|
|
set(HAVE_INET_NTOP OFF)
|
|
|
endif()
|
|
|
-check_symbol_exists(inet_pton "${CURL_INCLUDES}" HAVE_INET_PTON)
|
|
|
+check_symbol_exists(inet_pton "${CURL_INCLUDES};stdlib.h;string.h" HAVE_INET_PTON)
|
|
|
|
|
|
check_symbol_exists(fsetxattr "${CURL_INCLUDES}" HAVE_FSETXATTR)
|
|
|
if(HAVE_FSETXATTR)
|
|
|
@@ -1342,24 +1391,15 @@ set(CMAKE_EXTRA_INCLUDE_FILES "")
|
|
|
|
|
|
# sigaction and sigsetjmp are special. Use special mechanism for
|
|
|
# detecting those, but only if previous attempt failed.
|
|
|
-if(HAVE_SIGNAL_H)
|
|
|
- check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
|
|
|
-endif()
|
|
|
+check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
|
|
|
|
|
|
if(NOT HAVE_SIGSETJMP)
|
|
|
- if(HAVE_SETJMP_H)
|
|
|
- check_symbol_exists(sigsetjmp "setjmp.h" HAVE_MACRO_SIGSETJMP)
|
|
|
- if(HAVE_MACRO_SIGSETJMP)
|
|
|
- set(HAVE_SIGSETJMP 1)
|
|
|
- endif()
|
|
|
+ check_symbol_exists(sigsetjmp "setjmp.h" HAVE_MACRO_SIGSETJMP)
|
|
|
+ if(HAVE_MACRO_SIGSETJMP)
|
|
|
+ set(HAVE_SIGSETJMP 1)
|
|
|
endif()
|
|
|
endif()
|
|
|
|
|
|
-# If there is no stricmp(), do not allow LDAP to parse URLs
|
|
|
-if(NOT HAVE_STRICMP)
|
|
|
- set(HAVE_LDAP_URL_PARSE 1)
|
|
|
-endif()
|
|
|
-
|
|
|
# Do curl specific tests
|
|
|
foreach(CURL_TEST
|
|
|
HAVE_FCNTL_O_NONBLOCK
|
|
|
@@ -1370,7 +1410,6 @@ foreach(CURL_TEST
|
|
|
HAVE_IOCTL_FIONBIO
|
|
|
HAVE_IOCTL_SIOCGIFADDR
|
|
|
HAVE_SETSOCKOPT_SO_NONBLOCK
|
|
|
- TIME_WITH_SYS_TIME
|
|
|
HAVE_O_NONBLOCK
|
|
|
HAVE_GETHOSTBYNAME_R_3
|
|
|
HAVE_GETHOSTBYNAME_R_5
|
|
|
@@ -1415,6 +1454,20 @@ if(WIN32)
|
|
|
unset(HAVE_WIN32_WINNT CACHE)
|
|
|
endif()
|
|
|
|
|
|
+if(0) # This code not needed for building within CMake.
|
|
|
+if(NOT WIN32 AND NOT CMAKE_CROSSCOMPILING)
|
|
|
+ # on not-Windows and not-crosscompiling, check for writable argv[]
|
|
|
+ include(CheckCSourceRuns)
|
|
|
+ check_c_source_runs("
|
|
|
+ int main(int argc, char **argv)
|
|
|
+ {
|
|
|
+ (void)argc;
|
|
|
+ argv[0][0] = ' ';
|
|
|
+ return (argv[0][0] == ' ')?0:1;
|
|
|
+ }" HAVE_WRITABLE_ARGV)
|
|
|
+endif()
|
|
|
+endif()
|
|
|
+
|
|
|
set(CMAKE_REQUIRED_FLAGS)
|
|
|
|
|
|
option(ENABLE_WEBSOCKETS "Set to ON to enable EXPERIMENTAL websockets" OFF)
|
|
|
@@ -1525,11 +1578,7 @@ if(WIN32)
|
|
|
list(APPEND CURL_LIBS "advapi32" "crypt32")
|
|
|
endif()
|
|
|
|
|
|
- if(NOT HAVE_MINGW_ORIGINAL)
|
|
|
- list(APPEND CURL_LIBS "bcrypt")
|
|
|
- else()
|
|
|
- set(HAVE_FTRUNCATE OFF)
|
|
|
- endif()
|
|
|
+ list(APPEND CURL_LIBS "bcrypt")
|
|
|
endif()
|
|
|
|
|
|
if(MSVC)
|
|
|
@@ -1644,7 +1693,7 @@ macro(_add_if label)
|
|
|
endmacro()
|
|
|
|
|
|
# NTLM support requires crypto function adaptions from various SSL libs
|
|
|
-# TODO alternative SSL libs tests for SSP1, GNUTLS, NSS
|
|
|
+# TODO alternative SSL libs tests for SSP1, GnuTLS, NSS
|
|
|
if(NOT (CURL_DISABLE_NTLM) AND
|
|
|
(USE_OPENSSL OR USE_MBEDTLS OR USE_DARWINSSL OR USE_WIN32_CRYPTO OR USE_GNUTLS))
|
|
|
set(use_curl_ntlm_core ON)
|
|
|
@@ -1673,14 +1722,13 @@ _add_if("SPNEGO" NOT CURL_DISABLE_NEGOTIATE_AUTH AND
|
|
|
_add_if("Kerberos" NOT CURL_DISABLE_KERBEROS_AUTH AND
|
|
|
(HAVE_GSSAPI OR USE_WINDOWS_SSPI))
|
|
|
# NTLM support requires crypto function adaptions from various SSL libs
|
|
|
-# TODO alternative SSL libs tests for SSP1, GNUTLS, NSS
|
|
|
+# TODO alternative SSL libs tests for SSP1, GnuTLS, NSS
|
|
|
_add_if("NTLM" NOT (CURL_DISABLE_NTLM) AND
|
|
|
(use_curl_ntlm_core OR USE_WINDOWS_SSPI))
|
|
|
# TODO missing option (autoconf: --enable-ntlm-wb)
|
|
|
_add_if("NTLM_WB" NOT (CURL_DISABLE_NTLM) AND
|
|
|
(use_curl_ntlm_core OR USE_WINDOWS_SSPI) AND
|
|
|
NOT CURL_DISABLE_HTTP AND NTLM_WB_ENABLED)
|
|
|
-# TODO missing option (--enable-tls-srp), depends on GNUTLS_SRP/OPENSSL_SRP
|
|
|
_add_if("TLS-SRP" USE_TLS_SRP)
|
|
|
# TODO option --with-nghttp2 tests for nghttp2 lib and nghttp2/nghttp2.h header
|
|
|
_add_if("HTTP2" USE_NGHTTP2)
|
|
|
@@ -1707,7 +1755,6 @@ _add_if("FILE" NOT CURL_DISABLE_FILE)
|
|
|
_add_if("TELNET" NOT CURL_DISABLE_TELNET)
|
|
|
_add_if("LDAP" NOT CURL_DISABLE_LDAP)
|
|
|
# CURL_DISABLE_LDAP implies CURL_DISABLE_LDAPS
|
|
|
-# TODO check HAVE_LDAP_SSL (in autoconf this is enabled with --enable-ldaps)
|
|
|
_add_if("LDAPS" NOT CURL_DISABLE_LDAPS AND
|
|
|
((USE_OPENLDAP AND SSL_ENABLED) OR
|
|
|
(NOT USE_OPENLDAP AND HAVE_LDAP_SSL)))
|