]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3155: Werror is hard-coded in libTrie build
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 17 Feb 2011 03:11:22 +0000 (16:11 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 17 Feb 2011 03:11:22 +0000 (16:11 +1300)
TODO: we should also adapt -Wall and suport non-GCC compiler flags

lib/libTrie/configure.ac

index 806cb06838ac2af60a8d6437f09d68ff7337e826..60c541cbead6e0c3a2ccae19efc6265196efcad6 100644 (file)
@@ -62,19 +62,34 @@ AC_LTDL_DLLIB
 AC_SUBST(INCLTDL)
 AC_SUBST(LIBLTDL)
 
-
 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)