OSDN Git Service

* configure.ac: Introduce ---enable-werror, which adds -Werror to
authorkettenis <kettenis>
Tue, 21 Feb 2006 21:02:25 +0000 (21:02 +0000)
committerkettenis <kettenis>
Tue, 21 Feb 2006 21:02:25 +0000 (21:02 +0000)
the compiler command line.  Enabled by default.  Disable with
--disable-werror.
* configure regenerate.

gdb/ChangeLog
gdb/configure
gdb/configure.ac

index 4fd194c..f71884b 100644 (file)
@@ -1,3 +1,10 @@
+2006-02-21  Mark Kettenis  <kettenis@gnu.org>
+
+       * configure.ac: Introduce ---enable-werror, which adds -Werror to
+       the compiler command line.  Enabled by default.  Disable with
+       --disable-werror.
+       * configure regenerate.
+
 2006-02-21  Daniel Jacobowitz  <dan@codesourcery.com>
 
         * elfread.c (elf_symtab_read): Skip symbols which BFD considers
index cf547b7..869eb4b 100755 (executable)
@@ -867,6 +867,7 @@ Optional Features:
   --enable-tui            enable full-screen terminal user interface (TUI)
   --enable-gdbtk          enable gdbtk graphical user interface (GUI)
   --enable-profiling      enable profiling of GDB
+  --enable-werror    treat compile warnings as errors
   --enable-build-warnings Enable build-time compiler warnings if gcc is used
   --enable-gdb-build-warnings Enable GDB specific build-time compiler warnings if gcc is used
   --enable-sim            Link gdb with simulator
@@ -19941,6 +19942,28 @@ fi;
 
 
 
+# Check whether --enable-werror or --disable-werror was given.
+if test "${enable_werror+set}" = set; then
+  enableval="$enable_werror"
+  case "${enableval}" in
+     yes | y) ERROR_ON_WARNING="yes" ;;
+     no | n)  ERROR_ON_WARNING="no" ;;
+     *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-werror" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-werror" >&2;}
+   { (exit 1); exit 1; }; } ;;
+   esac
+fi;
+
+# Enable -Werror by default when using gcc
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+    ERROR_ON_WARNING=yes
+fi
+
+WERROR_CFLAGS=""
+if test "${ERROR_ON_WARNING}" = yes ; then
+    WERROR_CFLAGS="-Werror"
+fi
+
 # NOTE: Don't add -Wall or -Wunused, they both include
 # -Wunused-parameter which reports bogus warnings.
 # NOTE: If you add to this list, remember to update
@@ -19998,7 +20021,6 @@ if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
   echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1
 fi
 fi; WARN_CFLAGS=""
-WERROR_CFLAGS=""
 if test "x${build_warnings}" != x -a "x$GCC" = xyes
 then
     echo "$as_me:$LINENO: checking compiler warning flags" >&5
index 1861275..2725e18 100644 (file)
@@ -1114,6 +1114,24 @@ AC_ARG_WITH(sysroot,
 AC_SUBST(TARGET_SYSTEM_ROOT)
 AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
 
+AC_ARG_ENABLE(werror,
+  [  --enable-werror    treat compile warnings as errors],
+  [case "${enableval}" in
+     yes | y) ERROR_ON_WARNING="yes" ;;
+     no | n)  ERROR_ON_WARNING="no" ;;
+     *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
+   esac])
+
+# Enable -Werror by default when using gcc
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+    ERROR_ON_WARNING=yes
+fi
+
+WERROR_CFLAGS=""
+if test "${ERROR_ON_WARNING}" = yes ; then
+    WERROR_CFLAGS="-Werror"
+fi
+
 # NOTE: Don't add -Wall or -Wunused, they both include
 # -Wunused-parameter which reports bogus warnings.
 # NOTE: If you add to this list, remember to update
@@ -1169,7 +1187,6 @@ if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
   echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1
 fi])dnl
 WARN_CFLAGS=""
-WERROR_CFLAGS=""
 if test "x${build_warnings}" != x -a "x$GCC" = xyes
 then
     AC_MSG_CHECKING(compiler warning flags)