Use pkg-config to check for zlib

This commit is contained in:
Thomas D 2014-12-12 16:10:40 +01:00
parent 051a8d55a2
commit 2709ac1256

View File

@ -231,14 +231,16 @@ if test "$enable_regexp" = "yes"; then
fi
AC_CHECK_HEADER(zlib.h, [zlib_header="yes"], [zlib_header="no" enable_zlib="false"])
if test "$zlib_header" = "yes"; then
AC_CHECK_LIB(z, deflate,
[AC_DEFINE(USE_NETZIP, 1, [Define if you want to enable zlib support])
ZLIB_LIBS="-lz"
AC_SUBST(ZLIB_LIBS)], enable_zlib="false")
fi
# zlib support
PKG_CHECK_MODULES([ZLIB], [zlib], [found_zlib=yes], [found_zlib=no])
AS_IF([test "x$found_zlib" = "xno"], [
AC_SEARCH_LIBS([inflate], [z], [AC_CHECK_HEADER([zlib.h], [found_zlib=yes])])
if test "x$found_zlib" = "xno" ; then
AC_MSG_ERROR([zlib library and headers not found])
fi
ZLIB_LIBS="-lz"
AC_SUBST(ZLIB_LIBS)
])
#gssapi