summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2014-09-25 18:38:48 +0300
committerLasse Collin <lasse.collin@tukaani.org>2014-12-17 21:13:42 +0200
commit94a1a869ee1b8b854592327e04decd6f8441aaf5 (patch)
tree844f9c7e29d83c242fb7af49214421b73c9e7dc8
parent0e50ad7129910f9a4c16d0c447eb9e073f367917 (diff)
downloadxz-94a1a869ee1b8b854592327e04decd6f8441aaf5.tar.gz
Build: Detect supported compiler warning flags better.
Clang and nowadays also GCC accept any -Wfoobar option but then may give a warning that an unknown warning option was specified. To avoid adding unsupported warning options, the options are now tested with -Werror. Thanks to Charles Diza.
-rw-r--r--configure.ac5
1 files changed, 3 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 0fd8c1e..2e7f97b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -588,8 +588,9 @@ if test "$GCC" = yes ; then
do
AC_MSG_CHECKING([if $CC accepts $NEW_FLAG])
OLD_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $NEW_FLAG"
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([void foo(void) { }])], [
+ CFLAGS="$CFLAGS $NEW_FLAG -Werror"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+ [void foo(void); void foo(void) { }])], [
AM_CFLAGS="$AM_CFLAGS $NEW_FLAG"
AC_MSG_RESULT([yes])
], [