From 9d9f5b44ed5271e85d1ea9b9e675d20914e621b3 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 17 Oct 2008 11:52:55 +0200 Subject: Use common detection function for zlib. --- lib/zlib/zlib.m4 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 lib/zlib/zlib.m4 (limited to 'lib') diff --git a/lib/zlib/zlib.m4 b/lib/zlib/zlib.m4 new file mode 100644 index 0000000000..32d747c388 --- /dev/null +++ b/lib/zlib/zlib.m4 @@ -0,0 +1,29 @@ +AC_DEFUN([AC_ZLIB],[ +AC_CHECK_HEADERS(zlib.h) + +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 + ],[ + #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_zlibVersion" = x"yes" -a \ + x"$samba_cv_zlib_1_2_3" = x"yes"; then + $1 +else + $2 +fi +]) + -- cgit