diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2018-12-26 14:40:30 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-12-26 16:59:24 +0100 |
commit | e595f5cd8a4a00ca04e36ba1e78f14805dbecead (patch) | |
tree | 15a7462e9e0da0e444a984f4f1aec5e3d56fcf58 | |
parent | df850bf2d2c16798e9877aaf36780493fbf47c82 (diff) | |
download | php-git-e595f5cd8a4a00ca04e36ba1e78f14805dbecead.tar.gz |
Migrate ext/zlib to use pkg-config
There are other extensions checking for zlib as well, not quite
sure what to do there with regard to option names.
-rw-r--r-- | ext/curl/config.m4 | 4 | ||||
-rw-r--r-- | ext/zlib/config0.m4 | 63 |
2 files changed, 9 insertions, 58 deletions
diff --git a/ext/curl/config.m4 b/ext/curl/config.m4 index 3ec89c1f71..876e931e04 100644 --- a/ext/curl/config.m4 +++ b/ext/curl/config.m4 @@ -7,10 +7,8 @@ if test "$PHP_CURL" != "no"; then PKG_CHECK_MODULES([CURL], [libcurl >= 7.15.5]) PKG_CHECK_VAR([CURL_FEATURES], [libcurl], [supported_features]) - dnl common stuff (pkg-config / curl-config) - PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD) - PHP_EVAL_INCLINE($CURL_CFLAGS, CURL_SHARED_LIBADD) + PHP_EVAL_INCLINE($CURL_CFLAGS) AC_MSG_CHECKING([for SSL support in libcurl]) case "$CURL_FEATURES" in diff --git a/ext/zlib/config0.m4 b/ext/zlib/config0.m4 index 71fe7a7a36..1c6b68aa9f 100644 --- a/ext/zlib/config0.m4 +++ b/ext/zlib/config0.m4 @@ -1,63 +1,16 @@ dnl config.m4 for extension zlib PHP_ARG_WITH(zlib,for ZLIB support, -[ --with-zlib[=DIR] Include ZLIB support (requires zlib >= 1.2.0.4)]) +[ --with-zlib Include ZLIB support (requires zlib >= 1.2.0.4)]) -PHP_ARG_WITH(zlib-dir,if the location of ZLIB install directory is defined, -[ --with-zlib-dir=<DIR> Define the location of zlib install directory], no, no) +if test "$PHP_ZLIB" != "no"; then + PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0.4]) -if test "$PHP_ZLIB" != "no" || test "$PHP_ZLIB_DIR" != "no"; then - PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c zlib_filter.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) - PHP_SUBST(ZLIB_SHARED_LIBADD) - - if test "$PHP_ZLIB" != "yes" -a "$PHP_ZLIB" != "no"; then - if test -f $PHP_ZLIB/include/zlib/zlib.h; then - ZLIB_DIR=$PHP_ZLIB - ZLIB_INCDIR=$ZLIB_DIR/include/zlib - elif test -f $PHP_ZLIB/include/zlib.h; then - ZLIB_DIR=$PHP_ZLIB - ZLIB_INCDIR=$ZLIB_DIR/include - fi - else - for i in /usr/local /usr $PHP_ZLIB_DIR; do - if test -f $i/include/zlib/zlib.h; then - ZLIB_DIR=$i - ZLIB_INCDIR=$i/include/zlib - elif test -f $i/include/zlib.h; then - ZLIB_DIR=$i - ZLIB_INCDIR=$i/include - fi - done - fi - - if test -z "$ZLIB_DIR"; then - AC_MSG_ERROR(Cannot find zlib) - fi - - case $ZLIB_DIR in - /usr) ac_extra= ;; - *) ac_extra=-L$ZLIB_DIR/$PHP_LIBDIR ;; - esac + PHP_EVAL_LIBLINE($ZLIB_LIBS, ZLIB_SHARED_LIBADD) + PHP_EVAL_INCLINE($ZLIB_CFLAGS) - AC_MSG_CHECKING([for zlib version >= 1.2.0.4]) - ZLIB_VERSION=`$EGREP "define ZLIB_VERSION" $ZLIB_INCDIR/zlib.h | $SED -e 's/[[^0-9\.]]//g'` - AC_MSG_RESULT([$ZLIB_VERSION]) - if test `echo $ZLIB_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*1000000 + $2*10000 + $3*100 + $4}'` -lt 1020004; then - AC_MSG_ERROR([zlib version greater or equal to 1.2.0.4 required]) - fi - - PHP_CHECK_LIBRARY(z, gzgets, [ - AC_DEFINE(HAVE_ZLIB,1,[ ]) - ],[ - AC_MSG_ERROR(ZLIB extension requires gzgets in zlib) - ],[ - $ac_extra - ]) - - PHP_ADD_LIBPATH($ZLIB_DIR/$PHP_LIBDIR, ZLIB_SHARED_LIBADD) - - PHP_ZLIB_DIR=$ZLIB_DIR - PHP_ADD_LIBRARY(z,, ZLIB_SHARED_LIBADD) - PHP_ADD_INCLUDE($ZLIB_INCDIR) + AC_DEFINE(HAVE_ZLIB,1,[ ]) + PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c zlib_filter.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) + PHP_SUBST(ZLIB_SHARED_LIBADD) fi |