[RFA] Do not build gdbserver with -Werror by default if development=false

Message ID 1400534725-931-1-git-send-email-brobecker@adacore.com
State Committed
Headers

Commit Message

Joel Brobecker May 19, 2014, 9:25 p.m. UTC
  Hello,

On GDB release branches, we change $development in gdb/development.sh
to false, in order to build the GDB release without -Werror by default,
thus avoiding harmless compiler warnings from breaking the build of
someone who's only interested in building GDB rather than working
on it.

This patch implements the same strategy for gdbserver, using the exact
same method.

gdb/gdbserver/ChangeLog:

        * configure.ac: Only use -Werror by default when DEVELOPMENT
        is true.
        * configure: Regenerate.

Tested on x86_64-linux, by rebuilding GDBserver first with development
set to true, and then doing it again with development set to false.
Werror was used in the first case, but not in the second.


OK to commit?

Thanks,
  

Comments

Doug Evans May 19, 2014, 10:52 p.m. UTC | #1
On Mon, May 19, 2014 at 2:25 PM, Joel Brobecker <brobecker@adacore.com> wrote:
> Hello,
>
> On GDB release branches, we change $development in gdb/development.sh
> to false, in order to build the GDB release without -Werror by default,
> thus avoiding harmless compiler warnings from breaking the build of
> someone who's only interested in building GDB rather than working
> on it.
>
> This patch implements the same strategy for gdbserver, using the exact
> same method.
>
> gdb/gdbserver/ChangeLog:
>
>         * configure.ac: Only use -Werror by default when DEVELOPMENT
>         is true.
>         * configure: Regenerate.
>
> Tested on x86_64-linux, by rebuilding GDBserver first with development
> set to true, and then doing it again with development set to false.
> Werror was used in the first case, but not in the second.
>
>
> OK to commit?

We've done this with gdb for awhile, so I see no reason to not do it
for gdbserver.
[fwiw]
  
Pedro Alves May 20, 2014, 11:19 a.m. UTC | #2
On 05/19/2014 11:52 PM, Doug Evans wrote:

>> OK to commit?
> 
> We've done this with gdb for awhile, so I see no reason to not do it
> for gdbserver.
> [fwiw]

Agreed.
  
Joel Brobecker May 20, 2014, 1:27 p.m. UTC | #3
> > We've done this with gdb for awhile, so I see no reason to not do it
> > for gdbserver.
> > [fwiw]
> 
> Agreed.

Thank you, guys! Patch just pushed.
  

Patch

diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 6d8a6a7..101062f 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -5244,8 +5244,8 @@  if test "${enable_werror+set}" = set; then :
 fi
 
 
-# Enable -Werror by default when using gcc
-if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+# Enable -Werror by default when using gcc.  Turn it off for releases.
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then
     ERROR_ON_WARNING=yes
 fi
 
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 0dfa4a9..89a8eea 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -143,8 +143,8 @@  AC_ARG_ENABLE(werror,
      *) 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
+# Enable -Werror by default when using gcc.  Turn it off for releases.
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then
     ERROR_ON_WARNING=yes
 fi