From 6fc91f6d3af1d9976cdba8e6d757d56b1c8d3b54 Mon Sep 17 00:00:00 2001 From: Greg Rowe Date: Sun, 26 Feb 2017 17:39:12 -0500 Subject: configure: fix --with-zlib when a path is specified Prior to this change if you attempted to configure curl using --wtih-zlib and specified a path the path would be ignored if you also had pkg-config installed on your system. This situation can easily arise when you are cross compiling. This change moves the test for detecting zlib settings via pkg-config only if OPT_ZLIB is not set. Closes https://github.com/curl/curl/pull/1292 --- configure.ac | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 5c77b0f4c..abd0def36 100644 --- a/configure.ac +++ b/configure.ac @@ -893,17 +893,16 @@ else OPT_ZLIB="" fi - CURL_CHECK_PKGCONFIG(zlib) - - if test "$PKGCONFIG" != "no" ; then - LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS" - LDFLAGS="`$PKGCONFIG --libs-only-L zlib` $LDFLAGS" - CPPFLAGS="`$PKGCONFIG --cflags-only-I zlib` $CPPFLAGS" - OPT_ZLIB="" - HAVE_LIBZ="1" - fi - if test -z "$OPT_ZLIB" ; then + CURL_CHECK_PKGCONFIG(zlib) + + if test "$PKGCONFIG" != "no" ; then + LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS" + LDFLAGS="`$PKGCONFIG --libs-only-L zlib` $LDFLAGS" + CPPFLAGS="`$PKGCONFIG --cflags-only-I zlib` $CPPFLAGS" + OPT_ZLIB="" + HAVE_LIBZ="1" + fi if test -z "$HAVE_LIBZ"; then -- cgit v1.2.3