1
dnl Available from the GNU Autoconf Macro Archive at:
2
dnl http://www.gnu.org/software/ac-archive/htmldoc/check_zlib.html
8
[AC_MSG_CHECKING(if zlib is wanted)
10
[ --with-zlib=DIR root directory path of zlib installation [defaults to
11
/usr/local or /usr if not found in /usr/local]
12
--without-zlib to disable zlib usage completely],
13
[if test "$withval" != no ; then
21
if test ! -f "${ZLIB_HOME}/include/zlib.h"
28
# Locate zlib, if wanted
30
if test -n "${ZLIB_HOME}"
32
ZLIB_OLD_LDFLAGS=$LDFLAGS
33
ZLIB_OLD_CPPFLAGS=$LDFLAGS
34
LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
35
CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
38
AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
39
AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cvs_zlib_h=no])
41
if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes"
44
# If both library and header were found, use them
46
AC_CHECK_LIB(z, inflateEnd)
47
AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
51
# If either header or library was not found, revert and bomb
53
AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
54
LDFLAGS="$ZLIB_OLD_LDFLAGS"
55
CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
57
AC_MSG_ERROR(either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib)