From 8216abc5877a29bd8c20d8adb257e084d1390f29 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 15 Jan 2016 13:33:52 -0600 Subject: [PATCH] build: Add an --enable-fatal-warnings configure option New --enable-fatal-warnings ./configure option that just adds -Werror to GCC_CFLAGS Signed-off-by: Derek Foreman Reviewed-by: Bryce Harrington --- configure.ac | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 65ab8ef..af5b7cd 100644 --- a/configure.ac +++ b/configure.ac @@ -47,8 +47,17 @@ LT_INIT PKG_PROG_PKG_CONFIG() +AC_ARG_ENABLE([fatal-warnings], + AC_HELP_STRING([--enable-fatal-warnings], + [Build with -Werror]), + [enable_fatal_warnings=$enableval], + [enable_fatal_warnings=no]) +AS_IF([test x"$enable_fatal_warnings" != "xno"], [ + WERROR_CFLAGS="-Werror" +]) + if test "x$GCC" = "xyes"; then - GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden" + GCC_CFLAGS="$WERROR_CFLAGS -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden" fi AC_SUBST(GCC_CFLAGS) -- 2.7.4