Skip to content

Factor out SETUP_ZLIB_LIB() #16798

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

Merged
merged 5 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 1 addition & 2 deletions ext/curl/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ if (PHP_CURL != "no") {
SETUP_OPENSSL("curl", PHP_CURL) >= 2 &&
CHECK_LIB("winmm.lib", "curl", PHP_CURL) &&
CHECK_LIB("wldap32.lib", "curl", PHP_CURL) &&
(((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "curl", PHP_CURL))) ||
(PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "curl", PHP_CURL)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) &&
SETUP_ZLIB_LIB("curl", PHP_CURL) &&
(CHECK_LIB("normaliz.lib", "curl", PHP_CURL) &&
CHECK_LIB("libssh2.lib", "curl", PHP_CURL) &&
CHECK_LIB("nghttp2.lib", "curl", PHP_CURL))
Expand Down
4 changes: 2 additions & 2 deletions ext/gd/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ if (PHP_GD != "no") {
CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng12")) &&
(CHECK_LIB("libiconv_a.lib;libiconv.lib", "gd", PHP_GD) || CHECK_LIB("iconv_a.lib;iconv.lib", "gd", PHP_GD)) &&
CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_GD", PHP_GD) &&
(((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "gd", PHP_GD) )) ||
(PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "gd", PHP_GD)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED)))
SETUP_ZLIB_LIB("gd", PHP_GD) &&
CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects)
) {

if (CHECK_LIB("libXpm_a.lib", "gd", PHP_GD) &&
Expand Down
7 changes: 2 additions & 5 deletions ext/mysqlnd/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@ if (PHP_MYSQLND != "no") {
"mysqlnd_wireprotocol.c " +
"php_mysqlnd.c ";
EXTENSION("mysqlnd", mysqlnd_source, false, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
if ((((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "mysqlnd", PHP_MYSQLND))) ||
(PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "mysqlnd", PHP_MYSQLND)) ||
(PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) &&
if (SETUP_ZLIB_LIB("mysqlnd", PHP_MYSQLND) &&
CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects)
)
{
) {
AC_DEFINE("MYSQLND_COMPRESSION_ENABLED", 1, "Define to 1 if mysqlnd has compressed protocol support.");
AC_DEFINE("MYSQLND_SSL_SUPPORTED", 1, "Define to 1 if mysqlnd core SSL is enabled.");
if (CHECK_LIB("crypt32.lib", "mysqlnd")) {
Expand Down
6 changes: 6 additions & 0 deletions win32/build/confutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3626,6 +3626,12 @@ function ADD_MAKEFILE_FRAGMENT(src_file)
}
}

function SETUP_ZLIB_LIB(target, path_to_check)
{
return ((PHP_ZLIB == "no" || PHP_ZLIB_SHARED) && CHECK_LIB("zlib_a.lib;zlib.lib", target, path_to_check)) ||
(PHP_ZLIB == "yes" && !PHP_ZLIB_SHARED);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might need some explanation. zlib (like a couple of other extensions) is a bit special, because if PHP with zlib as static extension, php8.dll provides the functions as if they had been built as shared extension. Thus, there is no need to involve zlib.lib.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct; see #16801 (comment).

}

function SETUP_OPENSSL(target, path_to_check, common_name, use_env, add_dir_part, add_to_flag_only)
{
var ret = 0;
Expand Down