zlib: we require zlib-1.2.3 or higher
authorStefan Metzmacher <metze@samba.org>
Sat, 6 Sep 2008 10:04:00 +0000 (12:04 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 6 Sep 2008 14:16:41 +0000 (16:16 +0200)
metze

source/lib/zlib.m4

index 7b967fc8d2f2b6cf093978e6b0f85ef3cbcad6a2..9ee7b8e49e87d2709533f46b33faeb64758fa60b 100644 (file)
@@ -1,11 +1,26 @@
 
 AC_CHECK_HEADERS(zlib.h)
 
-# we require this new function...
-AC_CHECK_LIB_EXT(z, ZLIB_LIBS, inflateReset2)
+AC_CHECK_LIB_EXT(z, ZLIB_LIBS, zlibVersion)
+
+AC_CACHE_CHECK([for zlib >= 1.2.3], samba_cv_zlib_1_2_3, [
+       AC_TRY_COMPILE([
+               #include <zlib.h>
+               ],[
+               #if (ZLIB_VERNUM >= 0x1230)
+               #else
+               #error "ZLIB_VERNUM < 0x1230"
+               #endif
+               ],[
+               samba_cv_zlib_1_2_3=yes
+               ],[
+               samba_cv_zlib_1_2_3=no
+               ])
+])
 
 if test x"$ac_cv_header_zlib_h" = x"yes" -a \
-       x"$ac_cv_lib_ext_z_inflateReset2" = x"yes"; then
+       x"$ac_cv_lib_ext_z_zlibVersion" = x"yes" -a \
+       x"$samba_cv_zlib_1_2_3" = x"yes"; then
        SMB_EXT_LIB(ZLIB, [${ZLIB_LIBS}])
 else
        SMB_INCLUDE_MK(lib/zlib.mk)