build: Print an error message if zlib is not installed.
authorWerner Koch <wk@gnupg.org>
Tue, 26 Aug 2014 14:13:21 +0000 (16:13 +0200)
committerWerner Koch <wk@gnupg.org>
Tue, 26 Aug 2014 14:13:21 +0000 (16:13 +0200)
* configure.ac (missing_zlib): New.

configure.ac

index c5f9bb6..5da6ea5 100644 (file)
@@ -1208,6 +1208,7 @@ AM_CONDITIONAL(DISABLE_REGEX, test x"$use_regex" != xyes)
 # when compiling a conftest (due to the "-lz" from LIBS).
 # Note that we combine zlib and bzlib2 in ZLIBS.
 #
+missing_zlib=yes
 _cppflags="${CPPFLAGS}"
 _ldflags="${LDFLAGS}"
 AC_ARG_WITH(zlib,
@@ -1220,7 +1221,10 @@ AC_ARG_WITH(zlib,
 
 AC_CHECK_HEADER(zlib.h,
       AC_CHECK_LIB(z, deflateInit2_,
-       ZLIBS="-lz",
+       [
+       ZLIBS="-lz"
+       missing_zlib=no
+       ],
        CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
        CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
 
@@ -1529,6 +1533,16 @@ if test "$missing_pth" = "yes"; then
 ***]])
    die=yes
 fi
+if test "$missing_zlib" = "yes"; then
+    AC_MSG_NOTICE([[
+***
+*** The zlib compression library is required.
+*** Please install a suitable development package
+*** (e.g. Debian package zlib1g-dev) or download
+*** it from http://zlib.net and build yourself.
+***]])
+   die=yes
+fi
 if test "$missing_iconv" = "yes"; then
     AC_MSG_NOTICE([[
 ***