From e568299c2c2f438cbbee687aa57d0a6cdecf7e0b Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 1 Jan 2014 20:42:13 +0100 Subject: build: make configure fail if both __atomic and __sync are not available --- wscript | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'wscript') diff --git a/wscript b/wscript index 7a6ee4fb02..ae3bb1d8c1 100644 --- a/wscript +++ b/wscript @@ -77,7 +77,7 @@ main_dependencies = [ 'desc': 'linker support for --nxcompat --no-seh --dynamicbase', 'func': check_cc(linkflags=['-Wl,--nxcompat', '-Wl,--no-seh', '-Wl,--dynamicbase']) }, { - 'name': 'ebx_available', + 'name': 'ebx-available', 'desc': 'ebx availability', 'func': check_cc(fragment=load_fragment('ebx.c')) } , { @@ -99,12 +99,26 @@ main_dependencies = [ 'req': True, 'fmsg': 'Unable to find pthreads support.' }, { - 'name': 'atomic_builtins', + 'name': 'atomic-builtins', 'desc': 'compiler support for __atomic built-ins', 'func': check_libs(['atomic'], check_statement('stdint.h', 'int64_t test = 0;' 'test = __atomic_add_fetch(&test, 1, __ATOMIC_SEQ_CST)')) + }, { + 'name': 'sync-builtins', + 'desc': 'compiler support for __sync built-ins', + 'func': check_statement('stdint.h', + 'int64_t test = 0;' + 'test = __sync_add_and_fetch(&test, 1)'), + 'deps_neg': [ 'atomic-builtins' ], + }, { + 'name': 'thread-synchronization-builtins', + 'desc': 'compiler support for usable thread synchronization built-ins', + 'func': check_true, + 'deps_any': ['atomic-builtins', 'sync-builtins'], + 'req': True, + 'fmsg': 'your compiler must support either __atomic or __aync bult-ins', }, { 'name': 'librt', 'desc': 'linking with -lrt', -- cgit v1.2.3