summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-12-28 23:41:29 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-12-31 13:11:37 +0100
commitaf7a75cb517141f649cbbe0a9dcdb4854359b740 (patch)
tree50573db96314b3df2d8f53f460e3f213799de101 /configure
parent771b3a956e0c38e13fb6eaa506ac372fb33f51b1 (diff)
configure: Check build with some header not just preprocessing for testing --std=c11
Fixes build failure on FreeBSD with gcc 4.7 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure14
1 files changed, 8 insertions, 6 deletions
diff --git a/configure b/configure
index 56a0b657a9..f035f35ca2 100755
--- a/configure
+++ b/configure
@@ -1201,13 +1201,15 @@ check_cpp_condition(){
EOF
}
-test_cflags_cpp(){
- log test_cflags_cpp "$@"
+test_cflags_cc(){
+ log test_cflags_cc "$@"
flags=$1
- condition=$2
- shift 2
+ header=$2
+ condition=$3
+ shift 3
set -- $($cflags_filter "$flags")
- check_cpp "$@" <<EOF
+ check_cc "$@" <<EOF
+#include <$header>
#if !($condition)
#error "unsatisfied condition: $condition"
#endif
@@ -4625,7 +4627,7 @@ add_cxxflags -std=c++98
# some compilers silently accept -std=c11, so we also need to check that the
# version macro is defined properly
-if test_cflags_cpp -std=c11 "__STDC_VERSION__ >= 201112L"; then
+if test_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L"; then
add_cflags -std=c11
else
check_cflags -std=c99