summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-17 11:52:55 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-18 14:14:44 +0200
commit9d9f5b44ed5271e85d1ea9b9e675d20914e621b3 (patch)
treeb745d5a5a62a8f914b1782a0854df754b92ea2d8
parentfcce58cc61e4ed66de7d81064f40ff5a4e5b6346 (diff)
downloadsamba-9d9f5b44ed5271e85d1ea9b9e675d20914e621b3.tar.gz
samba-9d9f5b44ed5271e85d1ea9b9e675d20914e621b3.tar.bz2
samba-9d9f5b44ed5271e85d1ea9b9e675d20914e621b3.zip
Use common detection function for zlib.
-rw-r--r--lib/zlib/zlib.m4 (renamed from source4/lib/zlib.m4)7
-rw-r--r--source3/configure.in28
-rw-r--r--source4/configure.ac7
3 files changed, 14 insertions, 28 deletions
diff --git a/source4/lib/zlib.m4 b/lib/zlib/zlib.m4
index ac220ebede..32d747c388 100644
--- a/source4/lib/zlib.m4
+++ b/lib/zlib/zlib.m4
@@ -1,3 +1,4 @@
+AC_DEFUN([AC_ZLIB],[
AC_CHECK_HEADERS(zlib.h)
AC_CHECK_LIB_EXT(z, ZLIB_LIBS, zlibVersion)
@@ -20,7 +21,9 @@ AC_CACHE_CHECK([for zlib >= 1.2.3], samba_cv_zlib_1_2_3, [
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
- SMB_EXT_LIB(ZLIB, [${ZLIB_LIBS}])
+ $1
else
- SMB_INCLUDE_MK(lib/zlib.mk)
+ $2
fi
+])
+
diff --git a/source3/configure.in b/source3/configure.in
index d65d28d0b7..9388ebabc0 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -6248,32 +6248,10 @@ if test x$enable_merged_build = xyes; then
m4_include(samba4.m4)
fi
-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 <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
- ])
-])
-
+m4_include(../lib/zlib/zlib.m4)
AC_SUBST(ZLIB_LIBS)
AC_SUBST(ZLIB_OBJS)
-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
- ZLIB_OBJS=""
-else
+AC_ZLIB([ZLIB_OBJS=""], [
ZLIB_LIBS=""
for o in adler32.o compress.o crc32.o gzio.o uncompr.o \
deflate.o trees.o zutil.o inflate.o infback.o \
@@ -6282,7 +6260,7 @@ else
ZLIB_OBJS="$ZLIB_OBJS ../lib/zlib/$o"
done
CFLAGS="$CFLAGS -I../lib/zlib"
-fi
+])
dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
LIB_REMOVE_USR_LIB(LDFLAGS)
diff --git a/source4/configure.ac b/source4/configure.ac
index 7c95f2a175..9d387fcb4c 100644
--- a/source4/configure.ac
+++ b/source4/configure.ac
@@ -24,7 +24,12 @@ m4_include(../lib/util/time.m4)
m4_include(../lib/popt/samba.m4)
m4_include(lib/charset/config.m4)
m4_include(lib/socket/config.m4)
-m4_include(lib/zlib.m4)
+m4_include(../lib/zlib/zlib.m4)
+AC_ZLIB([
+SMB_EXT_LIB(ZLIB, [${ZLIB_LIBS}])
+],[
+SMB_INCLUDE_MK(lib/zlib.mk)
+])
m4_include(nsswitch/nsstest.m4)
m4_include(../pidl/config.m4)