From 0846ae35a1a2d9968105a0174d82539f1927ba28 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 9 Jan 2024 20:55:43 -0500 Subject: sim: ppc: rework defines.h to handle HAVE symbols defined to 0 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(-) (limited to 'sim') diff --git a/sim/Makefile.in b/sim/Makefile.in index 1e94771..b407b37 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 3f495cb..0031753 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 $@ -- cgit v1.1