aclocal: Use -Werror when checking compiler flags (try 2)
Per Johansson
per at morth.org
Sat Jan 5 10:59:11 CST 2013
...if supported by compiler.
This makes clang exit with error on unsupported warnings.
---
aclocal.m4 | 2 +-
configure.ac | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/aclocal.m4 b/aclocal.m4
index 14cf916..a6d9f12 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -74,7 +74,7 @@ AC_DEFUN([WINE_TRY_CFLAGS],
[AS_VAR_PUSHDEF([ac_var], ac_cv_cflags_[[$1]])dnl
AC_CACHE_CHECK([whether the compiler supports $1], ac_var,
[ac_wine_try_cflags_saved=$CFLAGS
-CFLAGS="$CFLAGS $1"
+CFLAGS="$CFLAGS $ac_wine_try_cflags_werror $1"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv) { return 0; }]])],
[AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)])
CFLAGS=$ac_wine_try_cflags_saved])
diff --git a/configure.ac b/configure.ac
index 77ee82d..adf3148 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1742,6 +1742,7 @@ then
fi
dnl Check for some compiler flags
+ WINE_TRY_CFLAGS([-Werror],[ac_wine_try_cflags_werror=-Werror])
WINE_TRY_CFLAGS([-fno-builtin],[AC_SUBST(BUILTINFLAG,"-fno-builtin")])
WINE_TRY_CFLAGS([-fno-strict-aliasing])
WINE_TRY_CFLAGS([-Wdeclaration-after-statement])
--
1.8.0.2
More information about the wine-patches
mailing list