public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/5] libgloss: drop custom multi-build logic
@ 2022-12-14  2:36 Mike Frysinger
  2022-12-14  2:36 ` [PATCH 1/5] libgloss: aarch64: delete unused " Mike Frysinger
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Mike Frysinger @ 2022-12-14  2:36 UTC (permalink / raw)
  To: newlib

A small patch series to unwind the custom multi-build logic that was
the last big blocker for dropping all sub-configure scripts, and for
moving these dirs to automake.  I don't actually do the automake move
here, but this is still a big win imo as the diffstat shows.

Mike Frysinger (5):
  libgloss: aarch64: delete unused multi-build logic
  libgloss: arm: inline multi-build logic
  libgloss: drop unused multi-build logic
  libgloss: merge aarch64 configure script up a level
  libgloss: merge arm configure script up a level

 libgloss/Makefile.in                  |   28 +-
 libgloss/aarch64/Makefile.in          |  100 +-
 libgloss/aarch64/acinclude.m4         |    7 +
 libgloss/aarch64/aclocal.m4           |  546 ---
 libgloss/aarch64/configure            | 4784 ------------------------
 libgloss/aarch64/configure.ac         |   49 -
 libgloss/aarch64/cpu-init/Makefile.in |    7 +-
 libgloss/arm/Makefile.in              |  141 +-
 libgloss/arm/acinclude.m4             |   20 +
 libgloss/arm/aclocal.m4               |  546 ---
 libgloss/arm/configure                | 4813 -------------------------
 libgloss/arm/configure.ac             |   72 -
 libgloss/arm/cpu-init/Makefile.in     |    7 +-
 libgloss/configure                    |  222 +-
 libgloss/configure.ac                 |   18 +-
 libgloss/doc/porting.texi             |    4 +-
 libgloss/multi-build.in               |   66 -
 17 files changed, 203 insertions(+), 11227 deletions(-)
 create mode 100644 libgloss/aarch64/acinclude.m4
 delete mode 100644 libgloss/aarch64/aclocal.m4
 delete mode 100755 libgloss/aarch64/configure
 delete mode 100644 libgloss/aarch64/configure.ac
 create mode 100644 libgloss/arm/acinclude.m4
 delete mode 100644 libgloss/arm/aclocal.m4
 delete mode 100755 libgloss/arm/configure
 delete mode 100644 libgloss/arm/configure.ac
 delete mode 100644 libgloss/multi-build.in

-- 
2.38.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] libgloss: aarch64: delete unused multi-build logic
  2022-12-14  2:36 [PATCH 0/5] libgloss: drop custom multi-build logic Mike Frysinger
@ 2022-12-14  2:36 ` Mike Frysinger
  2022-12-14  2:36 ` [PATCH 2/5] libgloss: arm: inline " Mike Frysinger
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2022-12-14  2:36 UTC (permalink / raw)
  To: newlib

This logic looks like it was copied from the arm port, but it isn't
actually used here.  Since no other port uses this custom libgloss
multi-build.in logic, and it's making things difficult to unify,
and aarch64 isn't even using it, drop it all.  The set of installed
objects and their content should be the same.

Once we move this to unified automake, if we want to readd support
for subdir multi-builds, it'll be a lot easier as we can just add
another set of objects with custom flags.

None of this should be confused with the common multilib logic.
This *multi-build* which is processed in parallel.
---
 libgloss/aarch64/Makefile.in | 59 ++++++++++--------------------------
 1 file changed, 16 insertions(+), 43 deletions(-)

diff --git a/libgloss/aarch64/Makefile.in b/libgloss/aarch64/Makefile.in
index e84aa6927a74..5d7012023dee 100644
--- a/libgloss/aarch64/Makefile.in
+++ b/libgloss/aarch64/Makefile.in
@@ -52,11 +52,8 @@ MULTISRCTOP =
 MULTIBUILDTOP =
 MULTIDIRS =
 MULTISUBDIR =
-MULTILIBNAME =
 MULTIDO = true
 MULTICLEAN = true
-MULTI_FLAGS_FOR_TARGET = MULTI_DEFAULT_FLAGS
-MULTI_DEFAULT_FLAGS = -DSEMIHOST_V2
 
 SHELL =	/bin/sh
 
@@ -82,17 +79,15 @@ OBJS = ftruncate.o libcfunc.o syscalls.o truncate.o _exit.o _kill.o
 CRT0		= crt0.o
 CRT0_INSTALL	= install-crt0
 
-RDIMON_CRT0	= rdimon-crt0${${MULTILIBNAME}}.o
-RDIMON_BSP	= librdimon${${MULTILIBNAME}}.a
+RDIMON_CRT0	= rdimon-crt0.o
+RDIMON_BSP	= librdimon.a
 RDIMON_OBJS	= $(patsubst %,rdimon-%,$(OBJS))
-RDIMON_SCRIPTS	= rdimon${${MULTILIBNAME}}.specs \
-		  aem-ve${${MULTILIBNAME}}.specs \
-		  aem-validation${${MULTILIBNAME}}.specs \
-		  aem-v8-r${${MULTILIBNAME}}.specs
+RDIMON_SCRIPTS	= rdimon.specs \
+		  aem-ve.specs \
+		  aem-validation.specs \
+		  aem-v8-r.specs
 RDIMON_INSTALL	= install-rdimon
 
-CFLAGS		= -g
-
 # Host specific makefile fragment comes in here.
 @host_makefile_frag@
 
@@ -111,7 +106,6 @@ all: ${CRT0} ${RDIMON_CRT0} ${RDIMON_BSP} ${RDIMON_SCRIPTS}
 	    else true; fi; \
 	  else true; fi; \
 	done
-	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 #
 # here's where we build the test programs for each target
@@ -121,53 +115,36 @@ test:
 
 #
 crt0.o: crt0.S
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -o $@ -c $<
 
-rdimon-crt0${${MULTILIBNAME}}.o: crt0.S
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+rdimon-crt0.o: crt0.S
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
 
 #rdimon-trap.o: trap.S
-#	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+#	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-_exit.o: _exit.c
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-ftruncate.o: ftruncate.c
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-_kill.o: _kill.c
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-libcfunc.o: libcfunc.c
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-syscalls.o: syscalls.c
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-truncate.o: truncate.c
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
 
 $(RDIMON_BSP): $(RDIMON_OBJS)
 	${AR} ${ARFLAGS} $@ $^
 	${RANLIB} $@
 
-# Multilib support.
-.PHONY:  libgloss-multi-do all-multi clean-multi install-multi
-
-all-recursive: all-multi
-clean-recursive: clean-multi
-install-recursive: install-multi
-
-# The $(MAKE) comments below are to enable parallel building.
-all-multi:
-	$(MAKE) $(AM_MAKEFLAGS) DO=all libgloss-multi-do
-
-clean-multi:
-	$(MAKE) $(AM_MAKEFLAGS) DO=clean libgloss-multi-do
-
-install-multi:
-	$(MAKE) $(AM_MAKEFLAGS) DO=install libgloss-multi-do
-
 clean mostlyclean:
 	rm -f a.out core *.i *.o *-test *.srec *.dis *.x $(SIM_BSP) ${RDIMON_SCRIPTS}
 	@rootpre=`pwd`/; export rootpre; \
@@ -179,7 +156,6 @@ clean mostlyclean:
 	    else true; fi; \
 	  else true; fi; \
 	done
-	$(MAKE) $(AM_MAKEFLAGS) clean-recursive
 
 distclean maintainer-clean realclean: clean
 	rm -f Makefile config.status *~
@@ -195,7 +171,6 @@ install: ${CRT0_INSTALL} ${RDIMON_INSTALL}
 	    else true; fi; \
 	  else true; fi; \
 	done
-	$(MAKE) $(AM_MAKEFLAGS) install-recursive
 
 install-crt0:
 	${mkinstalldirs} ${DESTDIR}${tooldir}/lib${MULTISUBDIR}
@@ -220,5 +195,3 @@ Makefile: Makefile.in config.status @host_makefile_frag_path@
 
 config.status: configure
 	$(SHELL) config.status --recheck
-
-include $(srcdir)/../multi-build.in
-- 
2.38.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/5] libgloss: arm: inline multi-build logic
  2022-12-14  2:36 [PATCH 0/5] libgloss: drop custom multi-build logic Mike Frysinger
  2022-12-14  2:36 ` [PATCH 1/5] libgloss: aarch64: delete unused " Mike Frysinger
@ 2022-12-14  2:36 ` Mike Frysinger
  2022-12-14  2:36 ` [PATCH 3/5] libgloss: drop unused " Mike Frysinger
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2022-12-14  2:36 UTC (permalink / raw)
  To: newlib

Since no other port uses this custom libgloss multi-build.in logic,
and it's making things difficult to unify, drop it all.  The set of
installed objects and their content should be the same.

There is a difference in the builds: currently we compile all the
objects in this subdir twice, but only a subset of them use a diff
set of flags, and are actually installed (the librdimon.a and its
objects).  So this change speeds things up by removing the duplicate
compilation.

There is a short term cost in having to duplicate the compile rules
for the files that are different, but this is minor when compared to
being able to delete the unused multi-build logic (which we'll do in
a sep commit), and we'll be able to clean this up when we move the
code to unified automake.

None of this should be confused with the common multilib logic.
This *multi-build* which is processed in parallel.
---
 libgloss/arm/Makefile.in | 92 ++++++++++++++++++++--------------------
 1 file changed, 47 insertions(+), 45 deletions(-)

diff --git a/libgloss/arm/Makefile.in b/libgloss/arm/Makefile.in
index 45d889409aa0..5dab75f750b2 100644
--- a/libgloss/arm/Makefile.in
+++ b/libgloss/arm/Makefile.in
@@ -29,15 +29,8 @@ MULTISRCTOP =
 MULTIBUILDTOP =
 MULTIDIRS =
 MULTISUBDIR =
-MULTILIBNAME =
 MULTIDO = true
 MULTICLEAN = true
-MULTI_FLAGS_FOR_TARGET = MULTI_DEFAULT_FLAGS
-MULTI_DEFAULT_FLAGS = -DSEMIHOST_V2
-
-MULTIDIRS += semihv2m
-MULTIDIR_semihv2m_FLAGS = $(MULTI_DEFAULT_FLAGS) -DSEMIHOST_V2_MIXED_MODE
-MULTIDIR_semihv2m_NAME = -v2m
 
 SHELL =	/bin/sh
 
@@ -84,15 +77,15 @@ RDPMON_OBJS	= ftruncate.o libcfunc.o syscalls.o trap.o truncate.o _exit.o _kill.
 RDPMON_SCRIPTS	= rdpmon.specs
 RDPMON_INSTALL	= install-rdpmon
 
-RDIMON_CRT0	= rdimon-crt0${${MULTILIBNAME}}.o
-RDIMON_BSP	= librdimon${${MULTILIBNAME}}.a
+RDIMON_CRT0	= rdimon-crt0.o rdimon-crt0-v2m.o
+RDIMON_BSP	= librdimon.a librdimon-v2m.a
 RDIMON_OBJS	= $(patsubst %,rdimon-%,$(RDPMON_OBJS))
-RDIMON_SCRIPTS	= rdimon${${MULTILIBNAME}}.specs \
-		  aprofile-validation${${MULTILIBNAME}}.specs \
-		  aprofile-ve${${MULTILIBNAME}}.specs
+_RDIMON_SCRIPTS	= rdimon.specs \
+		  aprofile-validation.specs \
+		  aprofile-ve.specs
+RDIMON_SCRIPTS	= $(_RDIMON_SCRIPTS) $(patsubst %.specs,%-v2m.specs,$(_RDIMON_SCRIPTS))
 RDIMON_INSTALL	= install-rdimon
-
-CFLAGS		= -g
+RDIMON_SEMIHV2M_OBJS = $(patsubst %.o,rdimon-%-v2m.o,$(RDPMON_OBJS))
 
 # Here is all of the eval board stuff
 PID_SCRIPTS	= pid.specs
@@ -121,7 +114,6 @@ all: ${CRT0} ${LINUX_CRT0} ${LINUX_BSP} ${REDBOOT_CRT0} ${REDBOOT_OBJS} ${RDPMON
 	    else true; fi; \
 	  else true; fi; \
 	done
-	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 #
 # here's where we build the test programs for each target
@@ -133,34 +125,58 @@ test:
 crt0.o: crt0.S
 redboot-crt0.o: redboot-crt0.S
 redboot-syscalls.o: redboot-syscalls.c $(srcdir)/../syscall.h
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -o $@ -c $<
 
 rdpmon-crt0.o: crt0.S
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDP_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDP_MONITOR -o $@ -c $<
 
-rdimon-crt0${${MULTILIBNAME}}.o: crt0.S
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+rdimon-crt0.o: crt0.S
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-ftruncate.o: ftruncate.c
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-trap.o: trap.S
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-truncate.o: truncate.c
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-_exit.o: _exit.c
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-_kill.o: _kill.c
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-syscalls.o: syscalls.c
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-libcfunc.o: libcfunc.c
-	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-crt0-v2m.o: crt0.S
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-ftruncate-v2m.o: ftruncate.c
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-trap-v2m.o: trap.S
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-truncate-v2m.o: truncate.c
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-_exit-v2m.o: _exit.c
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-_kill-v2m.o: _kill.c
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-syscalls-v2m.o: syscalls.c
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-libcfunc-v2m.o: libcfunc.c
+	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
 
 $(LINUX_BSP): $(LINUX_OBJS)
 	${AR} ${ARFLAGS} $@ $^
@@ -170,27 +186,17 @@ $(RDPMON_BSP): $(RDPMON_OBJS)
 	${AR} ${ARFLAGS} $@ $^
 	${RANLIB} $@
 
-$(RDIMON_BSP): $(RDIMON_OBJS)
+librdimon.a: $(RDIMON_OBJS)
+	${AR} ${ARFLAGS} $@ $^
+	${RANLIB} $@
+
+librdimon-v2m.a: $(RDIMON_SEMIHV2M_OBJS)
 	${AR} ${ARFLAGS} $@ $^
 	${RANLIB} $@
 
 # Multilib support.
 .PHONY:  libgloss-multi-do all-multi clean-multi install-multi
 
-all-recursive: all-multi
-clean-recursive: clean-multi
-install-recursive: install-multi
-
-# The $(MAKE) comments below are to enable parallel building.
-all-multi:
-	$(MAKE) $(AM_MAKEFLAGS) DO=all libgloss-multi-do
-
-clean-multi:
-	$(MAKE) $(AM_MAKEFLAGS) DO=clean libgloss-multi-do
-
-install-multi:
-	$(MAKE) $(AM_MAKEFLAGS) DO=install libgloss-multi-do
-
 clean mostlyclean:
 	rm -f a.out core *.i *.o *-test *.srec *.dis *.x $(SIM_BSP) $(IQ80310_BSP)
 	@rootpre=`pwd`/; export rootpre; \
@@ -202,7 +208,6 @@ clean mostlyclean:
 	    else true; fi; \
 	  else true; fi; \
 	done
-	$(MAKE) $(AM_MAKEFLAGS) clean-recursive
 
 distclean maintainer-clean realclean: clean
 	rm -f Makefile config.status *~
@@ -218,7 +223,6 @@ install: ${CRT0_INSTALL} ${LINUX_INSTALL} ${REDBOOT_INSTALL} ${RDPMON_INSTALL} $
 	    else true; fi; \
 	  else true; fi; \
 	done
-	$(MAKE) $(AM_MAKEFLAGS) install-recursive
 
 install-nano:
 	${mkinstalldirs} ${DESTDIR}${tooldir}/lib${MULTISUBDIR}
@@ -268,5 +272,3 @@ Makefile: Makefile.in config.status @host_makefile_frag_path@
 
 config.status: configure
 	$(SHELL) config.status --recheck
-
-include $(srcdir)/../multi-build.in
-- 
2.38.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 3/5] libgloss: drop unused multi-build logic
  2022-12-14  2:36 [PATCH 0/5] libgloss: drop custom multi-build logic Mike Frysinger
  2022-12-14  2:36 ` [PATCH 1/5] libgloss: aarch64: delete unused " Mike Frysinger
  2022-12-14  2:36 ` [PATCH 2/5] libgloss: arm: inline " Mike Frysinger
@ 2022-12-14  2:36 ` Mike Frysinger
  2022-12-14  2:36 ` [PATCH 4/5] libgloss: merge aarch64 configure script up a level Mike Frysinger
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2022-12-14  2:36 UTC (permalink / raw)
  To: newlib

Now that aarch64 & arm have migrated off this, we can punt it.
---
 libgloss/doc/porting.texi |  4 +--
 libgloss/multi-build.in   | 66 ---------------------------------------
 2 files changed, 1 insertion(+), 69 deletions(-)
 delete mode 100644 libgloss/multi-build.in

diff --git a/libgloss/doc/porting.texi b/libgloss/doc/porting.texi
index 496fae352148..15f214d026a4 100644
--- a/libgloss/doc/porting.texi
+++ b/libgloss/doc/porting.texi
@@ -398,9 +398,7 @@ any target that has migrated to @value{automake}.
 
 Libgloss automatically builds itself for all multilib configurations that the
 active toolchain supports.  This logic is provided by common code from the
-combined toolchain source tree.  This should @strong{not} be confused with the
-Libgloss-specific @file{multi-build.in} file.  That is used by a few ports to
-further produce multiple targets.
+combined toolchain source tree.
 
 @node GCC, Libraries, Libgloss, Top
 @chapter Porting GCC
diff --git a/libgloss/multi-build.in b/libgloss/multi-build.in
deleted file mode 100644
index 80919ed6f8a7..000000000000
--- a/libgloss/multi-build.in
+++ /dev/null
@@ -1,66 +0,0 @@
-# This is like ../multilib.am and ../config-ml.in and ../config/multi.m4 mashed
-# into one file.  It relies on some custom hardcoded MULTI* variables in the
-# respective Makefile.in instead of dynamic compiler probing that ../multilib.am
-# does.
-
-PWD_COMMAND=$${PWDCMD-pwd}
-
-# FIXME: There should be an @-sign in front of the `if'.
-# Leave out until this is tested a bit more.
-libgloss-multi-do:
-	if [ -z "$(MULTIDIRS)" ]; then \
-	  true; \
-	else \
-	  rootpre=`${PWD_COMMAND}`/; export rootpre; \
-	  srcrootpre=`cd $(srcdir); ${PWD_COMMAND}`/; export srcrootpre; \
-	  lib=`echo "$${rootpre}" | sed -e 's,^.*/\([^/][^/]*\)/$$,\1,'`; export lib; \
-	  compiler="$(CC)"; \
-	  for dir in $(MULTIDIRS); do \
-	    if [ "$${dir}" = "." ]; then \
-	      true; \
-	    else \
-	      destpre=`echo $${rootpre}/$${dir}`/; export destpre; \
-	      if ! test -d $${destpre} ; then \
-		mkdir -p $${destpre}; \
-		cd $${destpre}; \
-		config_cmd=`../config.status --config | sed -re "s:--srcdir=([^/]):--srcdir=../\1:"`; \
-		$(SHELL) -c "$(SHELL) $${srcrootpre}/configure $${config_cmd}";\
-		sed -e "s:^MULTIDIRS[[:space:]]*+=.*$$:MULTIDIRS = :" \
-		    -e "s:^MULTILIBNAME[[:space:]]*=.*$$:MULTILIBNAME = MULTIDIR_$${dir}_NAME:" \
-		    -e "s:^MULTI_FLAGS_FOR_TARGET[[:space:]]*=.*$$:MULTI_FLAGS_FOR_TARGET = MULTIDIR_$${dir}_FLAGS:" \
-		    -e "s:^objdir[[:space:]]*=.*$$:objdir = ..:" \
-			Makefile > Makefile.tem; \
-		rm -f Makefile; \
-		mv Makefile.tem Makefile; \
-	      else \
-		cd $${destpre}; \
-	      fi; \
-	      if ($(MAKE) $(FLAGS_TO_PASS) \
-		    CFLAGS="$(CFLAGS)" \
-		    CCASFLAGS="$(CCASFLAGS)" \
-		    FCFLAGS="$(FCFLAGS)" \
-		    FFLAGS="$(FFLAGS)" \
-		    ADAFLAGS="$(ADAFLAGS)" \
-		    prefix="$(prefix)" \
-		    exec_prefix="$(exec_prefix)" \
-		    GCJFLAGS="$(GCJFLAGS)" \
-		    GOCFLAGS="$(GOCFLAGS)" \
-		    CXXFLAGS="$(CXXFLAGS)" \
-		    LIBCFLAGS="$(LIBCFLAGS)" \
-		    LIBCXXFLAGS="$(LIBCXXFLAGS)" \
-		    LDFLAGS="$(LDFLAGS)" \
-		    MULTIFLAGS="" \
-		    DESTDIR="$(DESTDIR)" \
-		    SOURCE="${srcdir}/" \
-		    INSTALL="$(INSTALL)" \
-		    INSTALL_DATA="$(INSTALL_DATA)" \
-		    INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \
-		    INSTALL_SCRIPT="$(INSTALL_SCRIPT)" \
-		    $(DO)); then \
-		cd $${rootpre}; \
-	      else \
-		exit 1; \
-	      fi; \
-	    fi; \
-	  done; \
-	fi
-- 
2.38.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 4/5] libgloss: merge aarch64 configure script up a level
  2022-12-14  2:36 [PATCH 0/5] libgloss: drop custom multi-build logic Mike Frysinger
                   ` (2 preceding siblings ...)
  2022-12-14  2:36 ` [PATCH 3/5] libgloss: drop unused " Mike Frysinger
@ 2022-12-14  2:36 ` Mike Frysinger
  2022-12-14  2:37 ` [PATCH 5/5] libgloss: merge arm " Mike Frysinger
  2022-12-19  9:17 ` [PATCH 0/5] libgloss: drop custom multi-build logic Corinna Vinschen
  5 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2022-12-14  2:36 UTC (permalink / raw)
  To: newlib

Move the minor aarch64-specific logic to a dedicated variable so we can
merge its configure logic up a level.
---
 libgloss/Makefile.in                  |   15 +-
 libgloss/aarch64/Makefile.in          |   41 +-
 libgloss/aarch64/acinclude.m4         |    7 +
 libgloss/aarch64/aclocal.m4           |  546 ---
 libgloss/aarch64/configure            | 4784 -------------------------
 libgloss/aarch64/configure.ac         |   49 -
 libgloss/aarch64/cpu-init/Makefile.in |    7 +-
 libgloss/configure                    |   23 +-
 libgloss/configure.ac                 |    4 +-
 9 files changed, 45 insertions(+), 5431 deletions(-)
 create mode 100644 libgloss/aarch64/acinclude.m4
 delete mode 100644 libgloss/aarch64/aclocal.m4
 delete mode 100755 libgloss/aarch64/configure
 delete mode 100644 libgloss/aarch64/configure.ac

diff --git a/libgloss/aarch64/Makefile.in b/libgloss/aarch64/Makefile.in
index 5d7012023dee..980c75858da3 100644
--- a/libgloss/aarch64/Makefile.in
+++ b/libgloss/aarch64/Makefile.in
@@ -26,6 +26,7 @@
 DESTDIR =
 VPATH = @srcdir@ @srcdir@/..
 srcdir = @srcdir@
+abs_srcdir = @abs_srcdir@
 objdir = .
 srcroot = $(srcdir)/../..
 objroot = $(objdir)/../..
@@ -40,7 +41,7 @@ bindir = @bindir@
 libdir = @libdir@
 tooldir = $(exec_prefix)/$(target_alias)
 
-objtype = @objtype@
+objtype = @AARCH64_OBJTYPE@
 
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -66,8 +67,6 @@ AR = @AR@
 LD = @LD@
 RANLIB = @RANLIB@
 
-SUBDIRS = @subdirs@
-
 OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
 	then echo ${objroot}/../binutils/objdump ; \
 	else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
@@ -97,15 +96,6 @@ RDIMON_INSTALL	= install-rdimon
 #
 
 all: ${CRT0} ${RDIMON_CRT0} ${RDIMON_BSP} ${RDIMON_SCRIPTS}
-	@rootpre=`pwd`/; export rootpre; \
-	srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
-	for dir in .. ${SUBDIRS}; do \
-	  if [ x$$dir != x.. ]; then \
-	    if [ -d $$dir ]; then \
-	      (cd $$dir; $(MAKE) $(FLAGS_TO_PASS)); \
-	    else true; fi; \
-	  else true; fi; \
-	done
 
 #
 # here's where we build the test programs for each target
@@ -147,30 +137,12 @@ $(RDIMON_BSP): $(RDIMON_OBJS)
 
 clean mostlyclean:
 	rm -f a.out core *.i *.o *-test *.srec *.dis *.x $(SIM_BSP) ${RDIMON_SCRIPTS}
-	@rootpre=`pwd`/; export rootpre; \
-	srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
-	for dir in .. ${SUBDIRS}; do \
-	  if [ x$$dir != x.. ]; then \
-	    if [ -d $$dir ]; then \
-	      (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) clean); \
-	    else true; fi; \
-	  else true; fi; \
-	done
 
 distclean maintainer-clean realclean: clean
-	rm -f Makefile config.status *~
+	rm -f Makefile *~
 
 .PHONY: install info install-info clean-info
 install: ${CRT0_INSTALL} ${RDIMON_INSTALL}
-	@rootpre=`pwd`/; export rootpre; \
-	srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
-	for dir in .. ${SUBDIRS}; do \
-	  if [ x$$dir != x.. ]; then \
-	    if [ -d $$dir ]; then \
-	      (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) install); \
-	    else true; fi; \
-	  else true; fi; \
-	done
 
 install-crt0:
 	${mkinstalldirs} ${DESTDIR}${tooldir}/lib${MULTISUBDIR}
@@ -190,8 +162,5 @@ info:
 install-info:
 clean-info:
 
-Makefile: Makefile.in config.status @host_makefile_frag_path@
-	$(SHELL) config.status
-
-config.status: configure
-	$(SHELL) config.status --recheck
+Makefile: Makefile.in ../config.status
+	cd .. && $(SHELL) config.status
diff --git a/libgloss/aarch64/acinclude.m4 b/libgloss/aarch64/acinclude.m4
new file mode 100644
index 000000000000..df08e871a1e5
--- /dev/null
+++ b/libgloss/aarch64/acinclude.m4
@@ -0,0 +1,7 @@
+AARCH64_OBJTYPE=
+case "${target}" in
+  *-*-elf)
+	AARCH64_OBJTYPE=elf-
+	;;
+esac
+AC_SUBST(AARCH64_OBJTYPE)
diff --git a/libgloss/aarch64/configure.ac b/libgloss/aarch64/configure.ac
deleted file mode 100644
index d691f11a714c..000000000000
--- a/libgloss/aarch64/configure.ac
+++ /dev/null
@@ -1,49 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(crt0.S)
-
-AC_CONFIG_AUX_DIR(../..)
-
-AC_CANONICAL_SYSTEM
-AC_ARG_PROGRAM
-
-AC_PROG_INSTALL
-
-AC_NO_EXECUTABLES
-AC_PROG_CC
-AM_PROG_AS
-AM_PROG_AR
-LD=${LD-ld}
-AC_SUBST(LD)
-AC_PROG_RANLIB
-
-case "${target}" in
-  *-*-elf)
-	objtype=elf-
-	;;
-esac
-
-AC_SUBST(objtype)
-
-host_makefile_frag=`cd $srcdir/../config;pwd`/default.mh
-
-dnl We have to assign the same value to other variables because autoconf
-dnl doesn't provide a mechanism to substitute a replacement keyword with
-dnl arbitrary data or pathnames.
-dnl
-host_makefile_frag_path=$host_makefile_frag
-AC_SUBST(host_makefile_frag_path)
-AC_SUBST_FILE(host_makefile_frag)
-
-# Configure cpu init plug-ins
-if test -d "${srcdir}/cpu-init"; then
-  subdirs="${subdirs} cpu-init"
-  AC_CONFIG_FILES([cpu-init/Makefile], [dnl
-    ac_file=cpu-init/Makefile . ${srcdir}/../../config-ml.in
-  ])
-  AC_SUBST(subdirs)
-fi
-
-AM_ENABLE_MULTILIB(, ../..)
-
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
diff --git a/libgloss/aarch64/cpu-init/Makefile.in b/libgloss/aarch64/cpu-init/Makefile.in
index 22648b2af991..4aef917ebe5a 100644
--- a/libgloss/aarch64/cpu-init/Makefile.in
+++ b/libgloss/aarch64/cpu-init/Makefile.in
@@ -103,8 +103,5 @@ info:
 install-info:
 clean-info:
 
-Makefile: Makefile.in ../config.status @host_makefile_frag_path@
-	$(SHELL) ../config.status --file cpu-init/Makefile
-
-../config.status: ../configure
-	$(SHELL) ../config.status --recheck
+Makefile: Makefile.in ../../config.status
+	cd ../.. && $(SHELL) ./config.status --file aarch64/cpu-init/Makefile
diff --git a/libgloss/configure.ac b/libgloss/configure.ac
index b683ef65d193..931e3f6de42d 100644
--- a/libgloss/configure.ac
+++ b/libgloss/configure.ac
@@ -36,7 +36,8 @@ target_makefile_frag=${srcdir}/config/default.mt
 
 case "${target}" in
   aarch64*-*-*)
-	AC_CONFIG_SUBDIRS(aarch64)
+	AC_CONFIG_FILES([aarch64/Makefile aarch64/cpu-init/Makefile])
+	subdirs="$subdirs aarch64 aarch64/cpu-init"
 	config_testsuite=true
 	;;
   arc*-*-*)
@@ -330,6 +331,7 @@ dnl
   rm -f conftest* ])
 AC_DEFINE_UNQUOTED(__SYMBOL_PREFIX, "$libc_cv_symbol_prefix", [symbol prefix])
 
+m4_include([aarch64/acinclude.m4])
 m4_include([i386/acinclude.m4])
 m4_include([libnosys/acinclude.m4])
 m4_include([m68k/acinclude.m4])
-- 
2.38.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 5/5] libgloss: merge arm configure script up a level
  2022-12-14  2:36 [PATCH 0/5] libgloss: drop custom multi-build logic Mike Frysinger
                   ` (3 preceding siblings ...)
  2022-12-14  2:36 ` [PATCH 4/5] libgloss: merge aarch64 configure script up a level Mike Frysinger
@ 2022-12-14  2:37 ` Mike Frysinger
  2022-12-19  9:17 ` [PATCH 0/5] libgloss: drop custom multi-build logic Corinna Vinschen
  5 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2022-12-14  2:37 UTC (permalink / raw)
  To: newlib

Move the minor arm-specific logic to a dedicated variable so we can
merge its configure logic up a level.
---
 libgloss/Makefile.in              |   13 +-
 libgloss/arm/Makefile.in          |   49 +-
 libgloss/arm/acinclude.m4         |   20 +
 libgloss/arm/aclocal.m4           |  546 ----
 libgloss/arm/configure            | 4813 -----------------------------
 libgloss/arm/configure.ac         |   72 -
 libgloss/arm/cpu-init/Makefile.in |    7 +-
 libgloss/configure                |  207 +-
 libgloss/configure.ac             |   14 +-
 9 files changed, 98 insertions(+), 5643 deletions(-)
 create mode 100644 libgloss/arm/acinclude.m4
 delete mode 100644 libgloss/arm/aclocal.m4
 delete mode 100755 libgloss/arm/configure
 delete mode 100644 libgloss/arm/configure.ac

diff --git a/libgloss/arm/Makefile.in b/libgloss/arm/Makefile.in
index 5dab75f750b2..06fae10c1fca 100644
--- a/libgloss/arm/Makefile.in
+++ b/libgloss/arm/Makefile.in
@@ -3,6 +3,7 @@
 DESTDIR =
 VPATH = @srcdir@ @srcdir@/..
 srcdir = @srcdir@
+abs_srcdir = @abs_srcdir@
 objdir = .
 srcroot = $(srcdir)/../..
 objroot = $(objdir)/../..
@@ -17,7 +18,7 @@ bindir = @bindir@
 libdir = @libdir@
 tooldir = $(exec_prefix)/$(target_alias)
 
-objtype = @objtype@
+objtype = @ARM_OBJTYPE@
 
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -43,8 +44,6 @@ AR = @AR@
 LD = @LD@
 RANLIB = @RANLIB@
 
-SUBDIRS = @subdirs@
-
 OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
 	then echo ${objroot}/../binutils/objdump ; \
 	else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
@@ -52,10 +51,10 @@ OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
 	then echo ${objroot}/../binutils/objcopy ; \
 	else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
 
-@BUILD_CRT0_TRUE@CRT0		= crt0.o
-@BUILD_CRT0_TRUE@CRT0_INSTALL	= install-crt0
-@BUILD_CRT0_FALSE@CRT0		=
-@BUILD_CRT0_FALSE@CRT0_INSTALL	=
+@ARM_BUILD_CRT0_TRUE@CRT0		= crt0.o
+@ARM_BUILD_CRT0_TRUE@CRT0_INSTALL	= install-crt0
+@ARM_BUILD_CRT0_FALSE@CRT0		=
+@ARM_BUILD_CRT0_FALSE@CRT0_INSTALL	=
 
 NANO_SCRIPTS=nano.specs
 NANO_INSTALL=install-nano
@@ -105,15 +104,6 @@ INCLUDES += `if [ -d ${objroot}/newlib ]; then echo -I$(srcroot)/newlib/libc/mac
 # it to link is a good test, so we ignore all the errors for now.
 #
 all: ${CRT0} ${LINUX_CRT0} ${LINUX_BSP} ${REDBOOT_CRT0} ${REDBOOT_OBJS} ${RDPMON_CRT0} ${RDPMON_BSP} ${RDIMON_CRT0} ${RDIMON_BSP}
-	@rootpre=`pwd`/; export rootpre; \
-	srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
-	for dir in .. ${SUBDIRS}; do \
-	  if [ x$$dir != x.. ]; then \
-	    if [ -d $$dir ]; then \
-	      (cd $$dir; $(MAKE) $(FLAGS_TO_PASS)); \
-	    else true; fi; \
-	  else true; fi; \
-	done
 
 #
 # here's where we build the test programs for each target
@@ -199,30 +189,12 @@ librdimon-v2m.a: $(RDIMON_SEMIHV2M_OBJS)
 
 clean mostlyclean:
 	rm -f a.out core *.i *.o *-test *.srec *.dis *.x $(SIM_BSP) $(IQ80310_BSP)
-	@rootpre=`pwd`/; export rootpre; \
-	srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
-	for dir in .. ${SUBDIRS}; do \
-	  if [ x$$dir != x.. ]; then \
-	    if [ -d $$dir ]; then \
-	      (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) clean); \
-	    else true; fi; \
-	  else true; fi; \
-	done
 
 distclean maintainer-clean realclean: clean
-	rm -f Makefile config.status *~
+	rm -f Makefile *~
 
 .PHONY: install info install-info clean-info
 install: ${CRT0_INSTALL} ${LINUX_INSTALL} ${REDBOOT_INSTALL} ${RDPMON_INSTALL} ${RDIMON_INSTALL} ${IQ80310_INSTALL}  ${PID_INSTALL} ${NANO_INSTALL}
-	@rootpre=`pwd`/; export rootpre; \
-	srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
-	for dir in .. ${SUBDIRS}; do \
-	  if [ x$$dir != x.. ]; then \
-	    if [ -d $$dir ]; then \
-	      (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) install); \
-	    else true; fi; \
-	  else true; fi; \
-	done
 
 install-nano:
 	${mkinstalldirs} ${DESTDIR}${tooldir}/lib${MULTISUBDIR}
@@ -267,8 +239,5 @@ info:
 install-info:
 clean-info:
 
-Makefile: Makefile.in config.status @host_makefile_frag_path@
-	$(SHELL) config.status
-
-config.status: configure
-	$(SHELL) config.status --recheck
+Makefile: Makefile.in ../config.status
+	cd .. && $(SHELL) ./config.status
diff --git a/libgloss/arm/acinclude.m4 b/libgloss/arm/acinclude.m4
new file mode 100644
index 000000000000..b34a40f9c61d
--- /dev/null
+++ b/libgloss/arm/acinclude.m4
@@ -0,0 +1,20 @@
+if test "x$newlib_may_supply_syscalls" = "xyes"; then
+  ARM_BUILD_CRT0_TRUE='#'
+  ARM_BUILD_CRT0_FALSE=
+else
+  ARM_BUILD_CRT0_TRUE=
+  ARM_BUILD_CRT0_FALSE='#'
+fi
+AC_SUBST(ARM_BUILD_CRT0_TRUE)
+AC_SUBST(ARM_BUILD_CRT0_FALSE)
+
+ARM_OBJTYPE=
+case "${target}" in
+  *-*-elf | *-*-eabi* | *-*-tirtos*)
+	ARM_OBJTYPE=elf-
+	;;
+  *-*-coff)
+	ARM_OBJTYPE=coff-
+	;;
+esac
+AC_SUBST(ARM_OBJTYPE)
diff --git a/libgloss/arm/configure.ac b/libgloss/arm/configure.ac
deleted file mode 100644
index 44f5f73962e4..000000000000
--- a/libgloss/arm/configure.ac
+++ /dev/null
@@ -1,72 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(redboot-crt0.S)
-
-dnl Support --disable-newlib-supplied-syscalls
-AC_ARG_ENABLE(newlib-supplied-syscalls,
-[  --disable-newlib-supplied-syscalls disable newlib from supplying syscalls],
-[case "${enableval}" in
-  yes) newlib_may_supply_syscalls=yes ;;
-  no)  newlib_may_supply_syscalls=no ;;
-  *)   AC_MSG_ERROR(bad value ${enableval} for newlib-supplied-syscalls option) ;;
- esac], [newlib_may_supply_syscalls=yes])dnl
-
-if test "x$newlib_may_supply_syscalls" = "xyes"; then
-  BUILD_CRT0_TRUE='#'
-  BUILD_CRT0_FALSE=
-else
-  BUILD_CRT0_TRUE=
-  BUILD_CRT0_FALSE='#'
-fi
-
-AC_SUBST(BUILD_CRT0_TRUE)
-AC_SUBST(BUILD_CRT0_FALSE)
-
-AC_CONFIG_AUX_DIR(../..)
-
-AC_CANONICAL_SYSTEM
-AC_ARG_PROGRAM
-
-AC_PROG_INSTALL
-
-AC_NO_EXECUTABLES
-AC_PROG_CC
-AM_PROG_AS
-AM_PROG_AR
-LD=${LD-ld}
-AC_SUBST(LD)
-AC_PROG_RANLIB
-
-case "${target}" in
-  *-*-elf | *-*-eabi* | *-*-tirtos*)
-	objtype=elf-
-	;;
-  *-*-coff)
-	objtype=coff-
-	;;
-esac
-
-AC_SUBST(objtype)
-
-host_makefile_frag=`cd $srcdir/../config;pwd`/default.mh
-
-dnl We have to assign the same value to other variables because autoconf
-dnl doesn't provide a mechanism to substitute a replacement keyword with
-dnl arbitrary data or pathnames.
-dnl
-host_makefile_frag_path=$host_makefile_frag
-AC_SUBST(host_makefile_frag_path)
-AC_SUBST_FILE(host_makefile_frag)
-
-# Configure cpu init plug-ins
-if test -d "${srcdir}/cpu-init"; then
-  subdirs="${subdirs} cpu-init"
-  AC_CONFIG_FILES([cpu-init/Makefile], [dnl
-    ac_file=cpu-init/Makefile . ${srcdir}/../../config-ml.in
-  ])
-  AC_SUBST(subdirs)
-fi
-
-AM_ENABLE_MULTILIB(, ../..)
-
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
diff --git a/libgloss/arm/cpu-init/Makefile.in b/libgloss/arm/cpu-init/Makefile.in
index 547c58daf89f..49ad53818d08 100644
--- a/libgloss/arm/cpu-init/Makefile.in
+++ b/libgloss/arm/cpu-init/Makefile.in
@@ -80,8 +80,5 @@ info:
 install-info:
 clean-info:
 
-Makefile: Makefile.in ../config.status @host_makefile_frag_path@
-	$(SHELL) ../config.status --file cpu-init/Makefile
-
-../config.status: ../configure
-	$(SHELL) ../config.status --recheck
+Makefile: Makefile.in ../../config.status
+	cd ../.. && $(SHELL) ./config.status --file arm/cpu-init/Makefile
diff --git a/libgloss/configure.ac b/libgloss/configure.ac
index 931e3f6de42d..3e3b8afe95e0 100644
--- a/libgloss/configure.ac
+++ b/libgloss/configure.ac
@@ -8,6 +8,15 @@ fi
 
 AC_CONFIG_AUX_DIR(..)
 
+dnl Support --disable-newlib-supplied-syscalls
+AC_ARG_ENABLE(newlib-supplied-syscalls,
+[  --disable-newlib-supplied-syscalls disable newlib from supplying syscalls],
+[case "${enableval}" in
+  yes) newlib_may_supply_syscalls=yes ;;
+  no)  newlib_may_supply_syscalls=no ;;
+  *)   AC_MSG_ERROR(bad value ${enableval} for newlib-supplied-syscalls option) ;;
+ esac], [newlib_may_supply_syscalls=yes])dnl
+
 AC_PROG_INSTALL
 
 AC_CANONICAL_SYSTEM
@@ -205,7 +214,8 @@ case "${target}" in
 	subdirs="$subdirs rx"
 	;;
   arm*-*-elf | arm*-*-coff | arm*-*-*)
-	AC_CONFIG_SUBDIRS([arm])
+	AC_CONFIG_FILES([arm/Makefile arm/cpu-init/Makefile])
+	subdirs="$subdirs arm arm/cpu-init"
 	;;
   spu-*-elf)
 	AC_CONFIG_FILES([spu/Makefile])
@@ -235,6 +245,7 @@ case "${target}" in
 	subdirs="$subdirs nios2"
 	;;
 esac
+AC_SUBST(subdirs)
 
 dnl These subdirs have converted to non-recursive make.  Hopefully someday all
 dnl the ports above will too!
@@ -332,6 +343,7 @@ dnl
 AC_DEFINE_UNQUOTED(__SYMBOL_PREFIX, "$libc_cv_symbol_prefix", [symbol prefix])
 
 m4_include([aarch64/acinclude.m4])
+m4_include([arm/acinclude.m4])
 m4_include([i386/acinclude.m4])
 m4_include([libnosys/acinclude.m4])
 m4_include([m68k/acinclude.m4])
-- 
2.38.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/5] libgloss: drop custom multi-build logic
  2022-12-14  2:36 [PATCH 0/5] libgloss: drop custom multi-build logic Mike Frysinger
                   ` (4 preceding siblings ...)
  2022-12-14  2:37 ` [PATCH 5/5] libgloss: merge arm " Mike Frysinger
@ 2022-12-19  9:17 ` Corinna Vinschen
  5 siblings, 0 replies; 7+ messages in thread
From: Corinna Vinschen @ 2022-12-19  9:17 UTC (permalink / raw)
  To: newlib

On Dec 13 21:36, Mike Frysinger wrote:
> A small patch series to unwind the custom multi-build logic that was
> the last big blocker for dropping all sub-configure scripts, and for
> moving these dirs to automake.  I don't actually do the automake move
> here, but this is still a big win imo as the diffstat shows.

LGTM.


Thanks,
Corinna


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-19  9:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-14  2:36 [PATCH 0/5] libgloss: drop custom multi-build logic Mike Frysinger
2022-12-14  2:36 ` [PATCH 1/5] libgloss: aarch64: delete unused " Mike Frysinger
2022-12-14  2:36 ` [PATCH 2/5] libgloss: arm: inline " Mike Frysinger
2022-12-14  2:36 ` [PATCH 3/5] libgloss: drop unused " Mike Frysinger
2022-12-14  2:36 ` [PATCH 4/5] libgloss: merge aarch64 configure script up a level Mike Frysinger
2022-12-14  2:37 ` [PATCH 5/5] libgloss: merge arm " Mike Frysinger
2022-12-19  9:17 ` [PATCH 0/5] libgloss: drop custom multi-build logic Corinna Vinschen

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).