configure: add --enable-warnings=distcheck

This disables -Werror everywhere but "Linux".
The heuristic is rather crude.
This commit is contained in:
John Hood
2015-09-22 03:50:25 -04:00
parent 5959342ac7
commit 29112b410a
2 changed files with 10 additions and 2 deletions
+9 -1
View File
@@ -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])
;;