From 4baa2d021cb1be0ca19bad9da0f6300a95c9a722 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 6 Feb 2013 12:15:41 +0100 Subject: libreplace-waf: Only check for _np functions if standard functions are not available Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- lib/replace/wscript | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'lib/replace') diff --git a/lib/replace/wscript b/lib/replace/wscript index fd53999dce1..a26de0f8bae 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -458,20 +458,26 @@ removeea setea if conf.CONFIG_SET('HAVE_PTHREAD'): conf.CHECK_DECLS('pthread_mutexattr_setrobust', headers='pthread.h') - conf.CHECK_FUNCS_IN('pthread_mutexattr_setrobust', 'pthread', - checklibc=True, headers='pthread.h') + if not conf.CONFIG_SET('HAVE_DECL_PTHREAD_MUTEXATTR_SETROBUST'): + conf.CHECK_DECLS('pthread_mutexattr_setrobust_np', + headers='pthread.h') - conf.CHECK_DECLS('pthread_mutexattr_setrobust_np', headers='pthread.h') - conf.CHECK_FUNCS_IN('pthread_mutexattr_setrobust_np', 'pthread', + conf.CHECK_FUNCS_IN('pthread_mutexattr_setrobust', 'pthread', checklibc=True, headers='pthread.h') + if not conf.CONFIG_SET('HAVE_PTHREAD_MUTEXATTR_SETROBUST'): + conf.CHECK_FUNCS_IN('pthread_mutexattr_setrobust_np', 'pthread', + checklibc=True, headers='pthread.h') conf.CHECK_DECLS('pthread_mutex_consistent', headers='pthread.h') - conf.CHECK_FUNCS_IN('pthread_mutex_consistent', 'pthread', - checklibc=True, headers='pthread.h') + if not conf.CONFIG_SET('HAVE_DECL_PTHREAD_MUTEX_CONSISTENT'): + conf.CHECK_DECLS('pthread_mutex_consistent_np', + headers='pthread.h') - conf.CHECK_DECLS('pthread_mutex_consistent_np', headers='pthread.h') - conf.CHECK_FUNCS_IN('pthread_mutex_consistent_np', 'pthread', + conf.CHECK_FUNCS_IN('pthread_mutex_consistent', 'pthread', checklibc=True, headers='pthread.h') + if not conf.CONFIG_SET('HAVE_PTHREAD_MUTEX_CONSISTENT'): + conf.CHECK_FUNCS_IN('pthread_mutex_consistent_np', 'pthread', + checklibc=True, headers='pthread.h') if ((conf.CONFIG_SET('HAVE_PTHREAD_MUTEXATTR_SETROBUST') or conf.CONFIG_SET('HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP')) and -- cgit