Skip to content

Commit

Permalink
configure.ac: add zlib search with pkg-config
Browse files Browse the repository at this point in the history
Closes curl#956
  • Loading branch information
dambaev authored and bagder committed Aug 12, 2016
1 parent 2c8ccda commit c2f9b78
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c2f9b78

Please sign in to comment.