aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2014-05-19 14:46:01 -0700
committerJoel Brobecker <brobecker@adacore.com>2014-06-05 05:47:29 -0700
commit270c9937446ca5273caf7fb102bcdba9ed7cff41 (patch)
tree95ce40cb57984c812efb1197ac89aeb806610824 /bfd
parenta872e241e2c2d23f3b14bc122cea6adc05a40d25 (diff)
downloadbinutils-270c9937446ca5273caf7fb102bcdba9ed7cff41.zip
binutils-270c9937446ca5273caf7fb102bcdba9ed7cff41.tar.gz
binutils-270c9937446ca5273caf7fb102bcdba9ed7cff41.tar.bz2
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog9
-rw-r--r--bfd/Makefile.am3
-rw-r--r--bfd/Makefile.in3
-rwxr-xr-xbfd/configure7
-rw-r--r--bfd/development.sh19
-rw-r--r--bfd/warning.m47
6 files changed, 42 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e6b88e3..1ff9fca 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,12 @@
+2014-06-05 Joel Brobecker <brobecker@adacore.com>
+
+ * 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.
+
2014-06-04 Will Newton <will.newton@linaro.org>
* elfnn-aarch64.c (tpoff_base): Make test of tls_sec
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 2ba2180..595c489 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -741,7 +741,8 @@ OPTIONAL_BACKENDS_CFILES = \
CONFIG_STATUS_DEPENDENCIES = \
$(srcdir)/configure.in \
$(srcdir)/config.bfd \
- $(srcdir)/configure.host
+ $(srcdir)/configure.host \
+ $(srcdir)/development.sh
# These are defined by configure.in:
WORDSIZE = @wordsize@
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 8a2764d..2ea8516 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -1045,7 +1045,8 @@ OPTIONAL_BACKENDS_CFILES = \
CONFIG_STATUS_DEPENDENCIES = \
$(srcdir)/configure.in \
$(srcdir)/config.bfd \
- $(srcdir)/configure.host
+ $(srcdir)/configure.host \
+ $(srcdir)/development.sh
# These are defined by configure.in:
diff --git a/bfd/configure b/bfd/configure
index b4f8653..f3df01c 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -12158,6 +12158,9 @@ fi
+# 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. */
@@ -12192,8 +12195,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
diff --git a/bfd/development.sh b/bfd/development.sh
new file mode 100644
index 0000000..4c0f5b9
--- /dev/null
+++ b/bfd/development.sh
@@ -0,0 +1,19 @@
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
+#
+# This file is part of GDB.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Controls whether to enable development-mode features by default.
+development=true
diff --git a/bfd/warning.m4 b/bfd/warning.m4
index 28e9f8a..b1a8c7b 100644
--- a/bfd/warning.m4
+++ b/bfd/warning.m4
@@ -18,6 +18,9 @@ dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([AM_BINUTILS_WARNINGS],[
+# Set the 'development' global.
+. $srcdir/../bfd/development.sh
+
GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
AC_EGREP_CPP([^[0-3]$],[__GNUC__],,GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wshadow")
@@ -39,8 +42,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