From 29112b410a076d96a8b337017efc56b12f01ac73 Mon Sep 17 00:00:00 2001 From: John Hood Date: Tue, 22 Sep 2015 03:50:25 -0400 Subject: [PATCH] configure: add --enable-warnings=distcheck This disables -Werror everywhere but "Linux". The heuristic is rather crude. --- Makefile.am | 2 +- configure.ac | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index c5cf249..1922ceb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ SUBDIRS = src scripts man conf EXTRA_DIST = autogen.sh ocb-license.html README.md COPYING.iOS BUILT_SOURCES = version.h CLANG_SCAN_BUILD = scan-build -AM_DISTCHECK_CONFIGURE_FLAGS = --enable-compile-warnings=error --enable-examples +AM_DISTCHECK_CONFIGURE_FLAGS = --enable-compile-warnings=distcheck --enable-examples .PHONY: VERSION diff --git a/configure.ac b/configure.ac index 13d74ec..9e07a0c 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) WARNING_CXXFLAGS="" PICKY_CXXFLAGS="" AC_ARG_ENABLE([compile-warnings], - [AS_HELP_STRING([--enable-compile-warnings@<:@=no/yes/maximum/error@:>@], + [AS_HELP_STRING([--enable-compile-warnings@<:@=no/yes/maximum/error/distcheck@:>@], [Turn on compiler warnings])], [case "$enableval" in no) @@ -39,6 +39,14 @@ AC_ARG_ENABLE([compile-warnings], WARNING_CXXFLAGS="-Wall -Werror" PICKY_CXXFLAGS="-Wextra -pedantic -Wno-long-long -Weffc++ -Wmissing-declarations" ;; + distcheck) + if test "$(uname -s)" = Linux; then + WARNING_CXXFLAGS="-Wall -Werror" + else + WARNING_CXXFLAGS="-Wall" + fi + PICKY_CXXFLAGS="-Wextra -pedantic -Wno-long-long -Weffc++ -Wmissing-declarations" + ;; *) AC_MSG_ERROR([Unknown argument '$enableval' to --enable-compile-warnings]) ;;