From 270c9937446ca5273caf7fb102bcdba9ed7cff41 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Mon, 19 May 2014 14:46:01 -0700 Subject: Make it easy to make --disable-werror the default for both binutils and gdb The goal of this patch is to provide an easy way to make --disable-werror the default when building binutils, or the parts of binutils that need to get built when building GDB. In development mode, we want to continue making -Werror the default with GCC. But, when making releases, I think we want to make it as easy as possible for regular users to successfully build from sources. GDB already has this kind of feature to turn -Werror as well as the use of the libmcheck library. As GDB Release Manager, I take advantage of it to turn those off after having cut the branch. I'd like to be able to do the same for the binutils bits. And perhaps Tristan will want to do the same for his releases too (not sure, binutils builders might be a little savvier than GDB builders). This patch introduces a new file, called development.sh, which just sets a variable called $development. In our development branches (Eg. "master"), it's set to true. But setting it to false would allow us to change the default behavior of various development-related features to be turned off; in this case, it turns off the use of -Werror by default (use --enable-werror to turn it back on). bfd/ChangeLog: * development.sh: New file. * warning.m4 (AM_BINUTILS_WARNINGS): Source bfd/development.sh. Make -Werror the default with GCC only if DEVELOPMENT is true. * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add $(srcdir)/development.sh. * Makefile.in, configure: Regenerate. binutils/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on bfd's development.sh. * Makefile.in, configure: Regenerate. gas/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on bfd's development.sh. * Makefile.in, configure: Regenerate. gold/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New. * Makefile.in, configure: Regenerate. gprof/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on bfd's development.sh. * Makefile.in, configure: Regenerate. ld/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on bfd's development.sh. * Makefile.in, configure: Regenerate. opcodes/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on bfd's development.sh. * Makefile.in, configure: Regenerate. gdb/ChangeLog: * development.sh: Delete. * Makefile.in (config.status): Adjust dependency on development.sh. * configure.ac: Adjust development.sh source call. * configure: Regenerate. gdb/gdbserver/ChangeLog: * configure.ac: Adjust development.sh source call. * Makefile.in (config.status): Adjust dependency on development.sh. * configure: Regenerate. Tested on x86_64-linux by building two ways: One with DEVELOPMENT set to true, and one with DEVELOPMENT set to false. In the first case, I could see the use of -Werror, while it disappeared in the second case. --- ld/ChangeLog | 6 ++++++ ld/Makefile.am | 3 ++- ld/Makefile.in | 3 ++- ld/configure | 11 +++++++---- 4 files changed, 17 insertions(+), 6 deletions(-) (limited to 'ld') diff --git a/ld/ChangeLog b/ld/ChangeLog index dc8d552..c42cdc8 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2014-06-05 Joel Brobecker + + * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on + bfd's development.sh. + * Makefile.in, configure: Regenerate. + 2014-06-02 Alan Modra * emulparams/elf32bfin.sh: Rename from bfin.sh. diff --git a/ld/Makefile.am b/ld/Makefile.am index 24ba3e1..44e7ca6 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -2057,7 +2057,8 @@ MAINTAINERCLEANFILES = configdoc.texi ld.1 # We want to reconfigure if configure.host or configure.tgt changes. We # extract version from bfd/configure.in, so we must depend on that also. CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt \ - $(srcdir)/../bfd/configure.in + $(srcdir)/../bfd/configure.in \ + $(srcdir)/../bfd/development.sh MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \ ldemul-list.h crtbegin.@OBJEXT@ crtend.@OBJEXT@ ld.log ld.sum diff --git a/ld/Makefile.in b/ld/Makefile.in index 9dd4399..2582cea 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -888,7 +888,8 @@ MAINTAINERCLEANFILES = configdoc.texi ld.1 ld.info # We want to reconfigure if configure.host or configure.tgt changes. We # extract version from bfd/configure.in, so we must depend on that also. CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt \ - $(srcdir)/../bfd/configure.in + $(srcdir)/../bfd/configure.in \ + $(srcdir)/../bfd/development.sh MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \ ldemul-list.h crtbegin.@OBJEXT@ crtend.@OBJEXT@ ld.log ld.sum diff --git a/ld/configure b/ld/configure index b6c3246..6dd7bc6 100755 --- a/ld/configure +++ b/ld/configure @@ -4642,6 +4642,9 @@ $as_echo "$ac_cv_path_EGREP" >&6; } +# Set the 'development' global. +. $srcdir/../bfd/development.sh + GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4676,8 +4679,8 @@ case "${host}" in *) ;; 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}" -a "$development" = true ; then ERROR_ON_WARNING=yes fi @@ -12193,7 +12196,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12196 "configure" +#line 12199 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12299,7 +12302,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12302 "configure" +#line 12305 "configure" #include "confdefs.h" #if HAVE_DLFCN_H -- cgit v1.1