aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-10-08 13:38:42 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-10-08 13:38:42 +0200
commitf59fabf9dc51010899ebae705d149160be1483f8 (patch)
tree03b4f5bf612276b58513596649b9c60efcec291a
parentd475673b692e6076f540edf7991a0fea2baa1cce (diff)
configure.ac: Add --enable-werror flag
-rw-r--r--configure.ac18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index b370e0d..5032255 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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]]),