diff options
author | Dambaev Alexander <theice@inbox.ru> | 2016-08-11 23:49:48 +0800 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-08-12 08:22:58 +0200 |
commit | c2f9b78afe15bfb9e0fa89bbb93e7b4aafd9d7b4 (patch) | |
tree | 0b192f54593742dfe7dd9875bc0cb6b5d024bdc3 /configure.ac | |
parent | 2c8ccdac14f87464e2a15eb7bab0d77c08dec2cf (diff) | |
download | curl-c2f9b78afe15bfb9e0fa89bbb93e7b4aafd9d7b4.tar.gz |
configure.ac: add zlib search with pkg-config
Closes #956
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 3c2fe2705..e1dbbee84 100644 --- a/configure.ac +++ b/configure.ac @@ -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 |