summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-07-17 18:32:15 +0200
committerAnton Khirnov <anton@khirnov.net>2016-07-25 13:56:47 +0200
commit54758cb3eccea4730171aef49d4e30322b337d94 (patch)
treeb0eb6a7a6968f553cf4a58edd116b9029d1ee5bb
parentd614b83e6f0eb05286580572af9e9fe67f46e1d1 (diff)
configure: check for stdatomic.h
Since this is a C11 feature, it requires -std=c11. Not actually used for anything yet, that will be added in the following commits.
-rwxr-xr-xconfigure9
1 files changed, 8 insertions, 1 deletions
diff --git a/configure b/configure
index f12fa6fa29..d5f58789a9 100755
--- a/configure
+++ b/configure
@@ -1504,6 +1504,7 @@ HEADERS_LIST="
poll_h
sndio_h
soundcard_h
+ stdatomic_h
sys_mman_h
sys_param_h
sys_resource_h
@@ -3669,7 +3670,7 @@ if test "$?" != 0; then
fi
add_cppflags -D_ISOC99_SOURCE
-check_cflags -std=c99
+check_cflags -std=c11 || check_cflags -std=c99
check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
#include <stdlib.h>
EOF
@@ -4512,6 +4513,12 @@ check_header VideoDecodeAcceleration/VDADecoder.h
check_header windows.h
check_header X11/extensions/XvMClib.h
+# it seems there are versions of clang in some distros that try to use the
+# gcc headers, which explodes for stdatomic
+# so we also check that atomics actually work here
+check_header stdatomic.h &&
+ check_code cc "stdatomic.h" "atomic_int foo; atomic_store(&foo, 0)" || disable stdatomic_h
+
check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi