[Pkg-telepathy-commits] [libnice] 44/265: build: Don’t unconditionally enable -Werror for non-release builds
Simon McVittie
smcv at debian.org
Wed May 14 12:04:51 UTC 2014
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian
in repository libnice.
commit c2ccb1634542f7d9c2a87aa46af027e6df386dd8
Author: Philip Withnall <philip.withnall at collabora.co.uk>
Date: Fri Nov 1 10:34:43 2013 +0000
build: Don’t unconditionally enable -Werror for non-release builds
Do not unconditionally enable -Werror, since that breaks the build for
people who have stricter compilation warnings enabled.
Instead, add an --enable-compile-warnings configure flag which enables
-Werror when passed as --enable-compile-warnings=error. This mimics the
flag in gnome-common, for consistency. But we enable errors by default
on non-released versions.
---
configure.ac | 53 +++++++++++++++++++++++++++++++++++------------------
1 file changed, 35 insertions(+), 18 deletions(-)
diff --git a/configure.ac b/configure.ac
index 2173a4e..1e0d9af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,9 @@
AC_PREREQ(2.59c)
-dnl releases only do -Wall, cvs and prerelease does -Werror too
+dnl Always compile with -Wall; if --enable-compile-warnings=error is passed,
+dnl also use -Werror. git and pre-releases default to -Werror
+
dnl use a three digit version number for releases, and four for cvs/prerelease
AC_INIT([libnice],[0.1.4.1])
LIBNICE_RELEASE="no"
@@ -94,29 +96,44 @@ AC_CHECK_HEADERS([ifaddrs.h], \
# Also put matching version in LIBNICE_CFLAGS
GLIB_REQ=2.30
-LIBNICE_CFLAGS="-Wall -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_30 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32"
-dnl if asked for, add -Werror if supported
-if test "x$LIBNICE_RELEASE" != "xyes"; then
- LIBNICE_CFLAGS="$LIBNICE_CFLAGS -Werror"
-fi
+LIBNICE_CFLAGS="-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_30 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32"
+
+dnl Support different levels of compiler error reporting.
+dnl This configure flag is designed to mimic one from gnome-common,
+dnl Defaults to "error" except for releases where it defaults to "yes"
+AC_ARG_ENABLE(compile-warnings,
+ AS_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
+ [Enable different levels of compiler warnings]),,
+ [AS_IF([test "$LIBNICE_RELEASE" = "yes"],
+ [enable_compile_warnings="yes"],
+ [enable_compile_warnings="error"])])
AC_DEFUN([NICE_ADD_FLAG],
AS_COMPILER_FLAG([$1], LIBNICE_CFLAGS="$LIBNICE_CFLAGS $1", [])
)
NICE_ADD_FLAG([-fno-strict-aliasing])
-NICE_ADD_FLAG([-Wextra])
-NICE_ADD_FLAG([-Wundef])
-NICE_ADD_FLAG([-Wnested-externs])
-NICE_ADD_FLAG([-Wwrite-strings])
-NICE_ADD_FLAG([-Wpointer-arith])
-NICE_ADD_FLAG([-Wbad-function-cast])
-NICE_ADD_FLAG([-Wmissing-declarations])
-NICE_ADD_FLAG([-Wmissing-prototypes])
-NICE_ADD_FLAG([-Wstrict-prototypes])
-NICE_ADD_FLAG([-Wredundant-decls])
-NICE_ADD_FLAG([-Wno-unused-parameter])
-NICE_ADD_FLAG([-Wno-missing-field-initializers])
+
+AS_IF([test "x$enable_compile_warnings" != "xno"],[
+ NICE_ADD_FLAG([-Wall])
+ AS_IF([test "x$enable_compile_warnings" != "xminimum"],[
+ NICE_ADD_FLAG([-Wextra])
+ NICE_ADD_FLAG([-Wundef])
+ NICE_ADD_FLAG([-Wnested-externs])
+ NICE_ADD_FLAG([-Wwrite-strings])
+ NICE_ADD_FLAG([-Wpointer-arith])
+ NICE_ADD_FLAG([-Wbad-function-cast])
+ NICE_ADD_FLAG([-Wmissing-declarations])
+ NICE_ADD_FLAG([-Wmissing-prototypes])
+ NICE_ADD_FLAG([-Wstrict-prototypes])
+ NICE_ADD_FLAG([-Wredundant-decls])
+ NICE_ADD_FLAG([-Wno-unused-parameter])
+ NICE_ADD_FLAG([-Wno-missing-field-initializers])
+ ])
+])
+AS_IF([test "x$enable_compile_warnings" = "xerror"],[
+ NICE_ADD_FLAG([-Werror])
+])
#
# Fixes for Solaris
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/libnice.git
More information about the Pkg-telepathy-commits
mailing list