summaryrefslogtreecommitdiffstats
path: root/lib/tsocket/wscript
blob: fa284a78f251035bacab2d5d823b3259bef9d048 (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
35
36
#!/usr/bin/env python

def configure(conf):
    conf.CHECK_CODE('''
                    #include <netinet/tcp.h>
                    int main(void) { return TCP_USER_TIMEOUT; }
                    ''',
                    'HAVE_TCP_USER_TIMEOUT',
                    addmain=False,
                    msg='Checking for TCP_USER_TIMEOUT')

def build(bld):
    bld.SAMBA_SUBSYSTEM(
        'LIBTSOCKET',
	source='tsocket.c tsocket_helpers.c tsocket_bsd.c',
	public_deps='talloc tevent iov_buf socket-blocking',
	public_headers='tsocket.h tsocket_internal.h'
    )

    bld.SAMBA_BINARY(
        'test_tsocket_bsd_addr',
        source='tests/test_bsd_addr.c',
        deps='cmocka replace LIBTSOCKET',
        local_include=False,
        for_selftest=True
    )

    bld.SAMBA_BINARY(
        'test_tstream',
        source='tests/test_tstream.c tests/socketpair_tcp.c',
        deps='cmocka replace LIBTSOCKET',
        local_include=False,
        enabled=bld.CONFIG_SET('HAVE_TCP_USER_TIMEOUT'),
        for_selftest=True
    )