diff --git a/configure.ac b/configure.ac
index 2707aa2e44abab5764a0b42794811f80c29a63b9..0430e9722c20ee8bc42093ab11aabb00ba1a4b24 100644
--- a/configure.ac
+++ b/configure.ac
@@ -684,6 +684,9 @@ case "$OPT_ZLIB" in
     ;;
 esac
 
+dnl set variable for use in automakefile(s)
+AM_CONDITIONAL(HAVE_LIBZ, test x"$HAVE_LIBZ" = x1)
+
 dnl Default is to try the thread-safe versions of a few functions
 OPT_THREAD=on