From ca3324c4d88d1b24eee3ae5604bcc386a17d0451 Mon Sep 17 00:00:00 2001 From: ayin Date: Wed, 31 Oct 2007 11:55:23 +0000 Subject: [PATCH] Add configure option to enable g++ (sensible) warnings and disable all warnings by default. --- configure.ac | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/configure.ac b/configure.ac index 7db7fca4..6600a0ab 100644 --- a/configure.ac +++ b/configure.ac @@ -195,6 +195,22 @@ AC_ARG_ENABLE(everything, fi ]) +WARNINGS=no +AC_ARG_ENABLE(warnings, + [ --enable-warnings turn on g++ warnings], + [if test x$enableval = xyes; then + WARNINGS=yes + fi]) +if test x$GXX = xyes; then + if test $WARNINGS = yes; then + save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -Wall -Wno-sign-compare -Wno-reorder -Wno-non-virtual-dtor" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], [], [CXXFLAGS="$save_CXXFLAGS"]) + else + CXXFLAGS="$CXXFLAGS -w" + fi +fi + AC_ARG_ENABLE(unicode3, [ --enable-unicode3 use 21 instead of 16 bits to represent unicode characters], [if test x$enableval = xyes -o x$enableval = xno; then -- 2.34.1