1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/lib/pthreadpool/wscript_build
Andreas Schneider 4b28239d13 pthreadpool: Only link pthreadpool against librt if we have to
This calls clock_gettime() which is available in glibc on Linux. If the
wscript in libreplace detected that librt is needed for clock_gettime()
we have to link against it.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14140

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Pair-Programmed-With: Isaac Boukris <iboukris@gmail.com>
Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2019-09-25 15:39:40 +00:00

36 lines
1.3 KiB
Python

#!/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,
install=False)
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'],
install=False)