summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2014-01-01 20:42:13 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2014-01-01 20:52:54 +0100
commite568299c2c2f438cbbee687aa57d0a6cdecf7e0b (patch)
tree1d852c2b170d45e572f1fa767dd5e19f23f4ab3b /wscript
parentfaf68f3b8eb51427949833999264aecf801a0ced (diff)
downloadmpv-e568299c2c2f438cbbee687aa57d0a6cdecf7e0b.tar.bz2
mpv-e568299c2c2f438cbbee687aa57d0a6cdecf7e0b.tar.xz
build: make configure fail if both __atomic and __sync are not available
Diffstat (limited to 'wscript')
-rw-r--r--wscript18
1 files changed, 16 insertions, 2 deletions
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,13 +99,27 @@ 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',
'deps': [ 'pthreads' ],