2 changed files with 41 additions and 34 deletions
@ -1,5 +1,7 @@ |
|||
|
|||
LTLIBRARY_NAME = libzlib.la |
|||
LTLIBRARY_SOURCES = zlib.c |
|||
LTLIBRARY_SHARED_NAME = zlib.la |
|||
LTLIBRARY_SHARED_LIBADD = $(ZLIB_SHARED_LIBADD) |
|||
|
|||
include $(top_srcdir)/build/dynlib.mk |
|||
@ -1,38 +1,43 @@ |
|||
dnl $Id$ |
|||
|
|||
AC_MSG_CHECKING(whether to include zlib support) |
|||
AC_ARG_WITH(zlib, |
|||
|
|||
|
|||
PHP_ARG_WITH(zlib,whether to include zlib support, |
|||
[ --with-zlib[=DIR] Include zlib support (requires zlib >= 1.0.9). |
|||
DIR is the zlib install directory, |
|||
defaults to /usr.], |
|||
[ |
|||
case "$withval" in |
|||
no) |
|||
AC_MSG_RESULT(no) ;; |
|||
yes) |
|||
AC_MSG_RESULT(yes) |
|||
PHP_EXTENSION(zlib) |
|||
AC_CHECK_LIB(z, gzgets, [AC_DEFINE(HAVE_ZLIB,1,[ ])], |
|||
[AC_MSG_ERROR(Zlib module requires zlib >= 1.0.9.)]) |
|||
AC_ADD_LIBRARY(z) |
|||
;; |
|||
*) |
|||
test -f $withval/include/zlib/zlib.h && ZLIB_INCLUDE="$withval/include/zlib" |
|||
test -f $withval/include/zlib.h && ZLIB_INCLUDE="$withval/include" |
|||
if test -n "$ZLIB_INCLUDE" ; then |
|||
AC_MSG_RESULT(yes) |
|||
PHP_EXTENSION(zlib) |
|||
old_LIBS=$LIBS |
|||
LIBS="$LIBS -L$withval/lib" |
|||
AC_CHECK_LIB(z, gzgets, [AC_DEFINE(HAVE_ZLIB,1,[ ])], |
|||
[AC_MSG_ERROR(Zlib module requires zlib >= 1.0.9.)]) |
|||
LIBS=$old_LIBS |
|||
AC_ADD_LIBRARY_WITH_PATH(z, $withval/lib) |
|||
AC_ADD_INCLUDE($ZLIB_INCLUDE) |
|||
else |
|||
AC_MSG_RESULT(no) |
|||
fi ;; |
|||
esac |
|||
],[ |
|||
AC_MSG_RESULT(no) |
|||
]) |
|||
defaults to /usr.]) |
|||
|
|||
if test "$PHP_ZLIB" != "no"; then |
|||
PHP_EXTENSION(zlib, $ext_shared) |
|||
for i in /usr/local /usr $PHP_ZLIB; 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 |
|||
|
|||
if test -z "$ZLIB_DIR"; then |
|||
AC_MSG_ERROR(Cannot find libz) |
|||
fi |
|||
|
|||
ZLIB_LIBDIR=$ZLIB_DIR/lib |
|||
|
|||
old_LDFLAGS="$LDFLAGS" |
|||
old_LIBS="$LIBS" |
|||
AC_CHECK_LIB(z, gzgets, [AC_DEFINE(HAVE_ZLIB,1,[ ])], |
|||
[AC_MSG_ERROR(Zlib module requires zlib >= 1.0.9.)]) |
|||
LIBS="$old_LIBS" |
|||
LDFLAGS="$old_LDFLAGS" |
|||
|
|||
if test "$ext_shared" = "yes"; then |
|||
ZLIB_SHARED_LIBADD="-R$ZLIB_LIBDIR -L$ZLIB_LIBDIR -lz" |
|||
PHP_SUBST(ZLIB_SHARED_LIBADD) |
|||
else |
|||
AC_ADD_LIBRARY_WITH_PATH(z, $ZLIB_LIBDIR) |
|||
fi |
|||
|
|||
AC_ADD_INCLUDE($ZLIB_INCLUDE) |
|||
fi |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue