1
0
mirror of https://github.com/moparisthebest/curl synced 2025-03-11 07:39:50 -04:00

rewrote the --with-zlib check, based on Albert Chin's input.

This commit is contained in:
Daniel Stenberg 2002-10-08 12:53:04 +00:00
parent db2fea448c
commit e157aabd4d

View File

@ -481,9 +481,9 @@ else
OPENSSL_ENABLED=1) OPENSSL_ENABLED=1)
fi fi
dnl Check for the OpenSSL engine header, it is kind of "separated" dnl If the ENGINE library seems to be around, check for the OpenSSL engine
dnl from the main SSL check dnl header, it is kind of "separated" from the main SSL check
AC_CHECK_HEADERS(openssl/engine.h) AC_CHECK_FUNC(ENGINE_init, AC_CHECK_HEADERS(openssl/engine.h))
AC_SUBST(OPENSSL_ENABLED) AC_SUBST(OPENSSL_ENABLED)
@ -509,34 +509,42 @@ dnl **********************************************************************
dnl Check for & handle argument to --with-zlib. dnl Check for & handle argument to --with-zlib.
OPT_ZLIB="yes" _cppflags=$CPPFLAGS
AC_ARG_WITH(libz, _ldflags=$LDFLAGS
AC_HELP_STRING([--with-libz=PATH], [where to look for zlib]) OPT_ZLIB="/usr/local"
AC_HELP_STRING([--without-libz], [disable zlib]), AC_ARG_WITH(zlib,
[ OPT_ZLIB="$withval" ]) AC_HELP_STRING([--with-zlib=PATH], [search for zlib in PATH])
AC_HELP_STRING([--without-zlib], [disable use of zlib]),
[OPT_ZLIB="$withval"])
if test -n "$OPT_ZLIB" case "$OPT_ZLIB" in
then no)
if test X"$OPT_ZLIB" != Xno AC_MSG_WARN([zlib disabled]) ;;
then *)
AC_MSG_CHECKING(for zlib in) dnl check for the lib first without setting any new path, since many
test X"$OPT_ZLIB" = Xyes && OPT_ZLIB=/usr/local dnl people have it in the default path
LIBS="$LIBS -L$OPT_ZLIB/lib"
CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
AC_MSG_RESULT([$OPT_ZLIB])
fi
fi
if test X"$OPT_ZLIB" != Xno AC_CHECK_LIB(z, inflateEnd, ,
then [if test -d "$OPT_ZLIB"; then
AC_CHECK_LIB(z, gzread, [AM_CONDITIONAL(CONTENT_ENCODING, true) CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
AC_DEFINE(HAVE_LIBZ) LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib"
LIBS="$LIBS -lz" fi])
HAVE_LIBZ="1"
AC_SUBST(HAVE_LIBZ)]) AC_CHECK_HEADER(zlib.h,[
else AC_CHECK_LIB(z, gzread,
AC_MSG_WARN([zlib usage deliberately disabled]) [AM_CONDITIONAL(CONTENT_ENCODING, true)
fi HAVE_LIBZ="1"
AC_SUBST(HAVE_LIBZ)
LIBS="$LIBS -lz"
AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
AC_DEFINE(HAVE_LIBZ, 1, [If zlib is available])],
[ CPPFLAGS=$_cppflags
LDFLAGS=$_ldflags])],
[ CPPFLAGS=$_cppflags
LDFLAGS=$_ldflags]
)
;;
esac
dnl Default is to try the thread-safe versions of a few functions dnl Default is to try the thread-safe versions of a few functions
OPT_THREAD=on OPT_THREAD=on
@ -606,9 +614,6 @@ AC_CHECK_HEADERS( \
setjmp.h setjmp.h
) )
dnl Check for libz header
AC_CHECK_HEADERS(zlib.h)
dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST AC_C_CONST
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
@ -768,4 +773,3 @@ AC_CONFIG_FILES([Makefile \
curl-config curl-config
]) ])
AC_OUTPUT AC_OUTPUT