diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2014-09-25 18:38:48 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2014-09-25 18:38:48 +0300 |
commit | c4911f2db36d811896c73c008b4218d8fa9a4730 (patch) | |
tree | 21c4e046aae50dc426c5fdbaebf11e84e021246c | |
parent | Update NEWS for 5.0.7. (diff) | |
download | xz-c4911f2db36d811896c73c008b4218d8fa9a4730.tar.xz |
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.ac | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 2df67970..e41979bb 100644 --- a/configure.ac +++ b/configure.ac @@ -749,8 +749,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]) ], [ |