From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 3/5] sim: ppc: rework defines.h to handle HAVE symbols defined to 0
Date: Tue, 9 Jan 2024 20:58:24 -0500 [thread overview]
Message-ID: <20240110015826.19937-3-vapier@gentoo.org> (raw)
In-Reply-To: <20240110015826.19937-1-vapier@gentoo.org>
The HAVE_DECL_xxx defines are always defined to 0 or 1. The current
defines.h logic assumes every HAVE_xxx symbol is only defined iff it's
defined to 1 which causes this to break. Tweak the sed logic to only
match defines of 1.
---
sim/Makefile.in | 2 +-
sim/ppc/local.mk | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sim/Makefile.in b/sim/Makefile.in
index 1e94771577d9..b407b37803c5 100644
--- a/sim/Makefile.in
+++ b/sim/Makefile.in
@@ -5823,7 +5823,7 @@ testsuite/common/bits64m63.c: testsuite/common/bits-gen$(EXEEXT) testsuite/commo
@SIM_ENABLE_ARCH_ppc_TRUE@ppc/defines.h: ppc/stamp-defines ; @true
@SIM_ENABLE_ARCH_ppc_TRUE@ppc/stamp-defines: config.h Makefile
-@SIM_ENABLE_ARCH_ppc_TRUE@ $(AM_V_GEN)sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > ppc/defines.hin
+@SIM_ENABLE_ARCH_ppc_TRUE@ $(AM_V_GEN)$(SED) -n -e '/^#define HAVE_.*1$$/{ s/ 1$$/",/; s/.* HAVE_/"HAVE_/; p }' < config.h > ppc/defines.hin
@SIM_ENABLE_ARCH_ppc_TRUE@ $(AM_V_at)$(SHELL) $(srcroot)/move-if-change ppc/defines.hin ppc/defines.h
@SIM_ENABLE_ARCH_ppc_TRUE@ $(AM_V_at)touch $@
diff --git a/sim/ppc/local.mk b/sim/ppc/local.mk
index 3f495cb44c0b..0031753b74bc 100644
--- a/sim/ppc/local.mk
+++ b/sim/ppc/local.mk
@@ -80,7 +80,7 @@ noinst_PROGRAMS += %D%/run
%D%/defines.h: %D%/stamp-defines ; @true
%D%/stamp-defines: config.h Makefile
- $(AM_V_GEN)sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > %D%/defines.hin
+ $(AM_V_GEN)$(SED) -n -e '/^#define HAVE_.*1$$/{ s/ 1$$/",/; s/.* HAVE_/"HAVE_/; p }' < config.h > %D%/defines.hin
$(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/defines.hin %D%/defines.h
$(AM_V_at)touch $@
--
2.43.0
next prev parent reply other threads:[~2024-01-10 1:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-10 1:58 [PATCH 1/5] gdb: move libiberty.m4 to gdbsupport Mike Frysinger
2024-01-10 1:58 ` [PATCH 2/5] gdb: libiberty: switch to AC_CHECK_DECLS_ONCE Mike Frysinger
2024-01-10 18:18 ` Tom Tromey
2024-01-10 1:58 ` Mike Frysinger [this message]
2024-01-10 1:58 ` [PATCH 4/5] sim: build: switch to gdbsupport/libiberty.m4 Mike Frysinger
2024-01-10 1:58 ` [PATCH 5/5] gdbsupport: tighten up libiberty code a bit with dnl Mike Frysinger
2024-01-10 18:19 ` Tom Tromey
2024-01-10 18:18 ` [PATCH 1/5] gdb: move libiberty.m4 to gdbsupport Tom Tromey
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=20240110015826.19937-3-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).