summaryrefslogtreecommitdiffstats
path: root/lib/zlib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-03-14 10:34:00 +0100
committerAndrew Bartlett <abartlet@samba.org>2014-04-02 09:03:42 +0200
commitb8f91696f5464e88acb7fabe8bd9dbe9c4b5bd79 (patch)
tree018906228dfc553b03017d0d63822c55ad07dc01 /lib/zlib
parentcc765baa64c51de3c229697a130d691f336ac2f3 (diff)
downloadsamba-b8f91696f5464e88acb7fabe8bd9dbe9c4b5bd79.tar.gz
samba-b8f91696f5464e88acb7fabe8bd9dbe9c4b5bd79.tar.xz
samba-b8f91696f5464e88acb7fabe8bd9dbe9c4b5bd79.zip
lib/zlib: make use of conf.CHECK_BUNDLED_SYSTEM()
This way --bundled-libraries=ALL will use the internal zlib version. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/zlib')
-rw-r--r--lib/zlib/wscript51
1 files changed, 23 insertions, 28 deletions
diff --git a/lib/zlib/wscript b/lib/zlib/wscript
index 42d6f76f149..aa300a8eff6 100644
--- a/lib/zlib/wscript
+++ b/lib/zlib/wscript
@@ -1,34 +1,29 @@
#!/usr/bin/env python
def configure(conf):
- conf.CHECK_HEADERS('zlib.h')
- conf.CHECK_FUNCS_IN('zlibVersion', 'z')
+ version_check='''
+ #if (ZLIB_VERNUM >= 0x1230)
+ #else
+ #error "ZLIB_VERNUM < 0x1230"
+ #endif
+ z_stream *z;
+ inflateInit2(z, -15);
+ '''
- conf.CHECK_CODE('''
- #if (ZLIB_VERNUM >= 0x1230)
- #else
- #error "ZLIB_VERNUM < 0x1230"
- #endif
- z_stream *z;
- inflateInit2(z, -15);
- ''',
- headers='zlib.h',
- lib='z',
- local_include=False,
- msg='Checking for ZLIB_VERNUM >= 0x1230 and working link to zlib',
- define='HAVE_ZLIB')
-
- # If we don't do this then we will receive an error that lib 'z'
- # is already declared as a system lib (for the cases where zlibVersion
- # is defined
- if not conf.env['HAVE_ZLIB']:
- conf.LOCAL_CACHE_SET('TARGET_TYPE', 'z', 'EMPTY')
+ if conf.CHECK_BUNDLED_SYSTEM('z', minversion='1.2.3', pkg='zlib',
+ checkfunctions='zlibVersion',
+ headers='zlib.h',
+ checkcode=version_check,
+ implied_deps='replace'):
+ conf.define('USING_SYSTEM_ZLIB', 1)
def build(bld):
- if not bld.CONFIG_SET('HAVE_ZLIB'):
- bld.SAMBA_LIBRARY('z',
- private_library=True,
- deps='replace',
- source='''adler32.c compress.c crc32.c gzio.c
- uncompr.c deflate.c trees.c zutil.c
- inflate.c infback.c inftrees.c inffast.c''')
+ if bld.CONFIG_SET('USING_SYSTEM_ZLIB'):
+ return
+
+ bld.SAMBA_LIBRARY('z',
+ private_library=True,
+ deps='replace',
+ source='''adler32.c compress.c crc32.c gzio.c
+ uncompr.c deflate.c trees.c zutil.c
+ inflate.c infback.c inftrees.c inffast.c''')