]> granicus.if.org Git - curl/commitdiff
configure.ac: add zlib search with pkg-config
authorDambaev Alexander <theice@inbox.ru>
Thu, 11 Aug 2016 15:49:48 +0000 (23:49 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 12 Aug 2016 06:22:58 +0000 (08:22 +0200)
Closes #956

configure.ac

index 3c2fe270561f381282d7faa4324809e9b6c162ee..e1dbbee84a89ce532da10e3dbfcb7b6b6684e8a5 100644 (file)
@@ -892,16 +892,26 @@ else
   fi
 
   if test -z "$OPT_ZLIB" ; then
-    dnl check for the lib first without setting any new path, since many
-    dnl people have it in the default path
+    PKG_CHECK_MODULES(ZLIB, zlib,
+        [ LIBS="${ZLIB_LIBS} $LIBS"
+          CPPFLAGS="${ZLIB_CFLAGS} $CPPFLAGS"
+          HAVE_LIBZ="1"
+        ],
+        [
+        ])
+
+    if test -z "$HAVE_LIBZ"; then
 
-    AC_CHECK_LIB(z, inflateEnd,
+      dnl Check for the lib without setting any new path, since many
+      dnl people have it in the default path
+
+      AC_CHECK_LIB(z, inflateEnd,
                    dnl libz found, set the variable
                    [HAVE_LIBZ="1"
                     LIBS="-lz $LIBS"],
                    dnl if no lib found, try /usr/local
                    [OPT_ZLIB="/usr/local"])
-
+    fi
   fi
 
   dnl Add a nonempty path to the compiler flags