-
Notifications
You must be signed in to change notification settings - Fork 5
/
libcurl-7.87.patch
117 lines (113 loc) · 4.17 KB
/
libcurl-7.87.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b435207..8603535 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -510,19 +510,23 @@ if(CURL_USE_NSS)
endif()
endif()
-option(USE_NGHTTP2 "Use Nghttp2 library" OFF)
-if(USE_NGHTTP2)
- find_package(NGHTTP2 REQUIRED)
- include_directories(${NGHTTP2_INCLUDE_DIRS})
- list(APPEND CURL_LIBS ${NGHTTP2_LIBRARIES})
-endif()
-
function(CheckQuicSupportInOpenSSL)
# Be sure that the OpenSSL library actually supports QUIC.
if(NOT DEFINED HAVE_SSL_CTX_SET_QUIC_METHOD)
cmake_push_check_state()
set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
set(CMAKE_REQUIRED_LIBRARIES "${OPENSSL_LIBRARIES}")
+ if(CMAKE_DL_LIBS)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS})
+ endif()
+ if(TARGET Threads::Threads)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES Threads::Threads)
+ endif()
+ if(HAVE_LIBWS2_32)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ws2_32)
+ elseif(HAVE_LIBSOCKET)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES socket)
+ endif()
check_symbol_exists(SSL_CTX_set_quic_method "openssl/ssl.h" HAVE_SSL_CTX_SET_QUIC_METHOD)
cmake_pop_check_state()
endif()
@@ -554,6 +558,61 @@ if(USE_NGTCP2)
set(USE_NGHTTP3 ON)
include_directories(${NGHTTP3_INCLUDE_DIRS})
list(APPEND CURL_LIBS ${NGHTTP3_LIBRARIES})
+
+ if(WIN32)
+ cmake_push_check_state()
+ set(CMAKE_REQUIRED_LIBRARIES "${CURL_LIBS}")
+ check_symbol_exists(nghttp3_version "nghttp3/nghttp3.h" HAVE_NGHTTP3_DYNAMICLIB)
+ if(NOT HAVE_NGHTTP3_DYNAMICLIB)
+ set(CMAKE_REQUIRED_DEFINITIONS "-DNGHTTP3_STATICLIB=1")
+ check_symbol_exists(nghttp3_version "nghttp3/nghttp3.h" HAVE_NGHTTP3_STATICLIB)
+ if(HAVE_NGHTTP3_STATICLIB)
+ add_definitions(-DNGHTTP3_STATICLIB=1)
+ endif()
+ endif()
+
+ check_symbol_exists(ngtcp2_version "ngtcp2/ngtcp2.h" HAVE_NGTCP2_DYNAMICLIB)
+ if(NOT HAVE_NGTCP2_DYNAMICLIB)
+ set(CMAKE_REQUIRED_DEFINITIONS "-DNGTCP2_STATICLIB=1")
+ check_symbol_exists(ngtcp2_version "ngtcp2/ngtcp2.h" HAVE_NGTCP2_STATICLIB)
+ if(HAVE_NGTCP2_STATICLIB)
+ add_definitions(-DNGTCP2_STATICLIB=1)
+ endif()
+ endif()
+ cmake_pop_check_state()
+ endif()
+endif()
+
+option(USE_NGHTTP2 "Use Nghttp2 library" OFF)
+if(USE_NGHTTP2)
+ find_package(NGHTTP2 REQUIRED)
+ include_directories(${NGHTTP2_INCLUDE_DIRS})
+ list(APPEND CURL_LIBS ${NGHTTP2_LIBRARIES})
+ if(WIN32)
+ cmake_push_check_state()
+ set(CMAKE_REQUIRED_LIBRARIES "${CURL_LIBS}")
+ check_type_size(ssize_t SIZEOF_SSIZE_T)
+ if(NOT HAVE_SIZEOF_SSIZE_T)
+ check_type_size("long" SIZEOF_LONG)
+ check_type_size("__int64" SIZEOF___INT64)
+ if(SIZEOF_LONG EQUAL SIZEOF_SIZE_T)
+ set(CMAKE_REQUIRED_DEFINITIONS "-Dssize_t=long")
+ elseif(SIZEOF___INT64 EQUAL SIZEOF_SIZE_T)
+ set(CMAKE_REQUIRED_DEFINITIONS "-Dssize_t=__int64")
+ else()
+ set(CMAKE_REQUIRED_DEFINITIONS "-Dssize_t=long long")
+ endif()
+ endif()
+ check_symbol_exists(nghttp2_version "nghttp2/nghttp2.h" HAVE_NGHTTP2_DYNAMICLIB)
+ if(NOT HAVE_NGHTTP2_DYNAMICLIB)
+ list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DNGHTTP2_STATICLIB=1")
+ check_symbol_exists(nghttp2_version "nghttp2/nghttp2.h" HAVE_NGHTTP2_STATICLIB)
+ if(HAVE_NGHTTP2_STATICLIB)
+ add_definitions(-DNGHTTP2_STATICLIB=1)
+ endif()
+ endif()
+ cmake_pop_check_state()
+ endif()
endif()
option(USE_QUICHE "Use quiche library for HTTP/3 support" OFF)
@@ -610,7 +669,7 @@ if(NOT CURL_DISABLE_LDAP)
check_include_file_concat("winldap.h" HAVE_WINLDAP_H)
else()
# Check for LDAP
- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
+ set(CMAKE_REQUIRED_LIBRARIES "${OPENSSL_LIBRARIES}")
check_library_exists_concat(${CMAKE_LDAP_LIB} ldap_init HAVE_LIBLDAP)
check_library_exists_concat(${CMAKE_LBER_LIB} ber_init HAVE_LIBLBER)
@@ -1038,8 +1097,10 @@ endif()
# Check for some functions that are used
if(HAVE_LIBWS2_32)
set(CMAKE_REQUIRED_LIBRARIES ws2_32)
+ list(APPEND CURL_LIBS ws2_32)
elseif(HAVE_LIBSOCKET)
set(CMAKE_REQUIRED_LIBRARIES socket)
+ list(APPEND CURL_LIBS socket)
endif()
check_symbol_exists(fchmod "${CURL_INCLUDES}" HAVE_FCHMOD)