1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
samba-mirror/lib/tsocket/wscript
Volker Lendecke 1625dc4b56 tsocket: Fix the build on FreeBSD
FreeBSD does not have TCP_USER_TIMEOUT

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-12 21:16:33 +00:00

37 lines
1.0 KiB
Python

#!/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
)