build: add --enable-werror
This allows enabling -Werror in a consistent way. Note that this is
different from just specifiying it in CFLAGS, since that would either
break configure tests (if done on ./configure), or would override
configure's CFLAGS (if done on make).
Using --enable-werror instead provides a new WERROR variable that is
additionally used during make with a consistent set of warning flags.
The tests/ directory is exempt. (Rationale being, better to have more
tests than pedantically complain about them.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/bgpd/Makefile.am b/bgpd/Makefile.am
index 42f1f48..92fa10c 100644
--- a/bgpd/Makefile.am
+++ b/bgpd/Makefile.am
@@ -4,7 +4,7 @@
DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
INSTALL_SDATA=@INSTALL@ -m 600
-AM_CFLAGS = $(PICFLAGS)
+AM_CFLAGS = $(PICFLAGS) $(WERROR)
AM_LDFLAGS = $(PILDFLAGS)
noinst_LIBRARIES = libbgp.a