Skip to content

Define HAVE_ZLIB for myslnd #5655

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
4 changes: 3 additions & 1 deletion ext/mysqlnd/config9.m4
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ if test "$PHP_MYSQLND" != "no" || test "$PHP_MYSQLND_ENABLED" = "yes"; then


if test "$PHP_MYSQLND_COMPRESSION_SUPPORT" != "no"; then
PKG_CHECK_MODULES([ZLIB], [zlib])
PKG_CHECK_MODULES([ZLIB], [zlib], [
AC_DEFINE(HAVE_ZLIB, 1, "ZLIB support")
])
PHP_EVAL_LIBLINE($ZLIB_LIBS, MYSQLND_SHARED_LIBADD)
PHP_EVAL_INCLINE($ZLIB_CFLAGS)
AC_DEFINE([MYSQLND_COMPRESSION_WANTED], 1, [Enable compressed protocol support])
Copy link
Member

Choose a reason for hiding this comment

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

This looks unnecessarily complicated. I'd instead replace MYSQLND_COMPRESSION_WANTED here with MYSQLND_COMPRESSION_ENABLED and then drop the block at

#if defined(MYSQLND_COMPRESSION_WANTED) && defined(HAVE_ZLIB)
#define MYSQLND_COMPRESSION_ENABLED 1
#endif

There's no reason why we need both MYSQLND_COMPRESSION_WANTED and HAVE_ZLIB here. (Keep in mind that PKG_CHECK_MODULES is going to hard error if zlib is not found.)

Expand Down