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] sim: ppc: inline the sim-packages option
Date: Sat,  5 Nov 2022 10:42:55 +0700	[thread overview]
Message-ID: <20221105034255.30375-1-vapier@gentoo.org> (raw)

This has only ever had a single option that's enabled by default.
The objects it adds are pretty small and don't add overhead at
runtime if it isn't used, so just enable it all the time to make
the build code simpler.
---
 sim/ppc/Makefile.in  | 18 ++++++++++--------
 sim/ppc/configure    | 31 -------------------------------
 sim/ppc/configure.ac | 24 ------------------------
 sim/ppc/pk.h         |  2 ++
 4 files changed, 12 insertions(+), 63 deletions(-)
 create mode 100644 sim/ppc/pk.h

diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index b1fda1fbff42..6575f962c9dd 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -516,8 +516,8 @@ GDB_OBJ = gdb-sim.o sim_calls.o
 HW_SRC = @sim_hw_src@
 HW_OBJ = @sim_hw_obj@
 
-PACKAGE_SRC = @sim_pk_src@
-PACKAGE_OBJ = @sim_pk_obj@
+PACKAGE_SRC = pk_disklabel.c
+PACKAGE_OBJ = $(PACKAGE_SRC:.c=.o)
 
 
 psim$(EXEEXT): $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB)
@@ -528,7 +528,7 @@ run$(EXEEXT): psim$(EXEEXT)
 	$(SILENCE) rm -f $@
 	$(ECHO_GEN) ln $< $@ 2>/dev/null || $(LN_S) $< $@ 2>/dev/null || cp -p $< $@
 
-$(TARGETLIB): tmp-igen tmp-dgen tmp-hw tmp-pk tmp-defines $(LIB_OBJ) $(GDB_OBJ)
+$(TARGETLIB): tmp-igen tmp-dgen tmp-hw tmp-defines $(LIB_OBJ) $(GDB_OBJ)
 	$(ECHO_AR) $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
 	$(ECHO_RANLIB) $(RANLIB) $(TARGETLIB)
 
@@ -782,10 +782,12 @@ hw_vm.o: hw_vm.c $(DEVICE_TABLE_H) $(CPU_H)
 
 
 # real packages
-pk.h: tmp-pk; @true
-tmp-pk: Makefile $(PACKAGE_SRC) $(srcroot)/move-if-change
+$(srcdir)/pk.h: $(MAINT) tmp-pk
+	@true
+tmp-pk: $(srcdir)/Makefile.in $(PACKAGE_SRC) $(srcroot)/move-if-change
 	$(ECHO_GEN)# The first for loop is to remove duplicates.
-	$(SILENCE) f=""; \
+	$(SILENCE) echo "/* Generated file by Makefile.in; do not edit.  */" > tmp-pk.h; \
+	f=""; \
 	for i in $(PACKAGE_SRC) ; do \
 	  case " $$f " in \
 	    *" $$i "*) ;; \
@@ -796,8 +798,8 @@ tmp-pk: Makefile $(PACKAGE_SRC) $(srcroot)/move-if-change
 	| sed -e 's/^.*pk_\(.*\)\.c/\1/' \
 		-e 's/^/extern package_create_instance_callback pk_/' \
 		-e 's/$$/_create_instance;/' \
-		> tmp-pk.h
-	$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-pk.h pk.h
+		>> tmp-pk.h
+	$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-pk.h $(srcdir)/pk.h
 	$(SILENCE) touch $@
 
 pk_disklabel.o: pk_disklabel.c $(DEVICE_TABLE_H) $(PK_H)
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index b5909b705719..f26912eacde0 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -337,28 +337,6 @@ if test x"$silent" != x"yes"; then
 fi])dnl
 
 
-AC_ARG_ENABLE(sim-packages,
-[  --enable-sim-packages=list		Specify the packages to be included in the build.],
-[packages=disklabel
-case "${enableval}" in
-  yes)	;;
-  no)	AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
-  ,*)   packages="${packages}${enableval}";;
-  *,)   packages="${enableval}${packages}";;
-  *)	packages="${enableval}"'';;
-esac
-sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
-sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
-if test x"$silent" != x"yes" && test x"$packages" != x""; then
-  echo "Setting packages to $sim_pk_src, $sim_pk_obj"
-fi],[packages=disklabel
-sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
-sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
-if test x"$silent" != x"yes"; then
-  echo "Setting packages to $sim_pk_src, $sim_pk_obj"
-fi])dnl
-
-
 AC_ARG_ENABLE(sim-smp,
 [  --enable-sim-smp=n			Specify number of processors to configure for.],
 [case "${enableval}" in
@@ -590,8 +568,6 @@ AC_SUBST(sim_filter)
 AC_SUBST(sim_icache)
 AC_SUBST(sim_hw_src)
 AC_SUBST(sim_hw_obj)
-AC_SUBST(sim_pk_src)
-AC_SUBST(sim_pk_obj)
 AC_SUBST(sim_xor_endian)
 AC_SUBST(sim_smp)
 AC_SUBST(sim_igen_smp)
diff --git a/sim/ppc/pk.h b/sim/ppc/pk.h
new file mode 100644
index 000000000000..b4de99658459
--- /dev/null
+++ b/sim/ppc/pk.h
@@ -0,0 +1,2 @@
+/* Generated file; do not edit.  */
+extern package_create_instance_callback pk_disklabel_create_instance;
-- 
2.38.1


                 reply	other threads:[~2022-11-05  3:43 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=20221105034255.30375-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).