Skip to content

Commit

Permalink
New upstream version 8.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
UTsweetyfish committed Nov 19, 2024
1 parent c236821 commit baa52e7
Show file tree
Hide file tree
Showing 870 changed files with 28,303 additions and 25,021 deletions.
52 changes: 19 additions & 33 deletions CMake/CurlSymbolHiding.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
# SPDX-License-Identifier: curl
#
###########################################################################
include(CheckCSourceCompiles)

option(CURL_HIDDEN_SYMBOLS "Hide libcurl internal symbols (=hide all symbols that are not officially external)" ON)
mark_as_advanced(CURL_HIDDEN_SYMBOLS)

Expand All @@ -33,48 +31,36 @@ if(WIN32 AND (ENABLE_DEBUG OR ENABLE_CURLDEBUG))
set(CURL_HIDDEN_SYMBOLS OFF)
endif()

if(CURL_HIDDEN_SYMBOLS)
set(_supports_symbol_hiding FALSE)
set(CURL_HIDES_PRIVATE_SYMBOLS FALSE)
unset(CURL_EXTERN_SYMBOL)
unset(CURL_CFLAG_SYMBOLS_HIDE)

if(CURL_HIDDEN_SYMBOLS)
if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT MSVC)
set(_supports_symbol_hiding TRUE)
set(_symbol_extern "__attribute__ ((__visibility__ (\"default\")))")
set(_cflag_symbols_hide "-fvisibility=hidden")
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
set(CURL_EXTERN_SYMBOL "__attribute__((__visibility__(\"default\")))")
set(CURL_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden")
elseif(CMAKE_COMPILER_IS_GNUCC)
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
# Note: This is considered buggy prior to 4.0 but the autotools do not care, so let us ignore that fact
set(_supports_symbol_hiding TRUE)
set(_symbol_extern "__attribute__ ((__visibility__ (\"default\")))")
set(_cflag_symbols_hide "-fvisibility=hidden")
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
set(CURL_EXTERN_SYMBOL "__attribute__((__visibility__(\"default\")))")
set(CURL_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden")
endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "SunPro" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0)
set(_supports_symbol_hiding TRUE)
set(_symbol_extern "__global")
set(_cflag_symbols_hide "-xldscope=hidden")
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0)
# Note: This should probably just check for version 9.1.045 but I am not 100% sure
# so let us do it the same way autotools do.
set(_supports_symbol_hiding TRUE)
set(_symbol_extern "__attribute__ ((__visibility__ (\"default\")))")
set(_cflag_symbols_hide "-fvisibility=hidden")
check_c_source_compiles("#include <stdio.h>
int main(void) { printf(\"icc fvisibility bug test\"); return 0; }" _no_bug)
if(NOT _no_bug)
set(_supports_symbol_hiding FALSE)
set(_symbol_extern "")
set(_cflag_symbols_hide "")
endif()
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
set(CURL_EXTERN_SYMBOL "__global")
set(CURL_CFLAG_SYMBOLS_HIDE "-xldscope=hidden")
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0) # Requires 9.1.045
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
set(CURL_EXTERN_SYMBOL "__attribute__((__visibility__(\"default\")))")
set(CURL_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden")
elseif(MSVC)
set(_supports_symbol_hiding TRUE)
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
endif()

set(CURL_HIDES_PRIVATE_SYMBOLS ${_supports_symbol_hiding})
else()
if(MSVC)
# Note: This option is prone to export non-curl extra symbols.
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
endif()
set(CURL_HIDES_PRIVATE_SYMBOLS FALSE)
endif()

set(CURL_CFLAG_SYMBOLS_HIDE ${_cflag_symbols_hide})
set(CURL_EXTERN_SYMBOL ${_symbol_extern})
21 changes: 2 additions & 19 deletions CMake/CurlTests.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ int main(void)
int flags = 0;
if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
return 1;
;
return 0;
}
#endif
Expand Down Expand Up @@ -159,15 +160,12 @@ int main(void) { return 0; }
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int main(void) { ; return 0; }
int main(void) { return 0; }
#endif

#ifdef HAVE_IOCTLSOCKET
/* includes start */
#ifdef _WIN32
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock2.h>
#endif
int main(void)
Expand All @@ -184,9 +182,6 @@ int main(void)
#ifdef HAVE_IOCTLSOCKET_CAMEL
/* includes start */
#ifdef _WIN32
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock2.h>
#endif
int main(void)
Expand All @@ -202,9 +197,6 @@ int main(void)
#ifdef HAVE_IOCTLSOCKET_CAMEL_FIONBIO
/* includes start */
#ifdef _WIN32
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock2.h>
#endif
int main(void)
Expand All @@ -221,9 +213,6 @@ int main(void)
#ifdef HAVE_IOCTLSOCKET_FIONBIO
/* includes start */
#ifdef _WIN32
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock2.h>
#endif
int main(void)
Expand Down Expand Up @@ -296,9 +285,6 @@ int main(void)
#ifdef HAVE_SETSOCKOPT_SO_NONBLOCK
/* includes start */
#ifdef _WIN32
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock2.h>
#endif
/* includes start */
Expand Down Expand Up @@ -409,9 +395,6 @@ int main(void)
#ifdef HAVE_WIN32_WINNT
/* includes start */
#ifdef _WIN32
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# ifndef NOGDI
# define NOGDI
# endif
Expand Down
13 changes: 6 additions & 7 deletions CMake/FindBearSSL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,18 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# Find the bearssl library
# Find the BearSSL library
#
# Input variables:
#
# BEARSSL_INCLUDE_DIR The bearssl include directory
# BEARSSL_INCLUDE_DIRS The bearssl include directory (deprecated)
# BEARSSL_LIBRARY Path to bearssl library
# - `BEARSSL_INCLUDE_DIR`: The BearSSL include directory.
# - `BEARSSL_LIBRARY`: Path to `bearssl` library.
#
# Result variables:
#
# BEARSSL_FOUND System has bearssl
# BEARSSL_INCLUDE_DIRS The bearssl include directories
# BEARSSL_LIBRARIES The bearssl library names
# - `BEARSSL_FOUND`: System has BearSSL.
# - `BEARSSL_INCLUDE_DIRS`: The BearSSL include directories.
# - `BEARSSL_LIBRARIES`: The BearSSL library names.

if(DEFINED BEARSSL_INCLUDE_DIRS AND NOT DEFINED BEARSSL_INCLUDE_DIR)
message(WARNING "BEARSSL_INCLUDE_DIRS is deprecated, use BEARSSL_INCLUDE_DIR instead.")
Expand Down
14 changes: 7 additions & 7 deletions CMake/FindBrotli.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
#
# Input variables:
#
# BROTLI_INCLUDE_DIR The brotli include directory
# BROTLICOMMON_LIBRARY Path to brotlicommon library
# BROTLIDEC_LIBRARY Path to brotlidec library
# - `BROTLI_INCLUDE_DIR`: The brotli include directory.
# - `BROTLICOMMON_LIBRARY`: Path to `brotlicommon` library.
# - `BROTLIDEC_LIBRARY`: Path to `brotlidec` library.
#
# Result variables:
#
# BROTLI_FOUND System has brotli
# BROTLI_INCLUDE_DIRS The brotli include directories
# BROTLI_LIBRARIES The brotli library names
# BROTLI_VERSION Version of brotli
# - `BROTLI_FOUND`: System has brotli.
# - `BROTLI_INCLUDE_DIRS`: The brotli include directories.
# - `BROTLI_LIBRARIES`: The brotli library names.
# - `BROTLI_VERSION`: Version of brotli.

if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
Expand Down
34 changes: 22 additions & 12 deletions CMake/FindCares.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
#
# Input variables:
#
# CARES_INCLUDE_DIR The c-ares include directory
# CARES_LIBRARY Path to c-ares library
# - `CARES_INCLUDE_DIR`: The c-ares include directory.
# - `CARES_LIBRARY`: Path to `cares` library.
#
# Result variables:
#
# CARES_FOUND System has c-ares
# CARES_INCLUDE_DIRS The c-ares include directories
# CARES_LIBRARIES The c-ares library names
# CARES_VERSION Version of c-ares
# - `CARES_FOUND`: System has c-ares.
# - `CARES_INCLUDE_DIRS`: The c-ares include directories.
# - `CARES_LIBRARIES`: The c-ares library names.
# - `CARES_VERSION`: Version of c-ares.

if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
Expand All @@ -55,12 +55,22 @@ find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares"
if(PC_CARES_VERSION)
set(CARES_VERSION ${PC_CARES_VERSION})
elseif(CARES_INCLUDE_DIR AND EXISTS "${CARES_INCLUDE_DIR}/ares_version.h")
set(_version_regex "#[\t ]*define[\t ]+ARES_VERSION_STR[\t ]+\"([^\"]*)\"")
file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(CARES_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
set(_version_regex1 "#[\t ]*define[\t ]+ARES_VERSION_MAJOR[\t ]+([0-9]+).*")
set(_version_regex2 "#[\t ]*define[\t ]+ARES_VERSION_MINOR[\t ]+([0-9]+).*")
set(_version_regex3 "#[\t ]*define[\t ]+ARES_VERSION_PATCH[\t ]+([0-9]+).*")
file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str1 REGEX "${_version_regex1}")
file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str2 REGEX "${_version_regex2}")
file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str3 REGEX "${_version_regex3}")
string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}")
string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}")
string(REGEX REPLACE "${_version_regex3}" "\\1" _version_str3 "${_version_str3}")
set(CARES_VERSION "${_version_str1}.${_version_str2}.${_version_str3}")
unset(_version_regex1)
unset(_version_regex2)
unset(_version_regex3)
unset(_version_str1)
unset(_version_str2)
unset(_version_str3)
endif()

include(FindPackageHandleStandardArgs)
Expand Down
66 changes: 50 additions & 16 deletions CMake/FindGSS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,21 @@
#
# Input variables:
#
# GSS_ROOT_DIR Set this variable to the root installation of GSS
# - `GSS_ROOT_DIR`: Set this variable to the root installation of GSS. (also supported as environment)
#
# Result variables:
#
# GSS_FOUND System has the Heimdal library
# GSS_FLAVOUR "MIT" or "Heimdal" if anything found
# GSS_INCLUDE_DIRS The GSS include directories
# GSS_LIBRARIES The GSS library names
# GSS_LIBRARY_DIRS The GSS library directories
# GSS_LDFLAGS Required linker flags
# GSS_CFLAGS Required compiler flags
# GSS_VERSION This is set to version advertised by pkg-config or read from manifest.
# In case the library is found but no version info available it is set to "unknown"
# - `GSS_FOUND`: System has the Heimdal library.
# - `GSS_FLAVOUR`: "GNU", "MIT" or "Heimdal" if anything found.
# - `GSS_INCLUDE_DIRS`: The GSS include directories.
# - `GSS_LIBRARIES`: The GSS library names.
# - `GSS_LIBRARY_DIRS`: The GSS library directories.
# - `GSS_LDFLAGS`: Required linker flags.
# - `GSS_CFLAGS`: Required compiler flags.
# - `GSS_VERSION`: This is set to version advertised by pkg-config or read from manifest.
# In case the library is found but no version info available it is set to "unknown"

set(_gnu_modname "gss")
set(_mit_modname "mit-krb5-gssapi")
set(_heimdal_modname "heimdal-gssapi")

Expand All @@ -55,7 +56,7 @@ set(_gss_root_hints
if(NOT GSS_ROOT_DIR AND NOT "$ENV{GSS_ROOT_DIR}")
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_search_module(_GSS ${_mit_modname} ${_heimdal_modname})
pkg_search_module(_GSS ${_gnu_modname} ${_mit_modname} ${_heimdal_modname})
list(APPEND _gss_root_hints "${_GSS_PREFIX}")
endif()
if(WIN32)
Expand Down Expand Up @@ -175,6 +176,7 @@ if(NOT _GSS_FOUND) # Not found by pkg-config. Let us take more traditional appr
)

if(_GSS_INCLUDE_DIRS) # jay, we have found something
cmake_push_check_state()
set(CMAKE_REQUIRED_INCLUDES "${_GSS_INCLUDE_DIRS}")
check_include_files("gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _gss_have_mit_headers)

Expand All @@ -189,8 +191,8 @@ if(NOT _GSS_FOUND) # Not found by pkg-config. Let us take more traditional appr
if(_gss_have_roken_h OR _gss_have_heimdal_roken_h)
set(GSS_FLAVOUR "Heimdal")
endif()
list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS "-D__ROKEN_H__")
endif()
cmake_pop_check_state()
else()
# I am not convinced if this is the right way but this is what autotools do at the moment
find_path(_GSS_INCLUDE_DIRS NAMES "gssapi.h"
Expand All @@ -203,6 +205,17 @@ if(NOT _GSS_FOUND) # Not found by pkg-config. Let us take more traditional appr

if(_GSS_INCLUDE_DIRS)
set(GSS_FLAVOUR "Heimdal")
else()
find_path(_GSS_INCLUDE_DIRS NAMES "gss.h"
HINTS
${_gss_root_hints}
PATH_SUFFIXES
"include"
)

if(_GSS_INCLUDE_DIRS)
set(GSS_FLAVOUR "GNU")
endif()
endif()
endif()

Expand All @@ -216,22 +229,28 @@ if(NOT _GSS_FOUND) # Not found by pkg-config. Let us take more traditional appr
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND _gss_libdir_suffixes "lib/AMD64")
if(GSS_FLAVOUR STREQUAL "MIT")
if(GSS_FLAVOUR STREQUAL "GNU")
set(_gss_libname "gss")
elseif(GSS_FLAVOUR STREQUAL "MIT")
set(_gss_libname "gssapi64")
else()
set(_gss_libname "libgssapi")
endif()
else()
list(APPEND _gss_libdir_suffixes "lib/i386")
if(GSS_FLAVOUR STREQUAL "MIT")
if(GSS_FLAVOUR STREQUAL "GNU")
set(_gss_libname "gss")
elseif(GSS_FLAVOUR STREQUAL "MIT")
set(_gss_libname "gssapi32")
else()
set(_gss_libname "libgssapi")
endif()
endif()
else()
list(APPEND _gss_libdir_suffixes "lib;lib64") # those suffixes are not checked for HINTS
if(GSS_FLAVOUR STREQUAL "MIT")
if(GSS_FLAVOUR STREQUAL "GNU")
set(_gss_libname "gss")
elseif(GSS_FLAVOUR STREQUAL "MIT")
set(_gss_libname "gssapi_krb5")
else()
set(_gss_libname "gssapi")
Expand All @@ -247,7 +266,13 @@ if(NOT _GSS_FOUND) # Not found by pkg-config. Let us take more traditional appr
endif()
endif()
else()
if(_GSS_MODULE_NAME STREQUAL _mit_modname OR _GSS_${_mit_modname}_VERSION) # _GSS_MODULE_NAME set since CMake 3.16
# _GSS_MODULE_NAME set since CMake 3.16
if(_GSS_MODULE_NAME STREQUAL _gnu_modname OR _GSS_${_gnu_modname}_VERSION)
set(GSS_FLAVOUR "GNU")
if(NOT _GSS_VERSION) # for old CMake versions?
set(_GSS_VERSION ${_GSS_${_gnu_modname}_VERSION})
endif()
elseif(_GSS_MODULE_NAME STREQUAL _mit_modname OR _GSS_${_mit_modname}_VERSION)
set(GSS_FLAVOUR "MIT")
if(NOT _GSS_VERSION) # for old CMake versions?
set(_GSS_VERSION ${_GSS_${_mit_modname}_VERSION})
Expand Down Expand Up @@ -294,6 +319,15 @@ if(GSS_FLAVOUR)
else()
set(GSS_VERSION "MIT Unknown")
endif()
elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "GNU")
if(GSS_INCLUDE_DIRS AND EXISTS "${GSS_INCLUDE_DIRS}/gss.h")
set(_version_regex "#[\t ]*define[\t ]+GSS_VERSION[\t ]+\"([^\"]*)\"")
file(STRINGS "${GSS_INCLUDE_DIRS}/gss.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(GSS_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
endif()
endif()
endif()

Expand Down
Loading

0 comments on commit baa52e7

Please sign in to comment.