summaryrefslogtreecommitdiffstats
path: root/lib/zlib/wscript
blob: 42d6f76f149e52244ae8ef9c1213f4467cb14081 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/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''')