1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/lib/zlib/wscript
Andrew Bartlett 25b9760a42 build: a more robust zlib test
Just in-case, and done this way due to the #define maze that applies
to this function.  No actual host has been found that needs this yet.

Andrew Bartlett
2011-09-09 15:24:05 +10:00

35 lines
1.3 KiB
Python

#!/usr/bin/env python
def configure(conf):
conf.CHECK_HEADERS('zlib.h')
conf.CHECK_FUNCS_IN('zlibVersion', 'z')
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')
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''')