summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2018-11-03 17:29:21 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2018-11-03 18:59:20 +0100
commitf08c9f7d1fa1df1d1fd6673785ca1764dc5c8046 (patch)
tree08ee518f9590ab4d0a310c180ec1eba6300afda7 /configure.ac
parentb083af081c7ecc4bb3f4e9544b30f4abce2560cf (diff)
downloadvala-f08c9f7d1fa1df1d1fd6673785ca1764dc5c8046.tar.gz
testrunner: Check if compiler flags are supported before using them
Use AX_CHECK_COMPILE_FLAG to collect TEST_CFLAGS in configure.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac29
1 files changed, 29 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 9d1c97417..6496a7fbf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,6 +106,35 @@ AC_SUBST(COVERAGE_VALAFLAGS)
AC_SUBST(COVERAGE_CFLAGS)
AC_SUBST(COVERAGE_LIBS)
+
+# Check supported compiler flags used in testrunner.sh
+TEST_EXTRA_CFLAGS="-Werror=init-self \
+-Werror=implicit \
+-Werror=pointer-arith \
+-Werror=redundant-decls \
+-Werror=return-type \
+-Werror=sequence-point \
+-Werror=uninitialized \
+-Werror=int-to-pointer-cast \
+-Werror=pointer-to-int-cast \
+-Wformat=2 \
+-Werror=format-security \
+-Werror=format-nonliteral \
+-Werror=int-conversion \
+-Werror=duplicated-branches \
+-Werror=duplicated-cond \
+-Werror=declaration-after-statement \
+-Werror=maybe-uninitialized \
+-Werror=enum-conversion"
+
+TEST_CFLAGS=
+for flag in $TEST_EXTRA_CFLAGS; do
+ AX_CHECK_COMPILE_FLAG([$flag],[TEST_CFLAGS="$TEST_CFLAGS $flag"])
+done
+
+AC_SUBST(TEST_CFLAGS)
+
+
GLIB_REQUIRED=2.40.0
LIBGVC_REQUIRED=2.16