summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2014-09-06 03:03:46 +0200
committerVijay Bellur <vbellur@redhat.com>2014-09-07 23:16:11 -0700
commite3817aa6cab71e42f7e611d75abf0f433b88d907 (patch)
tree39ce323b59ddc76f5c54f317c240679c9cdb0de7 /configure.ac
parent2efe31d4def8bd9170d000d0c4a05a4d00633805 (diff)
Search zlib without pkg-config
NetBSD has zlib installed in base system and no .pc file for it. In order to discover it, fallback to AC_CHECK_LIB is PKG_CHECK_MODULES fail to find it. This is a backport of Ide84402aa38edc2709d12e2530401c6b8c722529 and I34ded175f056d1a0898804fe602e3d2d2cba27f5 BUG: 1138897 Change-Id: I14a3ab987cf2bedd3d1d00145466647fb646795b Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8628 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 12 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 8c53d02851b..583f500e961 100644
--- a/configure.ac
+++ b/configure.ac
@@ -585,13 +585,18 @@ AC_SUBST(SYNCDAEMON_COMPILE)
AC_SUBST(SYNCDAEMON_SUBDIR)
# end SYNCDAEMON section
-# CDC xlator - check if libz is present if so enable HAVE_LIB_Z
-echo -n "checking if libz is present... "
-
-PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0],
- [echo "yes (features requiring zlib enabled)" AC_DEFINE(HAVE_LIB_Z, 1, [define if zlib is present])],
- [echo "no"] )
-
+# CDC xlator - check if libz is present if so enable HAVE_LIB_Z
+BUILD_CDC=yes
+PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0],,
+ [AC_CHECK_LIB([z], [deflate], [ZLIB_LIBS="-lz"],
+ [BUILD_CDC=no])])
+echo -n "features requiring zlib enabled: "
+if test "x$BUILD_CDC" = "xyes" ; then
+ echo "yes"
+ AC_DEFINE(HAVE_LIB_Z, 1, [define if zlib is present])
+else
+ echo "no"
+fi
AC_SUBST(LIBZ_CFLAGS)
AC_SUBST(LIBZ_LIBS)
# end CDC xlator secion