summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/configure.ac1
-rw-r--r--source4/lib/zlib.m412
-rw-r--r--source4/lib/zlib.mk17
-rw-r--r--source4/lib/zlib/zconf.h3
4 files changed, 33 insertions, 0 deletions
diff --git a/source4/configure.ac b/source4/configure.ac
index 29db34eddf..d03092c6b6 100644
--- a/source4/configure.ac
+++ b/source4/configure.ac
@@ -24,6 +24,7 @@ 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(nsswitch/nsstest.m4)
m4_include(pidl/config.m4)
diff --git a/source4/lib/zlib.m4 b/source4/lib/zlib.m4
new file mode 100644
index 0000000000..7b967fc8d2
--- /dev/null
+++ b/source4/lib/zlib.m4
@@ -0,0 +1,12 @@
+
+AC_CHECK_HEADERS(zlib.h)
+
+# we require this new function...
+AC_CHECK_LIB_EXT(z, ZLIB_LIBS, inflateReset2)
+
+if test x"$ac_cv_header_zlib_h" = x"yes" -a \
+ x"$ac_cv_lib_ext_z_inflateReset2" = x"yes"; then
+ SMB_EXT_LIB(ZLIB, [${ZLIB_LIBS}])
+else
+ SMB_INCLUDE_MK(lib/zlib.mk)
+fi
diff --git a/source4/lib/zlib.mk b/source4/lib/zlib.mk
new file mode 100644
index 0000000000..095f129feb
--- /dev/null
+++ b/source4/lib/zlib.mk
@@ -0,0 +1,17 @@
+[SUBSYSTEM::ZLIB]
+CFLAGS = -Ilib/zlib
+
+libzlibsrcdir := lib/zlib
+ZLIB_OBJ_FILES = \
+ $(libzlibsrcdir)/adler32.o \
+ $(libzlibsrcdir)/compress.o \
+ $(libzlibsrcdir)/crc32.o \
+ $(libzlibsrcdir)/gzio.o \
+ $(libzlibsrcdir)/uncompr.o \
+ $(libzlibsrcdir)/deflate.o \
+ $(libzlibsrcdir)/trees.o \
+ $(libzlibsrcdir)/zutil.o \
+ $(libzlibsrcdir)/inflate.o \
+ $(libzlibsrcdir)/infback.o \
+ $(libzlibsrcdir)/inftrees.o \
+ $(libzlibsrcdir)/inffast.o
diff --git a/source4/lib/zlib/zconf.h b/source4/lib/zlib/zconf.h
index b65f30ee51..214603c151 100644
--- a/source4/lib/zlib/zconf.h
+++ b/source4/lib/zlib/zconf.h
@@ -5,6 +5,9 @@
/* @(#) $Id$ */
+#include "replace.h"
+#define Z_PREFIX
+
#ifndef ZCONF_H
#define ZCONF_H