Plumb WITH_ZLIB into configure.

This allows zlib support to be disabled by ./configure --without-zlib.
This commit is contained in:
Darren Tucker 2020-01-23 22:16:51 +11:00
parent 7f8e66fea8
commit 633a2af47e

View File

@ -1287,11 +1287,12 @@ AC_CHECK_FUNC([getspnam], ,
AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1],
[Define if you have the basename function.])])
dnl zlib is required
dnl zlib defaults to enabled
zlib=yes
AC_ARG_WITH([zlib],
[ --with-zlib=PATH Use zlib in PATH],
[ if test "x$withval" = "xno" ; then
AC_MSG_ERROR([*** zlib is required ***])
zlib=no
elif test "x$withval" != "xyes"; then
if test -d "$withval/lib"; then
if test -n "${rpath_opt}"; then
@ -1314,6 +1315,12 @@ AC_ARG_WITH([zlib],
fi ]
)
AC_MSG_CHECKING([for zlib])
if test "x${zlib}" = "xno"; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
AC_DEFINE([WITH_ZLIB], [1], [Enable zlib])
AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])])
AC_CHECK_LIB([z], [deflate], ,
[
@ -1384,6 +1391,7 @@ See http://www.gzip.org/zlib/ for details.])
],
[ AC_MSG_WARN([cross compiling: not checking zlib version]) ]
)
fi
dnl UnixWare 2.x
AC_CHECK_FUNC([strcasecmp],