configure.ac: Add --enable-werror flag

Change-Id: I387a3365fb5b7340bf67fb945df434442924a4c7
This commit is contained in:
Pau Espin 2018-10-08 13:38:42 +02:00
parent d475673b69
commit f59fabf9dc
1 changed files with 18 additions and 0 deletions

View File

@ -22,6 +22,24 @@ AC_PROG_RANLIB
dnl checks for header files
AC_HEADER_STDC
AC_ARG_ENABLE(werror,
[AS_HELP_STRING(
[--enable-werror],
[Turn all compiler warnings into errors, with exceptions:
a) deprecation (allow upstream to mark deprecation without breaking builds);
b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds)
]
)],
[werror=$enableval], [werror="no"])
if test x"$werror" = x"yes"
then
WERROR_FLAGS="-Werror"
WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations"
WERROR_FLAGS+=" -Wno-error=cpp" # "#warning"
CFLAGS="$CFLAGS $WERROR_FLAGS"
CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
fi
AC_ARG_ENABLE([external_tests],
AC_HELP_STRING([--enable-external-tests],
[Include the VTY tests in make check [default=no]]),