]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
configure: detect zlib with our pkg-config macros
authorDaniel Stenberg <daniel@haxx.se>
Wed, 24 Aug 2016 11:49:53 +0000 (13:49 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 25 Aug 2016 06:47:43 +0000 (08:47 +0200)
... instead of relying on the pkg-config autoconf macros to be present.

Fixes #972 (again...)

configure.ac

index 5e769301e15a703511242c9a4e6cb7591a310098..083e18c950d893e3c02c5b6315b641f0fb215c52 100644 (file)
@@ -891,17 +891,17 @@ else
     OPT_ZLIB=""
   fi
 
-  if test -z "$OPT_ZLIB" ; then
+  CURL_CHECK_PKGCONFIG(zlib)
 
-    m4_ifdef([PKG_CHECK_MODULES], [
-      PKG_CHECK_MODULES([ZLIB], [zlib],
-        [ LIBS="${ZLIB_LIBS} $LIBS"
-          CPPFLAGS="${ZLIB_CFLAGS} $CPPFLAGS"
-          HAVE_LIBZ="1"
-        ],
-        [
-        ])
-    ])
+  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
 
     if test -z "$HAVE_LIBZ"; then