summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-07-09 12:14:32 +0200
committerAlexander Larsson <alexl@redhat.com>2010-07-09 12:14:32 +0200
commitbc5c34584168d0c6c0d1b9b49c2344f8c12c63b1 (patch)
tree5cd98a9ede33955c1902a853b513081dc3040c0c
parent1d119d527ea14e115ef86fc7a98dd7cc69024b69 (diff)
Add --enable-werror and make it the default only for git builds0.5.2
Its not generally a good idea to have released tarballs build with -Werror, as later compilers may add warnings breaking old releases, etc.
-rw-r--r--GITVERSION0
-rw-r--r--configure.ac16
2 files changed, 15 insertions, 1 deletions
diff --git a/GITVERSION b/GITVERSION
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/GITVERSION
diff --git a/configure.ac b/configure.ac
index 80332526..6b70329f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -272,7 +272,18 @@ dnl MAYBE_WARN in an ignorable way (like adding whitespace)
dnl MAYBE_WARN="-Wall -Wno-sign-compare -Werror -Wno-deprecated-declarations"
-MAYBE_WARN="-Wall -Wno-sign-compare -Werror -Wno-deprecated-declarations"
+MAYBE_WARN="-Wall -Wno-sign-compare -Wno-deprecated-declarations"
+
+AC_ARG_ENABLE(werror,
+AC_HELP_STRING([--enable-werror], [Use -Werror (if supported)]),
+set_werror="$enableval",[
+if test -f $srcdir/GITVERSION; then
+ is_git_version=true
+ set_werror=yes
+else
+ set_werror=no
+fi
+])
# invalidate cached value if MAYBE_WARN has changed
@@ -297,6 +308,9 @@ AC_CACHE_CHECK([for supported warning flags], spice_cv_warn_cflags, [
for W in $MAYBE_WARN; do
SPICE_CC_TRY_FLAG([$W], [WARN_CFLAGS="$WARN_CFLAGS $W"])
done
+ if test "$set_werror" != "no"; then
+ SPICE_CC_TRY_FLAG(["-Werror"], [WARN_CFLAGS="$WARN_CFLAGS -Werror"])
+ fi
spice_cv_warn_cflags=$WARN_CFLAGS
spice_cv_warn_maybe=$MAYBE_WARN