]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: ppc: rework defines.h to handle HAVE symbols defined to 0
authorMike Frysinger <vapier@gentoo.org>
Wed, 10 Jan 2024 01:55:43 +0000 (20:55 -0500)
committerMike Frysinger <vapier@gentoo.org>
Thu, 11 Jan 2024 00:53:10 +0000 (19:53 -0500)
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
sim/ppc/local.mk

index 1e94771577d95a7e9b9473ed16272728ecdb23bc..b407b37803c5abd95a05611b626dc0c217d5ae3d 100644 (file)
@@ -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 $@
 
index 3f495cb44c0b3c0c0997d175896d96640bb6def1..0031753b74bc2b863568a0761493bbc86d42067f 100644 (file)
@@ -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 $@