From 297d040ce1436ffc8a23ce59a10df978cdbc2afa Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 27 Oct 2014 14:55:21 -0400 Subject: [PATCH] use pkg-config to check zlib deps if available Newer versions of these packages ship with pkg-config files, so if we can detect it via those, do so. If that fails, fall back to the old methods. --- ChangeLog | 5 +++++ configure.ac | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 078a65fc..a4257993 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-11-01 Mike Frysinger + + * configure.ac: Use pkg-config to check for zlib presence and + fallback to the previous code if that doesn't work. + 2014-07-28 Ángel González * contrib: Created contrib folder. * contrib/tsocked-wget: Added wrapper for usage with socks proxy. diff --git a/configure.ac b/configure.ac index 88401cf6..23048ba3 100644 --- a/configure.ac +++ b/configure.ac @@ -263,9 +263,17 @@ dnl dnl Checks for libraries. dnl +PKG_PROG_PKG_CONFIG + AS_IF([test x"$with_zlib" != xno], [ with_zlib=yes - AC_CHECK_LIB(z, compress) + PKG_CHECK_MODULES([ZLIB], zlib, [ + LIBS="$ZLIB_LIBS $LIBS" + CFLAGS="$ZLIB_CFLAGS $CFLAGS" + AC_DEFINE([HAVE_LIBZ], [1], [Define if using zlib.]) + ], [ + AC_CHECK_LIB(z, compress) + ]) ]) AS_IF([test x"$with_ssl" = xopenssl], [