From cbf6736a5715a60855922e613b6776ed1204c2da Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 1 Nov 2013 10:34:43 +0000 Subject: [PATCH] =?UTF-8?q?build:=20Don=E2=80=99t=20unconditionally=20enab?= =?UTF-8?q?le=20-Werror=20for=20non-release=20builds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- configure.ac | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 35e4bc0..88fbf57 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,8 @@ 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 pased, +dnl also use -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" @@ -95,10 +96,19 @@ AC_CHECK_HEADERS([ifaddrs.h], \ 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" + +dnl If asked for, add -Werror if supported. +dnl This configure flag is designed to mimic one from gnome-common, +dnl but currently only the 'error' value is used. +AC_ARG_ENABLE(compile-warnings, + AS_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@], + [Turn on compiler warnings]),, + [enable_compile_warnings="yes"]) + +if test "$enable_compile_warnings" = "error"; then + LIBNICE_CFLAGS="$LIBNICE_CFLAGS -Werror" fi + # # Fixes for Solaris # -- 1.8.3.1