summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2012-09-14 11:18:41 -0300
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2012-09-14 11:37:29 -0300
commit7812d88c95e10e690c3d1c057ab2fa7ad1edaafa (patch)
tree8f6bfbb4c7d894b8b18ec7b1c597824a73ddb00e /m4
parenta7fbae03158ab8449e0ff7220b1d92f075d1aadd (diff)
downloadkmod-7812d88c95e10e690c3d1c057ab2fa7ad1edaafa.tar.gz
kmod-7812d88c95e10e690c3d1c057ab2fa7ad1edaafa.tar.bz2
kmod-7812d88c95e10e690c3d1c057ab2fa7ad1edaafa.zip
build-sys: Append -Werror when testing flags
Clang doesn't treat unknown warnings flags as an error, but rather as a warning. The result is that the detection for whic CFLAGS are supported by this compiler will not work, since the compilation will succeed. With this patch we now successfully detect clang doesn't support -Wlogical-op, as opposed to previous behavior: checking if clang supports flag -Wlogical-op in envvar CFLAGS... no We use this macro only for LDFLAGS and CFLAGS, so it's safe to stash -Werror there.
Diffstat (limited to 'm4')
-rw-r--r--m4/attributes.m42
1 files changed, 1 insertions, 1 deletions
diff --git a/m4/attributes.m4 b/m4/attributes.m4
index c80ae62..e822197 100644
--- a/m4/attributes.m4
+++ b/m4/attributes.m4
@@ -40,7 +40,7 @@ AC_DEFUN([CC_CHECK_FLAG_APPEND], [
AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2],
AS_TR_SH([cc_cv_$2_$3]),
[eval "AS_TR_SH([cc_save_$2])='${$2}'"
- eval "AS_TR_SH([$2])='$3'"
+ eval "AS_TR_SH([$2])='-Werror $3'"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int a = 0; int main(void) { return a; } ])],
[eval "AS_TR_SH([cc_cv_$2_$3])='yes'"],
[eval "AS_TR_SH([cc_cv_$2_$3])='no'"])