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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#!/usr/bin/env python
if bld.env.WITH_PTHREADPOOL:
extra_libs=''
# Link to librt if needed for clock_gettime()
if bld.CONFIG_SET('HAVE_LIBRT'): extra_libs += ' rt'
bld.SAMBA_SUBSYSTEM('PTHREADPOOL',
source='''pthreadpool.c
pthreadpool_pipe.c
pthreadpool_tevent.c
''',
deps='pthread replace tevent-util' + extra_libs)
else:
bld.SAMBA_SUBSYSTEM('PTHREADPOOL',
source='''pthreadpool_sync.c
pthreadpool_pipe.c
pthreadpool_tevent.c
''',
deps='replace tevent-util')
bld.SAMBA_BINARY('pthreadpooltest',
source='tests.c',
deps='PTHREADPOOL',
enabled=bld.env.WITH_PTHREADPOOL,
for_selftest=True)
bld.SAMBA_BINARY('pthreadpooltest_cmocka',
source='tests_cmocka.c',
deps='PTHREADPOOL cmocka',
ldflags='-Wl,--wrap=pthread_create',
enabled=bld.env.WITH_PTHREADPOOL and bld.env['HAVE_LDWRAP'],
for_selftest=True)
bld.SAMBA_BINARY('pthreadpool_unit_test_cmocka',
source='test_pthreadpool.c',
deps='PTHREADPOOL cmocka',
enabled=bld.env.WITH_PTHREADPOOL,
for_selftest=True)
bld.SAMBA_BINARY('pthreadpool_tevent_cmocka_unit_test',
source='test_pthreadpool_tevent.c',
deps='PTHREADPOOL cmocka',
enabled=bld.env.WITH_PTHREADPOOL,
for_selftest=True)
bld.SAMBA_BINARY('pthreadpool_pipe_cmocka_unit_test',
source='test_pthreadpool_pipe.c',
deps='PTHREADPOOL cmocka',
enabled=bld.env.WITH_PTHREADPOOL,
for_selftest=True)
|