Commit 1088c7de1a2 for php.net
commit 1088c7de1a2c7847edddc6ba8b8eb1dc47cd1991
Author: Shivam Mathur <shivam_jpr@hotmail.com>
Date: Wed May 20 19:30:16 2026 +0530
Make curl brotli and zstd optional on Windows (#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>
diff --git a/ext/curl/config.w32 b/ext/curl/config.w32
index eda7604bc11..14ae1a28ab1 100644
--- a/ext/curl/config.w32
+++ b/ext/curl/config.w32
@@ -24,11 +24,18 @@ if (PHP_CURL != "no") {
(ver_num <= parseInt("0x073b00") || ver_num > parseInt("0x073b00") &&
CHECK_LIB("normaliz.lib", "curl", PHP_CURL) &&
CHECK_LIB("libssh2.lib", "curl", PHP_CURL) &&
- CHECK_LIB("nghttp2.lib", "curl", PHP_CURL) &&
- CHECK_LIB("brotlidec.lib", "curl", PHP_CURL) &&
- CHECK_LIB("brotlicommon.lib", "curl", PHP_CURL) &&
- CHECK_LIB("libzstd.lib", "curl", PHP_CURL))
+ CHECK_LIB("nghttp2.lib", "curl", PHP_CURL))
) {
+ if (!(CHECK_HEADER_ADD_INCLUDE("brotli/decode.h", "CFLAGS_CURL") &&
+ CHECK_LIB("brotlidec.lib;brotlidec-static.lib", "curl", PHP_CURL) &&
+ CHECK_LIB("brotlicommon.lib;brotlicommon-static.lib", "curl", PHP_CURL)
+ )) {
+ WARNING("brotli in curl not enabled; libraries or headers not found");
+ }
+ if (!(CHECK_LIB("libzstd.lib;libzstd_a.lib", "curl", PHP_CURL)
+ )) {
+ WARNING("zstd in curl not enabled; library not found");
+ }
EXTENSION("curl", "interface.c multi.c share.c curl_file.c");
AC_DEFINE('HAVE_CURL', 1, 'Have cURL library');
ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB /D PHP_CURL_EXPORTS=1");