From 7df24abe32fee0af38c5d382503935bed2c6c72b Mon Sep 17 00:00:00 2001 From: halx99 Date: Mon, 7 Mar 2022 17:18:45 +0800 Subject: [PATCH] Update curl to 7.82.0 --- README.md | 4 +- src/curl/CMakeLists.txt | 119 +++++++++++++++++++++------------------- src/curl/build.yml | 8 +-- 3 files changed, 68 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index 1a71166..0dcbabf 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ Building opensources for multi-platforms with github actions. ## opensources - [![OpenSSL Stable Releaee](https://img.shields.io/badge/openssl-3.0.1-green.svg)](https://github.com/openssl/openssl/releases) - [![libjpeg-turbo](https://img.shields.io/badge/libjpegturbo-2.1.3-green.svg)](https://github.com/libjpeg-turbo/libjpeg-turbo/releases) -- [![curl](https://img.shields.io/badge/curl-7.81.0-green.svg)](https://github.com/curl/curl/releases) -- [![luajit](https://img.shields.io/badge/luajit-2.1%2d%2d1d7b502-green.svg)](https://github.com/LuaJIT/LuaJIT/commit/1d7b502) +- [![curl](https://img.shields.io/badge/curl-7.82.0-green.svg)](https://github.com/curl/curl/releases) +- [![luajit](https://img.shields.io/badge/luajit-2.1%2d%2df004a51-green.svg)](https://github.com/LuaJIT/LuaJIT/commit/f004a51) ## Build Targets: - macos: x86_64 diff --git a/src/curl/CMakeLists.txt b/src/curl/CMakeLists.txt index a068a49..9fbf972 100644 --- a/src/curl/CMakeLists.txt +++ b/src/curl/CMakeLists.txt @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2021, Daniel Stenberg, , et al. +# Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -109,7 +109,7 @@ option(ENABLE_CURLDEBUG "Set to ON to build with TrackMemory feature enabled" OF if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) if(PICKY_COMPILER) - foreach(_CCOPT -pedantic -Wall -W -Wpointer-arith -Wwrite-strings -Wunused -Wshadow -Winline -Wnested-externs -Wmissing-declarations -Wmissing-prototypes -Wfloat-equal -Wsign-compare -Wundef -Wendif-labels -Wstrict-prototypes -Wdeclaration-after-statement -Wstrict-aliasing=3 -Wcast-align -Wtype-limits -Wold-style-declaration -Wmissing-parameter-type -Wempty-body -Wclobbered -Wignored-qualifiers -Wconversion -Wvla -Wdouble-promotion) + foreach(_CCOPT -pedantic -Wall -W -Wpointer-arith -Wwrite-strings -Wunused -Wshadow -Winline -Wnested-externs -Wmissing-declarations -Wmissing-prototypes -Wfloat-equal -Wsign-compare -Wundef -Wendif-labels -Wstrict-prototypes -Wdeclaration-after-statement -Wstrict-aliasing=3 -Wcast-align -Wtype-limits -Wold-style-declaration -Wmissing-parameter-type -Wempty-body -Wclobbered -Wignored-qualifiers -Wconversion -Wvla -Wdouble-promotion -Wenum-conversion -Warith-conversion) # surprisingly, CHECK_C_COMPILER_FLAG needs a new variable to store each new # test result in. string(MAKE_C_IDENTIFIER "OPT${_CCOPT}" _optvarname) @@ -334,13 +334,6 @@ check_library_exists_concat("${CMAKE_DL_LIBS}" dlopen HAVE_LIBDL) check_library_exists_concat("socket" connect HAVE_LIBSOCKET) check_library_exists("c" gethostbyname "" NOT_NEED_LIBNSL) -# Yellowtab Zeta needs different libraries than BeOS 5. -if(BEOS) - set(NOT_NEED_LIBNSL 1) - check_library_exists_concat("bind" gethostbyname HAVE_LIBBIND) - check_library_exists_concat("bnetapi" closesocket HAVE_LIBBNETAPI) -endif() - if(NOT NOT_NEED_LIBNSL) check_library_exists_concat("nsl" gethostbyname HAVE_LIBNSL) endif() @@ -352,62 +345,74 @@ if(WIN32) check_library_exists_concat("winmm" getch HAVE_LIBWINMM) endif() +# This check below for use of deprecated symbols is only temporary and is to +# be removed again after a year's service. Remove after November 25, 2022. +set(CURL_RECONFIG_REQUIRED 0) +foreach(_LIB GSSAPI OPENLDAP LIBSSH LIBSSH2 BEARSSL MBEDTLS NSS OPENSSL + SCHANNEL SECTRANSP WOLFSSL) + if(CMAKE_USE_${_LIB}) + set(CURL_RECONFIG_REQUIRED 1) + message(SEND_ERROR "The option CMAKE_USE_${_LIB} was renamed to CURL_USE_${_LIB}.") + endif() +endforeach() +if(CMAKE_USE_WINSSL) + set(CURL_RECONFIG_REQUIRED 1) + message(SEND_ERROR "The option CMAKE_USE_WINSSL was renamed to CURL_USE_SCHANNEL.") +endif() +if(CURL_RECONFIG_REQUIRED) + message(FATAL_ERROR "Reconfig required") +endif() + # check SSL libraries # TODO support GnuTLS option(CURL_ENABLE_SSL "Enable SSL support" ON) -if(CMAKE_USE_WINSSL) - message(FATAL_ERROR "The cmake option CMAKE_USE_WINSSL was renamed to CMAKE_USE_SCHANNEL.") -endif() if(APPLE) - cmake_dependent_option(CMAKE_USE_SECTRANSP "enable Apple OS native SSL/TLS" OFF CURL_ENABLE_SSL OFF) + cmake_dependent_option(CURL_USE_SECTRANSP "enable Apple OS native SSL/TLS" OFF CURL_ENABLE_SSL OFF) endif() if(WIN32) - cmake_dependent_option(CMAKE_USE_SCHANNEL "enable Windows native SSL/TLS" OFF CURL_ENABLE_SSL OFF) + cmake_dependent_option(CURL_USE_SCHANNEL "enable Windows native SSL/TLS" OFF CURL_ENABLE_SSL OFF) cmake_dependent_option(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON - CMAKE_USE_SCHANNEL OFF) + CURL_USE_SCHANNEL OFF) endif() -cmake_dependent_option(CMAKE_USE_MBEDTLS "Enable mbedTLS for SSL/TLS" OFF CURL_ENABLE_SSL OFF) -cmake_dependent_option(CMAKE_USE_BEARSSL "Enable BearSSL for SSL/TLS" OFF CURL_ENABLE_SSL OFF) -cmake_dependent_option(CMAKE_USE_NSS "Enable NSS for SSL/TLS" OFF CURL_ENABLE_SSL OFF) -cmake_dependent_option(CMAKE_USE_WOLFSSL "enable wolfSSL for SSL/TLS" OFF CURL_ENABLE_SSL OFF) +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_NSS "Enable NSS for SSL/TLS" OFF CURL_ENABLE_SSL OFF) +cmake_dependent_option(CURL_USE_WOLFSSL "enable wolfSSL for SSL/TLS" OFF CURL_ENABLE_SSL OFF) set(openssl_default ON) -# halx99: patch me, always use openssl -# if(WIN32 OR CMAKE_USE_SECTRANSP OR CMAKE_USE_SCHANNEL OR CMAKE_USE_MBEDTLS OR CMAKE_USE_NSS OR CMAKE_USE_WOLFSSL) -# set(openssl_default OFF) -# endif() -cmake_dependent_option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ${openssl_default} CURL_ENABLE_SSL OFF) +if(WIN32 OR CURL_USE_SECTRANSP OR CURL_USE_SCHANNEL OR CURL_USE_MBEDTLS OR CURL_USE_NSS OR CURL_USE_WOLFSSL) + set(openssl_default OFF) +endif() +cmake_dependent_option(CURL_USE_OPENSSL "Use OpenSSL code. Experimental" ${openssl_default} CURL_ENABLE_SSL OFF) option(CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG "Disable automatic loading of OpenSSL configuration" OFF) +message(STATUS "===>DEBUG INFO: CURL_USE_OPENSSL=${CURL_USE_OPENSSL}") + count_true(enabled_ssl_options_count - CMAKE_USE_SCHANNEL - CMAKE_USE_SECTRANSP - CMAKE_USE_OPENSSL - CMAKE_USE_MBEDTLS - CMAKE_USE_BEARSSL - CMAKE_USE_NSS - CMAKE_USE_WOLFSSL + CURL_USE_SCHANNEL + CURL_USE_SECTRANSP + CURL_USE_OPENSSL + CURL_USE_MBEDTLS + CURL_USE_BEARSSL + CURL_USE_NSS + CURL_USE_WOLFSSL ) if(enabled_ssl_options_count GREATER "1") set(CURL_WITH_MULTI_SSL ON) endif() -if(CMAKE_USE_SCHANNEL) +if(CURL_USE_SCHANNEL) set(SSL_ENABLED ON) set(USE_SCHANNEL ON) # Windows native SSL/TLS support - set(USE_WINDOWS_SSPI ON) # CMAKE_USE_SCHANNEL implies CURL_WINDOWS_SSPI + set(USE_WINDOWS_SSPI ON) # CURL_USE_SCHANNEL implies CURL_WINDOWS_SSPI endif() if(CURL_WINDOWS_SSPI) set(USE_WINDOWS_SSPI ON) set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -DSECURITY_WIN32") endif() -if(CMAKE_USE_DARWINSSL) - message(FATAL_ERROR "The cmake option CMAKE_USE_DARWINSSL was renamed to CMAKE_USE_SECTRANSP.") -endif() - -if(CMAKE_USE_SECTRANSP) +if(CURL_USE_SECTRANSP) set(use_core_foundation ON) find_library(SECURITY_FRAMEWORK "Security") @@ -429,7 +434,7 @@ if(use_core_foundation) list(APPEND CURL_LIBS "-framework CoreFoundation") endif() -if(CMAKE_USE_OPENSSL) +if(CURL_USE_OPENSSL) if(NOT OPENSSL_INCLUDE_DIR) # halx99: patch me, use exist openssl, don't find system installed openssl find_package(OpenSSL REQUIRED) set(SSL_ENABLED ON) @@ -471,7 +476,7 @@ if(CMAKE_USE_OPENSSL) add_definitions(-DOPENSSL_SUPPRESS_DEPRECATED) endif() -if(CMAKE_USE_MBEDTLS) +if(CURL_USE_MBEDTLS) find_package(MbedTLS REQUIRED) set(SSL_ENABLED ON) set(USE_MBEDTLS ON) @@ -479,7 +484,7 @@ if(CMAKE_USE_MBEDTLS) include_directories(${MBEDTLS_INCLUDE_DIRS}) endif() -if(CMAKE_USE_BEARSSL) +if(CURL_USE_BEARSSL) find_package(BearSSL REQUIRED) set(SSL_ENABLED ON) set(USE_BEARSSL ON) @@ -487,7 +492,7 @@ if(CMAKE_USE_BEARSSL) include_directories(${BEARSSL_INCLUDE_DIRS}) endif() -if(CMAKE_USE_WOLFSSL) +if(CURL_USE_WOLFSSL) find_package(WolfSSL REQUIRED) set(SSL_ENABLED ON) set(USE_WOLFSSL ON) @@ -495,7 +500,7 @@ if(CMAKE_USE_WOLFSSL) include_directories(${WolfSSL_INCLUDE_DIRS}) endif() -if(CMAKE_USE_NSS) +if(CURL_USE_NSS) find_package(NSS REQUIRED) include_directories(${NSS_INCLUDE_DIRS}) list(APPEND CURL_LIBS ${NSS_LIBRARIES}) @@ -576,13 +581,13 @@ if(NOT CURL_DISABLE_LDAP) endif() endif() - option(CMAKE_USE_OPENLDAP "Use OpenLDAP code." OFF) - mark_as_advanced(CMAKE_USE_OPENLDAP) + 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(CMAKE_USE_OPENLDAP AND USE_WIN32_LDAP) - message(FATAL_ERROR "Cannot use USE_WIN32_LDAP and CMAKE_USE_OPENLDAP at the same time") + 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... @@ -612,7 +617,7 @@ 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(CMAKE_USE_OPENLDAP) + if(CURL_USE_OPENLDAP) set(USE_OPENLDAP ON) endif() if(CMAKE_LDAP_INCLUDE_DIR) @@ -742,13 +747,13 @@ if(CURL_ZSTD) endif() #libSSH2 -option(CMAKE_USE_LIBSSH2 "Use libSSH2" ON) -mark_as_advanced(CMAKE_USE_LIBSSH2) +option(CURL_USE_LIBSSH2 "Use libSSH2" ON) +mark_as_advanced(CURL_USE_LIBSSH2) set(USE_LIBSSH2 OFF) set(HAVE_LIBSSH2 OFF) set(HAVE_LIBSSH2_H OFF) -if(CMAKE_USE_LIBSSH2) +if(CURL_USE_LIBSSH2) find_package(LibSSH2) if(LIBSSH2_FOUND) list(APPEND CURL_LIBS ${LIBSSH2_LIBRARY}) @@ -767,9 +772,9 @@ if(CMAKE_USE_LIBSSH2) endif() # libssh -option(CMAKE_USE_LIBSSH "Use libSSH" OFF) -mark_as_advanced(CMAKE_USE_LIBSSH) -if(NOT HAVE_LIBSSH2 AND CMAKE_USE_LIBSSH) +option(CURL_USE_LIBSSH "Use libSSH" OFF) +mark_as_advanced(CURL_USE_LIBSSH) +if(NOT HAVE_LIBSSH2 AND CURL_USE_LIBSSH) find_package(libssh CONFIG) if(libssh_FOUND) message(STATUS "Found libssh ${libssh_VERSION}") @@ -780,10 +785,10 @@ if(NOT HAVE_LIBSSH2 AND CMAKE_USE_LIBSSH) endif() endif() -option(CMAKE_USE_GSSAPI "Use GSSAPI implementation (right now only Heimdal is supported with CMake build)" OFF) -mark_as_advanced(CMAKE_USE_GSSAPI) +option(CURL_USE_GSSAPI "Use GSSAPI implementation (right now only Heimdal is supported with CMake build)" OFF) +mark_as_advanced(CURL_USE_GSSAPI) -if(CMAKE_USE_GSSAPI) +if(CURL_USE_GSSAPI) find_package(GSS) set(HAVE_GSSAPI ${GSS_FOUND}) diff --git a/src/curl/build.yml b/src/curl/build.yml index f5f9adf..7f48b83 100644 --- a/src/curl/build.yml +++ b/src/curl/build.yml @@ -1,8 +1,8 @@ -repo: https://curl.se/download/curl-7.81.0.zip -ver: 7.81.0 +repo: https://curl.se/download/curl-7.82.0.zip +ver: 7.82.0 tag_prefix: 'curl-' tag_dot2ul: true cb_tool: cmake -config_options_unix: -DCMAKE_USE_LIBSSH2=FALSE -DBUILD_CURL_EXE=FALSE -DCURL_DISABLE_TESTS=TRUE -DCMAKE_USE_OPENSSL=TRUE -DBUILD_SHARED_LIBS=OFF +config_options_unix: -DCURL_USE_LIBSSH2=FALSE -DBUILD_CURL_EXE=FALSE -DCURL_DISABLE_TESTS=TRUE -DCURL_USE_OPENSSL=TRUE -DBUILD_SHARED_LIBS=OFF config_options_embed: '' -config_options_msw: -DCMAKE_USE_LIBSSH2=FALSE -DBUILD_CURL_EXE=FALSE -DCURL_DISABLE_TESTS=TRUE -DCMAKE_USE_OPENSSL=TRUE -DBUILD_SHARED_LIBS=ON +config_options_msw: -DCURL_USE_LIBSSH2=FALSE -DBUILD_CURL_EXE=FALSE -DCURL_DISABLE_TESTS=TRUE -DCURL_USE_OPENSSL=TRUE -DBUILD_SHARED_LIBS=ON