public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH/committed] sim: warnings: enable only for development builds
Date: Mon,  4 Dec 2023 23:47:48 -0500	[thread overview]
Message-ID: <20231205044748.2009-1-vapier@gentoo.org> (raw)

Reuse the bfd/development.sh script like most other project to
determine whether the current source tree is a dev build (e.g.
git) or a release build, and disable the warnings for releases.
---
 sim/Makefile.am                  | 2 ++
 sim/Makefile.in                  | 1 +
 sim/configure                    | 8 +++++---
 sim/configure.ac                 | 3 +++
 sim/m4/sim_ac_option_warnings.m4 | 4 ++--
 5 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/sim/Makefile.am b/sim/Makefile.am
index 3693eb18d496..b42926070dbd 100644
--- a/sim/Makefile.am
+++ b/sim/Makefile.am
@@ -45,6 +45,8 @@ MOSTLYCLEANFILES = core
 ## make sure all objects in subdirs get cleaned up.
 MOSTLYCLEANFILES += $(SIM_ENABLED_ARCHES:%=%/*.o)
 
+CONFIG_STATUS_DEPENDENCIES = $(srcroot)/bfd/development.sh
+
 AM_CFLAGS = \
 	$(WERROR_CFLAGS) \
 	$(WARN_CFLAGS) \
diff --git a/sim/Makefile.in b/sim/Makefile.in
index 3dd14543450e..ec24aa196acf 100644
--- a/sim/Makefile.in
+++ b/sim/Makefile.in
@@ -1798,6 +1798,7 @@ MOSTLYCLEANFILES = core $(SIM_ENABLED_ARCHES:%=%/*.o) \
 	$(am__append_57) $(am__append_61) $(am__append_75) \
 	$(am__append_80) $(am__append_88) $(am__append_103) \
 	$(am__append_107)
+CONFIG_STATUS_DEPENDENCIES = $(srcroot)/bfd/development.sh
 AM_CFLAGS = \
 	$(WERROR_CFLAGS) \
 	$(WARN_CFLAGS) \
diff --git a/sim/configure b/sim/configure
index de67d95d4abf..32cd8fb051fc 100755
--- a/sim/configure
+++ b/sim/configure
@@ -3009,6 +3009,8 @@ _ACEOF
 ac_config_headers="$ac_config_headers config.h"
 
 
+. $srcdir/../bfd/development.sh
+
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
   if test -f "$ac_dir/install-sh"; then
@@ -12288,7 +12290,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12291 "configure"
+#line 12293 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12394,7 +12396,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12397 "configure"
+#line 12399 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -15811,7 +15813,7 @@ if test "${enable_werror+set}" = set; then :
 fi
 
 
-if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then
   ERROR_ON_WARNING=yes
 fi
 
diff --git a/sim/configure.ac b/sim/configure.ac
index ecda34a6b3fc..84a7e0a249e7 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -14,6 +14,9 @@ AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address
 
 AC_CONFIG_HEADERS([config.h])
 
+dnl Set the 'development' global before loading the SIM macros.
+. $srcdir/../bfd/development.sh
+
 SIM_AC_TOOLCHAIN
 SIM_AC_PLATFORM
 
diff --git a/sim/m4/sim_ac_option_warnings.m4 b/sim/m4/sim_ac_option_warnings.m4
index 8ff94df03209..16d358b0bbaa 100644
--- a/sim/m4/sim_ac_option_warnings.m4
+++ b/sim/m4/sim_ac_option_warnings.m4
@@ -25,8 +25,8 @@ AC_ARG_ENABLE(werror,
      *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
    esac])
 
-dnl Enable -Werror by default when using gcc
-if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+dnl 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
 
-- 
2.43.0


                 reply	other threads:[~2023-12-05  4:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231205044748.2009-1-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).