summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2015-11-30 13:15:52 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2015-11-30 13:15:52 +0000
commit3b6ed43edd46b46e115d9d3fdc98d0d9e92857f6 (patch)
tree70bdb33b7c2a03ce9af08577817f006f55ce8d4d
parent2646658bf2a1e96ee2b83d6bdeb8be164075631b (diff)
downloadclutter-3b6ed43edd46b46e115d9d3fdc98d0d9e92857f6.tar.gz
build: Add --disable-Werror
We enable a bunch of compiler flags to trip common errors during development. While this is very useful while hacking on Clutter, it makes the life of people building Clutter on automated build systems much harder; thus, we should have a configuration option to opt out of the -Werror business. GNOME has pretty much standardised on `--disable-Werror`, so we should crib that configure option.
-rw-r--r--configure.ac33
1 files changed, 21 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 3640492d5..a6fc6cd98 100644
--- a/configure.ac
+++ b/configure.ac
@@ -955,18 +955,27 @@ MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS
-Wcast-align
-Wuninitialized
-Wno-strict-aliasing
- -Wshadow
- -Werror=logical-op
- -Werror=pointer-arith
- -Werror=missing-declarations
- -Werror=redundant-decls
- -Werror=empty-body
- -Werror=format
- -Werror=format-security
- -Werror=format-nonliteral
- -Werror=init-self
- -Werror=declaration-after-statement
- -Werror=vla"
+ -Wshadow"
+
+AC_ARG_ENABLE([Werror],
+ [AS_HELP_STRING([--disable-Werror], [Removes -Werror from compiler flags])],
+ [],
+ [enable_Werror=yes])
+
+AS_IF([test "x$enable_Werror" = xyes], [
+ MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS
+ -Werror=logical-op
+ -Werror=pointer-arith
+ -Werror=missing-declarations
+ -Werror=redundant-decls
+ -Werror=empty-body
+ -Werror=format
+ -Werror=format-security
+ -Werror=format-nonliteral
+ -Werror=init-self
+ -Werror=declaration-after-statement
+ -Werror=vla"
+])
AS_CASE([$enable_maintainer_flags],
[yes],