diff options
author | Guillem Jover <guillem@debian.org> | 2014-10-02 05:00:46 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-10-06 00:27:20 +0200 |
commit | 9540bc984b08c5936c5aad2f1cab15f3b3560b84 (patch) | |
tree | d34812ac8a161229fa16bfd5fd7bfeec44495974 /m4 | |
parent | e695dc22e239788db1cb5d9e2a5ab2578c225263 (diff) | |
download | dpkg-9540bc984b08c5936c5aad2f1cab15f3b3560b84.tar.gz |
build: Fix compiler flag detection with non-GCC compilers
We enable -Werror when checking the flags so that on compilers like
clang which just emit a warning on unknown warning options, instead
of erroring out, we get proper detection.
We could just use stuff like -Werror=unknown-warning-option and
-Werror=unused-command-line-argument, but then we would need to detect
if those are available as they might make the compiler error out if
they are no supported. So just using the blanket -Werror, although more
broad, makes the code less complicated.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/dpkg-compiler.m4 | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/m4/dpkg-compiler.m4 b/m4/dpkg-compiler.m4 index 6d636d07c..53f67c6c1 100644 --- a/m4/dpkg-compiler.m4 +++ b/m4/dpkg-compiler.m4 @@ -21,7 +21,7 @@ AC_DEFUN([DPKG_CHECK_COMPILER_FLAG], [ ]) AC_CACHE_CHECK([whether ]dpkg_compiler[ accepts $1], [dpkg_varname_cache], [ AS_VAR_COPY([dpkg_varname_save], [dpkg_varname]) - AS_VAR_SET([dpkg_varname], [$1]) + AS_VAR_SET([dpkg_varname], ["$1 -Werror"]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[]]) ], [ |