From ccad54b9fd4a6a695817781c973f79f89962a8e9 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sun, 17 May 2015 21:16:29 +0300 Subject: [PATCH] New configure option (--enable-werror) to treat warnings as compiler errors * configure.ac (werror): Test --enable-werror option to add -Werror to CFLAGS. --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index 0908ef3..e11b9c7 100644 --- a/configure.ac +++ b/configure.ac @@ -56,6 +56,12 @@ if test "$GCC" = yes; then AC_MSG_RESULT($ac_cv_cc_wextra) AS_IF([test "$ac_cv_cc_wextra" = yes], [WEXTRA="-Wextra"], [WEXTRA="-W"]) CFLAGS="-Wall $WEXTRA $CFLAGS" + + AC_ARG_ENABLE(werror, [AC_HELP_STRING([--enable-werror], + [Pass -Werror to the C compiler])]) + if test "$enable_werror" = yes; then + CFLAGS="-Werror $CFLAGS" + fi else case "$host" in *-*-hpux*) -- 2.50.1