mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix GH-17855: CURL_STATICLIB flag set even if linked with shared lib
We must define `CURL_STATICLIB` only when building against a static libcurl. The detection relies on our usual naming conventions, what should be revised in the future (possibly using pkg-config, or switching to CMake). Closes GH-17857.
This commit is contained in:
parent
260e0e9bd3
commit
29c39a3d91
2 changed files with 8 additions and 2 deletions
2
NEWS
2
NEWS
|
@ -57,6 +57,8 @@ PHP NEWS
|
|||
|
||||
- Windows:
|
||||
. Fixed phpize for Windows 11 (24H2). (bwoebi)
|
||||
. Fixed GH-17855 (CURL_STATICLIB flag set even if linked with shared lib).
|
||||
(cmb)
|
||||
|
||||
- Zlib:
|
||||
. Fixed bug GH-17745 (zlib extension incorrectly handles object arguments).
|
||||
|
|
|
@ -13,7 +13,8 @@ if (PHP_CURL != "no") {
|
|||
}
|
||||
}
|
||||
|
||||
if (CHECK_LIB("libcurl_a.lib;libcurl.lib", "curl", PHP_CURL) &&
|
||||
var curl_location;
|
||||
if ((curl_location = CHECK_LIB("libcurl_a.lib;libcurl.lib", "curl", PHP_CURL)) &&
|
||||
CHECK_HEADER_ADD_INCLUDE("curl/easy.h", "CFLAGS_CURL") &&
|
||||
SETUP_OPENSSL("curl", PHP_CURL) > 0 &&
|
||||
CHECK_LIB("winmm.lib", "curl", PHP_CURL) &&
|
||||
|
@ -28,7 +29,10 @@ if (PHP_CURL != "no") {
|
|||
) {
|
||||
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");
|
||||
ADD_FLAG("CFLAGS_CURL", "/D PHP_CURL_EXPORTS=1");
|
||||
if (curl_location.match(/libcurl_a\.lib$/)) {
|
||||
ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB");
|
||||
}
|
||||
PHP_INSTALL_HEADERS("ext/curl", "php_curl.h");
|
||||
// TODO: check for curl_version_info
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue