Skip to content

Commit 1088c7d

Browse files
shivammathurJan-E
andauthored
Make curl brotli and zstd optional on Windows (php#21925)
This allows builds with older curl versions to continue without these dependencies, while also supporting static library names when they are present. Co-authored-by: Jan Ehrhardt <1757825+Jan-E@users.noreply.github.com>
1 parent fee84dd commit 1088c7d

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

ext/curl/config.w32

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,18 @@ if (PHP_CURL != "no") {
2424
(ver_num <= parseInt("0x073b00") || ver_num > parseInt("0x073b00") &&
2525
CHECK_LIB("normaliz.lib", "curl", PHP_CURL) &&
2626
CHECK_LIB("libssh2.lib", "curl", PHP_CURL) &&
27-
CHECK_LIB("nghttp2.lib", "curl", PHP_CURL) &&
28-
CHECK_LIB("brotlidec.lib", "curl", PHP_CURL) &&
29-
CHECK_LIB("brotlicommon.lib", "curl", PHP_CURL) &&
30-
CHECK_LIB("libzstd.lib", "curl", PHP_CURL))
27+
CHECK_LIB("nghttp2.lib", "curl", PHP_CURL))
3128
) {
29+
if (!(CHECK_HEADER_ADD_INCLUDE("brotli/decode.h", "CFLAGS_CURL") &&
30+
CHECK_LIB("brotlidec.lib;brotlidec-static.lib", "curl", PHP_CURL) &&
31+
CHECK_LIB("brotlicommon.lib;brotlicommon-static.lib", "curl", PHP_CURL)
32+
)) {
33+
WARNING("brotli in curl not enabled; libraries or headers not found");
34+
}
35+
if (!(CHECK_LIB("libzstd.lib;libzstd_a.lib", "curl", PHP_CURL)
36+
)) {
37+
WARNING("zstd in curl not enabled; library not found");
38+
}
3239
EXTENSION("curl", "interface.c multi.c share.c curl_file.c");
3340
AC_DEFINE('HAVE_CURL', 1, 'Have cURL library');
3441
ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB /D PHP_CURL_EXPORTS=1");

0 commit comments

Comments
 (0)