Skip to content

Fix GH-17855: CURL_STATICLIB flag set even if linked with shared lib #17857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ext/curl/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand All @@ -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 {
Expand Down
Loading