A few modifications to make the ZLIB checks work better.

This commit is contained in:
foobar 2001-05-20 23:00:44 +00:00
parent ae503d3a14
commit 4e545c1d73
4 changed files with 71 additions and 67 deletions

View File

@ -55,22 +55,12 @@ if test "$PHP_DOM" != "no"; then
PHP_SUBST(DOMXML_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH($DOM_LIBNAME, $DOMXML_DIR/lib, DOMXML_SHARED_LIBADD)
if test "$PHP_ZLIB" = "no"; then
AC_MSG_CHECKING([for zlib (needed by DOM support)])
AC_CHECK_LIB(z,deflate, [
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, DOMXML_SHARED_LIBADD)
],[
AC_MSG_ERROR(libz.(a|so) not found! Try with --with-zlib-dir=<DIR>)
],[
-L$PHP_ZLIB_DIR/lib
])
else
echo "checking for libz needed by libxml ... already zlib support"
PHP_ADD_LIBRARY(z,, DOMXML_SHARED_LIBADD)
if test "$PHP_ZLIB_DIR" = "no"; then
AC_MSG_ERROR(DOMXML requires ZLIB. Use --with-zlib-dir=<DIR>)
fi
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, DOMXML_SHARED_LIBADD)
AC_DEFINE(HAVE_DOMXML,1,[ ])
PHP_EXTENSION(domxml, $ext_shared)
fi

View File

@ -6,12 +6,14 @@ AC_DEFUN(PHP_GD_JPEG,[
PHP_ARG_WITH(jpeg-dir, for the location of libjpeg,
[ --with-jpeg-dir=DIR GD: Set the path to libjpeg install prefix.])
if test "$PHP_JPEG_DIR" != "no" -a "$PHP_JPEG_DIR"; then
if test "$PHP_JPEG_DIR" != "no"; then
if test "$PHP_JPEG_DIR" = "yes"; then
PHP_JPEG_DIR=/usr/local
fi
AC_CHECK_LIB(jpeg,jpeg_read_header,[
AC_CHECK_LIB(jpeg,jpeg_read_header,
[
PHP_ADD_LIBRARY_WITH_PATH(jpeg, $PHP_JPEG_DIR/lib, GD_SHARED_LIBADD)
],[
AC_MSG_ERROR(libjpeg not found!)
@ -27,12 +29,18 @@ AC_DEFUN(PHP_GD_PNG,[
PHP_ARG_WITH(png-dir, for the location of libpng,
[ --with-png-dir=DIR GD: Set the path to libpng install prefix.])
if test "$PHP_PNG_DIR" != "no" -a "$PHP_PNG_DIR"; then
if test "$PHP_PNG_DIR" != "no"; then
if test "$PHP_PNG_DIR" = "yes"; then
PHP_PNG_DIR=/usr/local
fi
AC_CHECK_LIB(png,png_info_init,[
if test "$PHP_ZLIB_DIR" = "no"; then
AC_MSG_ERROR(PNG support requires ZLIB. Use --with-zlib-dir=<DIR>)
fi
AC_CHECK_LIB(png,png_info_init,
[
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, GD_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(png, $PHP_PNG_DIR/lib, GD_SHARED_LIBADD)
],[
@ -41,7 +49,7 @@ AC_DEFUN(PHP_GD_PNG,[
-L$PHP_ZLIB_DIR/lib -lz -L$PHP_PNG_DIR/lib
])
else
AC_MSG_RESULT(If configure fails try --with-png-dir=<DIR>)
AC_MSG_RESULT(If configure fails try --with-png-dir=<DIR> and --with-zlib-dir=<DIR>)
fi
])
@ -49,12 +57,13 @@ AC_DEFUN(PHP_GD_XPM,[
PHP_ARG_WITH(xpm-dir, for the location of libXpm,
[ --with-xpm-dir=DIR GD: Set the path to libXpm install prefix.])
if test "$PHP_XPM_DIR" != "no" -a "$PHP_XPM_DIR"; then
if test "$PHP_XPM_DIR" != "no"; then
if test "$PHP_XPM_DIR" = "yes"; then
PHP_XPM_DIR=/usr/local
fi
AC_CHECK_LIB(Xpm,XpmFreeXpmImage, [
AC_CHECK_LIB(Xpm,XpmFreeXpmImage,
[
PHP_ADD_LIBRARY_WITH_PATH(Xpm, $PHP_XPM_DIR/lib, GD_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(X11, $PHP_XPM_DIR/lib, GD_SHARED_LIBADD)
],[
@ -136,7 +145,8 @@ AC_DEFUN(PHP_GD_T1LIB,[
done
if test "$T1_DIR" != "no"; then
AC_CHECK_LIB(t1, T1_GetExtend, [
AC_CHECK_LIB(t1, T1_GetExtend,
[
AC_DEFINE(HAVE_LIBT1,1,[ ])
PHP_ADD_INCLUDE("$T1_DIR/include")
PHP_ADD_LIBRARY_WITH_PATH(t1, "$T1_DIR/lib", GD_SHARED_LIBADD)

View File

@ -33,26 +33,16 @@ if test "$PHP_PDFLIB" != "no"; then
test -f $PHP_PDFLIB/include/pdflib.h && PDFLIB_INCLUDE=$PHP_PDFLIB/include
if test -n "$PDFLIB_INCLUDE" ; then
if test "$PHP_ZLIB" = "no"; then
AC_MSG_CHECKING([for zlib (needed by pdflib)])
AC_CHECK_LIB(z,deflate,
[
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, PDFLIB_SHARED_LIBADD)
],[
AC_MSG_ERROR(libz.(a|so) not found! Try with --with-zlib-dir=<DIR>)
],[
-L$PHP_ZLIB_DIR/lib
])
else
echo "checking for libz needed by pdflib... already zlib support"
if test "$PHP_ZLIB_DIR" = "no"; then
AC_MSG_ERROR(PDF extension requires ZLIB. Use --with-zlib-dir=<DIR>)
fi
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, PDFLIB_SHARED_LIBADD)
PHP_ARG_WITH(jpeg-dir, for the location of libjpeg,
[ --with-jpeg-dir[=DIR] PDFLIB: define libjpeg install directory])
if test "$PHP_JPEG_DIR" != "no" -a "$PHP_JPEG_DIR"; then
if test "$PHP_JPEG_DIR" != "no"; then
AC_CHECK_LIB(jpeg,jpeg_read_header,
[
PHP_ADD_LIBRARY_WITH_PATH(jpeg, $PHP_JPEG_DIR/lib, PDFLIB_SHARED_LIBADD)
@ -62,15 +52,19 @@ if test "$PHP_PDFLIB" != "no"; then
-L$PHP_JPEG_DIR/lib
])
else
AC_CHECK_LIB(jpeg,jpeg_read_header,[ ],[AC_MSG_RESULT(no, try --with-jpeg-dir=<DIR>)])
PHP_ADD_LIBRARY(jpeg,, PDFLIB_SHARED_LIBADD)
AC_CHECK_LIB(jpeg,jpeg_read_header,
[
PHP_ADD_LIBRARY(jpeg,, PDFLIB_SHARED_LIBADD)
],[
AC_MSG_RESULT(no, try --with-jpeg-dir=<DIR>)
])
fi
PHP_ARG_WITH(png-dir, for the location of libpng,
[ --with-png-dir[=DIR] PDFLIB: define libpng install directory])
if test "$PHP_PNG_DIR" != "no" -a "$PHP_PNG_DIR"; then
if test "$PHP_PNG_DIR" != "no"; then
AC_CHECK_LIB(png,png_create_info_struct,
[
PHP_ADD_LIBRARY_WITH_PATH(png, $PHP_PNG_DIR/lib, PDFLIB_SHARED_LIBADD)
@ -80,15 +74,19 @@ if test "$PHP_PDFLIB" != "no"; then
-L$PHP_PNG_DIR/lib
])
else
AC_CHECK_LIB(png,png_create_info_struct,[ ],[AC_MSG_RESULT(no, try --with-png-dir=<DIR>)])
PHP_ADD_LIBRARY(png,, PDFLIB_SHARED_LIBADD)
AC_CHECK_LIB(png,png_create_info_struct,
[
PHP_ADD_LIBRARY(png,, PDFLIB_SHARED_LIBADD)
],[
AC_MSG_RESULT(no, try --with-png-dir=<DIR>)
])
fi
PHP_ARG_WITH(tiff-dir, for the location of libtiff,
[ --with-tiff-dir[=DIR] PDFLIB: define libtiff install directory])
if test "$PHP_TIFF_DIR" != "no" -a "$PHP_TIFF_DIR"; then
if test "$PHP_TIFF_DIR" != "no"; then
AC_CHECK_LIB(tiff,TIFFOpen,
[
PHP_ADD_LIBRARY_WITH_PATH(tiff, $PHP_TIFF_DIR/lib, PDFLIB_SHARED_LIBADD)
@ -98,8 +96,12 @@ if test "$PHP_PDFLIB" != "no"; then
-L$PHP_TIFF_DIR/lib
])
else
AC_CHECK_LIB(tiff,TIFFOpen, ,[AC_MSG_RESULT(no, Try --with-tiff-dir=<DIR>)],)
PHP_ADD_LIBRARY(tiff,, PDFLIB_SHARED_LIBADD)
AC_CHECK_LIB(tiff,TIFFOpen,
[
PHP_ADD_LIBRARY(tiff,, PDFLIB_SHARED_LIBADD)
],[
AC_MSG_RESULT(no, Try --with-tiff-dir=<DIR>)
])
fi

View File

@ -3,7 +3,7 @@ dnl $Id$
dnl
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])
[ --with-zlib-dir=<DIR> Define the location of zlib install directory])
PHP_ARG_WITH(zlib,whether to include ZLIB support,
[ --with-zlib[=DIR] Include zlib support (requires zlib >= 1.0.9).
@ -11,41 +11,43 @@ PHP_ARG_WITH(zlib,whether to include ZLIB support,
if test "$PHP_ZLIB" != "no" -o "$PHP_ZLIB_DIR" != "no"; then
PHP_EXTENSION(zlib, $ext_shared)
PHP_SUBST(ZLIB_SHARED_LIBADD)
for i in /usr/local /usr $PHP_ZLIB_DIR $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
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
done
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 libz)
fi
ZLIB_LIBDIR=$ZLIB_DIR/lib
PHP_ADD_LIBPATH($ZLIB_DIR/lib, ZLIB_SHARED_LIBADD)
AC_CHECK_LIB(z, gzgets, [
AC_DEFINE(HAVE_ZLIB,1,[ ])
],[
AC_MSG_ERROR(Zlib module requires zlib >= 1.0.9)
AC_MSG_ERROR(ZLIB extension requires zlib >= 1.0.9)
])
PHP_SUBST(ZLIB_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(z, $ZLIB_LIBDIR, ZLIB_SHARED_LIBADD)
PHP_ZLIB_DIR=$ZLIB_DIR
PHP_ADD_LIBRARY(z,, ZLIB_SHARED_LIBADD)
PHP_ADD_INCLUDE($ZLIB_INCDIR)
PHP_FOPENCOOKIE
if test -z "$PHP_ZLIB_DIR" -o "$PHP_ZLIB_DIR" = "no"; then
if test "$PHP_ZLIB" != "yes"; then
PHP_ZLIB_DIR=$PHP_ZLIB
else
PHP_ZLIB_DIR=/usr/local
fi
fi
fi