From: Amos Jeffries Date: Mon, 28 Feb 2011 10:41:20 +0000 (-0700) Subject: Bug 3155: Werror is hard-coded in libTrie build X-Git-Tag: SQUID_3_1_12~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa12dbc32840af11b107ab8ed9e12fd22b3ab3c6;p=thirdparty%2Fsquid.git Bug 3155: Werror is hard-coded in libTrie build TODO: we should also adapt -Wall and suport non-GCC compiler flags --- diff --git a/lib/libTrie/configure.ac b/lib/libTrie/configure.ac index a1621ae106..ffbf3d1de1 100644 --- a/lib/libTrie/configure.ac +++ b/lib/libTrie/configure.ac @@ -58,17 +58,33 @@ AM_MAINTAINER_MODE AC_PROG_RANLIB dnl set useful flags +TRIE_CFLAGS= +TRIE_CXXFLAGS= if test "$GCC" = "yes"; then - TRIE_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments" - TRIE_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments" -else - TRIE_CFLAGS= - TRIE_CXXFLAGS= -fi + TRIE_CFLAGS="-Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments" + TRIE_CXXFLAGS="-Wall -Wpointer-arith -Wwrite-strings -Wcomments" + + AC_ARG_ENABLE(strict-error-checking, + AS_HELP_STRING([--disable-strict-error-checking],[By default compile + with all possible static compiler error-checks enabled. + This flag disables the behavior]), [ + case $enableval in + yes|1|true) + enable_strict_error_checking=yes + ;; + *) + enable_strict_error_checking=no + ;; + esac + ]) + AC_MSG_NOTICE([strict error checking enabled: ${enable_strict_error_checking:=yes}]) + if test "x${enable_strict_error_checking:=yes}" = "xyes"; then + TRIE_CFLAGS="-Werror $TRIE_CFLAGS" + TRIE_CXXFLAGS="-Werror $TRIE_CXXFLAGS" + fi -if test "$GCC" = "yes" ; then - AC_TEST_CHECKFORHUGEOBJECTS - TRIE_CXXFLAGS="$TRIE_CXXFLAGS $HUGE_OBJECT_FLAG" + AC_TEST_CHECKFORHUGEOBJECTS + TRIE_CXXFLAGS="$TRIE_CXXFLAGS $HUGE_OBJECT_FLAG" fi AC_SUBST(TRIE_CFLAGS)