summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2014-10-02 05:00:46 +0200
committerGuillem Jover <guillem@debian.org>2014-10-06 00:27:20 +0200
commit9540bc984b08c5936c5aad2f1cab15f3b3560b84 (patch)
treed34812ac8a161229fa16bfd5fd7bfeec44495974 /m4
parente695dc22e239788db1cb5d9e2a5ab2578c225263 (diff)
downloaddpkg-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.m42
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([[]])
], [