1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3-waf: check for pthread support.

Guenther
This commit is contained in:
Günther Deschner 2011-04-27 16:07:35 +02:00
parent ee0b0dd3a1
commit cad8fafa03

View File

@ -1637,6 +1637,37 @@ main() {
if Options.options.with_profiling_data:
conf.DEFINE('WITH_PROFILE', 1);
PTHREAD_CFLAGS='error'
PTHREAD_LDFLAGS='error'
if PTHREAD_LDFLAGS == 'error':
if conf.CHECK_FUNCS_IN('pthread_attr_init', 'pthread'):
PTHREAD_CFLAGS='-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS'
PTHREAD_LDFLAGS='-lpthread'
if PTHREAD_LDFLAGS == 'error':
if conf.CHECK_FUNCS_IN('pthread_attr_init', 'pthreads'):
PTHREAD_CFLAGS='-D_THREAD_SAFE'
PTHREAD_LDFLAGS='-lpthreads'
if PTHREAD_LDFLAGS == 'error':
if conf.CHECK_FUNCS_IN('pthread_attr_init', 'c_r'):
PTHREAD_CFLAGS='-D_THREAD_SAFE -pthread'
PTHREAD_LDFLAGS='-pthread'
if PTHREAD_LDFLAGS == 'error':
if conf.CHECK_FUNC('pthread_attr_init'):
PTHREAD_CFLAGS='-D_REENTRANT'
PTHREAD_LDFLAGS='-lpthread'
# especially for HP-UX, where the CHECK_FUNC macro fails to test for
# pthread_attr_init. On pthread_mutex_lock it works there...
if PTHREAD_LDFLAGS == 'error':
if conf.CHECK_FUNCS_IN('pthread_mutex_lock', 'pthread'):
PTHREAD_CFLAGS='-D_REENTRANT'
PTHREAD_LDFLAGS='-lpthread'
if PTHREAD_CFLAGS != 'error' and PTHREAD_LDFLAGS != 'error':
conf.ADD_CFLAGS(PTHREAD_CFLAGS)
conf.ADD_LDFLAGS(PTHREAD_LDFLAGS)
conf.CHECK_HEADERS('pthread.h')
conf.DEFINE('HAVE_PTHREAD', '1')
default_static_modules=TO_LIST('''pdb_smbpasswd pdb_tdbsam pdb_wbc_sam
auth_sam auth_unix auth_winbind auth_wbc auth_server