[binutils-gdb] sim/ppc: make defines.h sed command portable

Simon Marchi via Gdb-cvs <[email protected]>
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=88629da8ad34c10c7e4cfecbd672a6ad1338e91c

commit 88629da8ad34c10c7e4cfecbd672a6ad1338e91c
Author: Simon Marchi <[email protected]>
Date:   Mon Aug 17 11:16:09 2026 -0400

    sim/ppc: make defines.h sed command portable
    
    When building on macOS, whose sed is the BSD one, I get:
    
          GEN      ppc/stamp-defines
        sed: 1: "/^#define HAVE_.*1$/{ s ...": extra characters at the end of p command
        make[1]: *** [ppc/stamp-defines] Error 1
    
    BSD sed apparently does not accept a `}' directly after another command,
    it needs a separating semicolon.  Add one after the `p'.  GNU sed
    accepts both forms, and produces the same output either way.
    
    Re-generate sim/Makefile.in.
    
    Change-Id: I0709ad7b0051e08299f2576113b549aba9fc703f
    Approved-By: Andrew Burgess <[email protected]>

Diff:
---
 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 1f9bbfec03f..2a23b5c2eaa 100644
--- a/sim/Makefile.in
+++ b/sim/Makefile.in
@@ -5722,7 +5722,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_.*1$$/{ s/ 1$$/",/; s/.* HAVE_/"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 f9f134abe3c..9aca96465ac 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_.*1$$/{ s/ 1$$/",/; s/.* HAVE_/"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 $@
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.