2001-05-10 08:57:36 +08:00
|
|
|
dnl
|
|
|
|
dnl $Id$
|
|
|
|
dnl
|
|
|
|
|
2001-12-01 03:00:13 +08:00
|
|
|
PHP_ARG_WITH(zlib,for ZLIB support,
|
2002-10-08 05:13:46 +08:00
|
|
|
[ --with-zlib[=DIR] Include ZLIB support (requires zlib >= 1.0.9).])
|
2001-05-10 08:57:36 +08:00
|
|
|
|
2002-09-05 02:47:28 +08:00
|
|
|
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)
|
|
|
|
|
2001-05-10 08:57:36 +08:00
|
|
|
if test "$PHP_ZLIB" != "no" -o "$PHP_ZLIB_DIR" != "no"; then
|
2002-03-13 01:50:12 +08:00
|
|
|
PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c, $ext_shared)
|
2001-05-21 07:00:44 +08:00
|
|
|
PHP_SUBST(ZLIB_SHARED_LIBADD)
|
2001-05-10 08:57:36 +08:00
|
|
|
|
2001-05-21 07:00:44 +08:00
|
|
|
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
|
2001-05-10 08:57:36 +08:00
|
|
|
fi
|
2001-05-21 07:00:44 +08:00
|
|
|
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
|
|
|
|
|
2001-05-10 08:57:36 +08:00
|
|
|
if test -z "$ZLIB_DIR"; then
|
|
|
|
AC_MSG_ERROR(Cannot find libz)
|
|
|
|
fi
|
|
|
|
|
2002-10-08 06:27:50 +08:00
|
|
|
PHP_CHECK_LIBRARY(z, gzgets, [
|
2002-10-08 05:13:46 +08:00
|
|
|
AC_DEFINE(HAVE_ZLIB,1,[ ])
|
|
|
|
],[
|
|
|
|
AC_MSG_ERROR(ZLIB extension requires zlib >= 1.0.9)
|
2002-10-08 06:27:50 +08:00
|
|
|
],[
|
|
|
|
-L$ZLIB_DIR/lib
|
2002-10-08 05:13:46 +08:00
|
|
|
])
|
2002-10-08 04:59:59 +08:00
|
|
|
|
2001-05-21 07:00:44 +08:00
|
|
|
PHP_ADD_LIBPATH($ZLIB_DIR/lib, ZLIB_SHARED_LIBADD)
|
2001-05-10 08:57:36 +08:00
|
|
|
|
2001-05-21 07:00:44 +08:00
|
|
|
PHP_ZLIB_DIR=$ZLIB_DIR
|
|
|
|
PHP_ADD_LIBRARY(z,, ZLIB_SHARED_LIBADD)
|
2001-05-10 08:57:36 +08:00
|
|
|
PHP_ADD_INCLUDE($ZLIB_INCDIR)
|
|
|
|
|
|
|
|
fi
|