summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2017-01-20 15:29:07 +0100
committerDiego Biurrun <diego@biurrun.de>2017-02-06 15:43:56 +0100
commit71a49fe25f2e4468fbbadbebef8d073b1b3cc1a5 (patch)
tree72d853f7f554e63955f23d9aba0d4f83500fd83a
parent0ce3761c781f2c2de40a5a8a99563878804f47cc (diff)
configure: Use cppflags check helper functions where appropriate
-rwxr-xr-xconfigure14
1 files changed, 4 insertions, 10 deletions
diff --git a/configure b/configure
index 32ab7329e3..c2580a3650 100755
--- a/configure
+++ b/configure
@@ -3774,18 +3774,12 @@ add_cppflags -D_ISOC99_SOURCE
# 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
- add_cflags -std=c11
-else
+check_cpp_condition stdlib.h "__STDC_VERSION__ >= 201112L" -std=c11 &&
+ add_cflags -std=c11 ||
check_cflags -std=c99
-fi
-check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
-#include <stdlib.h>
-EOF
-check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
-#include <stdlib.h>
-EOF
+check_cppflags -D_FILE_OFFSET_BITS=64
+check_cppflags -D_LARGEFILE_SOURCE
add_host_cppflags -D_ISOC99_SOURCE
check_host_cflags -std=c99