summaryrefslogtreecommitdiff
path: root/third_party/zlib/wscript
blob: 9965fe276014617c869bdc5fe36691efed357278 (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
#!/usr/bin/env python

def configure(conf):
    version_check='''
        #if (ZLIB_VERNUM >= 0x1230)
        #else
        #error "ZLIB_VERNUM < 0x1230"
        #endif
        z_stream *z;
        inflateInit2(z, -15);
        '''

    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 bld.CONFIG_SET('USING_SYSTEM_ZLIB'):
        return

    bld.SAMBA_LIBRARY('z',
                      private_library=True,
                      deps='replace',
                      allow_warnings=True,
                      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''')