Skip to content

Commit 9998337

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Fix GH-17855: CURL_STATICLIB flag set even if linked with shared lib
2 parents 7063b01 + 07a3719 commit 9998337

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ext/curl/config.w32

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
ARG_WITH("curl", "cURL support", "no");
44

55
if (PHP_CURL != "no") {
6-
if (CHECK_LIB("libcurl_a.lib;libcurl.lib", "curl", PHP_CURL) &&
6+
var curl_location;
7+
if ((curl_location = CHECK_LIB("libcurl_a.lib;libcurl.lib", "curl", PHP_CURL)) &&
78
CHECK_HEADER_ADD_INCLUDE("curl/easy.h", "CFLAGS_CURL") &&
89
SETUP_OPENSSL("curl", PHP_CURL) >= 2 &&
910
CHECK_LIB("winmm.lib", "curl", PHP_CURL) &&
@@ -15,7 +16,10 @@ if (PHP_CURL != "no") {
1516
) {
1617
EXTENSION("curl", "interface.c multi.c share.c curl_file.c");
1718
AC_DEFINE('HAVE_CURL', 1, "Define to 1 if the PHP extension 'curl' is available.");
18-
ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB /D PHP_CURL_EXPORTS=1");
19+
ADD_FLAG("CFLAGS_CURL", "/D PHP_CURL_EXPORTS=1");
20+
if (curl_location.match(/libcurl_a\.lib$/)) {
21+
ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB");
22+
}
1923
PHP_INSTALL_HEADERS("ext/curl", "php_curl.h");
2024
} else {
2125
WARNING("curl not enabled; libraries and headers not found");

0 commit comments

Comments
 (0)