summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorRuediger Meier2015-01-20 13:49:55 +0100
committerRuediger Meier2015-01-20 15:37:52 +0100
commite85e8720d5ecc3680426281a3894c437368e0d4a (patch)
tree78c4aaf0b07262208bbc8da1d74f438f5d96ea23 /m4
parenttests: python tests should not remove user's LD_LIBRARY_PATH (diff)
downloadkernel-qcow2-util-linux-e85e8720d5ecc3680426281a3894c437368e0d4a.tar.gz
kernel-qcow2-util-linux-e85e8720d5ecc3680426281a3894c437368e0d4a.tar.xz
kernel-qcow2-util-linux-e85e8720d5ecc3680426281a3894c437368e0d4a.zip
build-sys: avoid icc warnings "ignoring unknown option"
Our macro UL_WARN_ADD could not discover these ones: icc: command line warning #10006: ignoring unknown option '-Wmissing-parameter-type' icc: command line warning #10006: ignoring unknown option '-Wredundant-decls' icc: command line warning #10006: ignoring unknown option '-Wunused-result' icc: command line warning #10006: ignoring unknown option '-Wnested-externs' We need to use AC_LANG_WERROR. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'm4')
-rw-r--r--m4/compiler.m47
1 files changed, 7 insertions, 0 deletions
diff --git a/m4/compiler.m4 b/m4/compiler.m4
index 062f93623..058c73f06 100644
--- a/m4/compiler.m4
+++ b/m4/compiler.m4
@@ -21,11 +21,18 @@ AC_DEFUN([UL_WARN_ADD], [
m4_define([warnvarname], m4_default([$2],WARN_CFLAGS))
AS_VAR_PUSHDEF([ul_Warn], [ul_cv_warn_$1])dnl
AC_CACHE_CHECK([whether compiler handles $1], m4_defn([ul_Warn]), [
+ # store AC_LANG_WERROR status, then turn it on
+ save_ac_[]_AC_LANG_ABBREV[]_werror_flag="${ac_[]_AC_LANG_ABBREV[]_werror_flag}"
+ AC_LANG_WERROR
+
ul_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="-Werror ${CPPFLAGS} $1"
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
[AS_VAR_SET(ul_Warn, [yes])],
[AS_VAR_SET(ul_Warn, [no])])
+ # restore AC_LANG_WERROR
+ ac_[]_AC_LANG_ABBREV[]_werror_flag="${save_ac_[]_AC_LANG_ABBREV[]_werror_flag}"
+
CPPFLAGS="$ul_save_CPPFLAGS"
])
AS_VAR_IF(ul_Warn, [yes], [UL_AS_VAR_APPEND(warnvarname, [" $1"])])