Skip to content

Commit fd57df0

Browse files
committed
add --with-zlib for library, --enable-zlib for extension
1 parent 6ba479e commit fd57df0

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

ext/standard/config.m4

+14
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,20 @@ else
265265
AC_DEFINE_UNQUOTED(PHP_USE_PHP_CRYPT_R, 0, [Whether PHP has to use its own crypt_r for blowfish, des and ext des])
266266
fi
267267

268+
dnl
269+
dnl Check for -lz
270+
dnl
271+
PHP_ARG_WITH([zlib],
272+
[for ZLIB support],
273+
[AS_HELP_STRING([--with-zlib],
274+
[Include ZLIB support (requires zlib >= 1.2.0.4)])])
275+
276+
if test "$PHP_ZLIB" != "no"; then
277+
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0.4])
278+
LIBS="-lz $LIBS"
279+
AC_DEFINE(HAVE_ZLIB,1,[ ])
280+
fi
281+
268282
dnl
269283
dnl Check for __attribute__ ((__aligned__)) support in the compiler
270284
dnl

ext/zlib/config0.m4

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
PHP_ARG_WITH([zlib],
2-
[for ZLIB support],
3-
[AS_HELP_STRING([--with-zlib],
4-
[Include ZLIB support (requires zlib >= 1.2.0.4)])])
1+
PHP_ARG_ENABLE([zlib],
2+
[whether to enable zlib extension],
3+
[AS_HELP_STRING([--enable-zlib],
4+
[Enable zlib extension])],
5+
[no])
56

67
if test "$PHP_ZLIB" != "no"; then
7-
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0.4])
8-
98
PHP_EVAL_LIBLINE($ZLIB_LIBS, ZLIB_SHARED_LIBADD)
109
PHP_EVAL_INCLINE($ZLIB_CFLAGS)
1110

12-
AC_DEFINE(HAVE_ZLIB,1,[ ])
13-
1411
PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c zlib_filter.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
1512
PHP_SUBST(ZLIB_SHARED_LIBADD)
1613
fi

0 commit comments

Comments
 (0)