[PATCH 4/8] libgloss: merge mcore configure script up a level

Mike Frysinger vapier@gentoo.org
Fri Feb 11 12:50:50 GMT 2022


Move the minor mcore-specific logic to a dedicated file & namespace them
so we can merge its configure logic up a level.
---
 libgloss/Makefile.in        |   14 +-
 libgloss/configure          |   17 +-
 libgloss/configure.ac       |    4 +-
 libgloss/mcore/Makefile.in  |   11 +-
 libgloss/mcore/acinclude.m4 |   10 +
 libgloss/mcore/aclocal.m4   |  384 ----
 libgloss/mcore/configure    | 3938 -----------------------------------
 libgloss/mcore/configure.ac |   45 -
 8 files changed, 41 insertions(+), 4382 deletions(-)
 create mode 100644 libgloss/mcore/acinclude.m4
 delete mode 100644 libgloss/mcore/aclocal.m4
 delete mode 100755 libgloss/mcore/configure
 delete mode 100644 libgloss/mcore/configure.ac

diff --git a/libgloss/configure.ac b/libgloss/configure.ac
index 6eb39118b509..0218d6763572 100644
--- a/libgloss/configure.ac
+++ b/libgloss/configure.ac
@@ -142,7 +142,8 @@ case "${target}" in
 	subdirs="$subdirs lm32"
 	;;
   mcore-*-*)
-	AC_CONFIG_SUBDIRS([mcore])
+	AC_CONFIG_FILES([mcore/Makefile])
+	subdirs="$subdirs mcore"
 	;;
   mep-*-*)
 	AC_CONFIG_FILES([mep/Makefile])
@@ -325,6 +326,7 @@ AC_DEFINE_UNQUOTED(__SYMBOL_PREFIX, "$libc_cv_symbol_prefix", [symbol prefix])
 
 m4_include([i386/acinclude.m4])
 m4_include([libnosys/acinclude.m4])
+m4_include([mcore/acinclude.m4])
 m4_include([moxie/acinclude.m4])
 
 dnl We have to assign the same value to other variables because autoconf
diff --git a/libgloss/mcore/Makefile.in b/libgloss/mcore/Makefile.in
index 7d37027925d2..883e5ed59fd8 100644
--- a/libgloss/mcore/Makefile.in
+++ b/libgloss/mcore/Makefile.in
@@ -59,7 +59,7 @@ SIM_TEST	= sim-test
 SIM_INSTALL	= install-sim
 
 # Here is all of the picobug on cmb stuff
-MON_PREFIX	= @bsp_prefix@
+MON_PREFIX	= @MCORE_BSP_PREFIX@
 MON_LDFLAGS	=
 MON_BSP		= libcmb.a
 MON_CRT0	= crt0.o
@@ -121,7 +121,7 @@ clean mostlyclean:
 	rm -f a.out core *.i *.o *-test *.srec *.dis *.x $(SIM_BSP) $(MON_BSP)
 
 distclean maintainer-clean realclean: clean
-	rm -f Makefile config.status *~
+	rm -f Makefile *~
 
 .PHONY: install info install-info clean-info
 install: ${SIM_INSTALL} ${MON_INSTALL}
@@ -140,8 +140,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/mcore/acinclude.m4 b/libgloss/mcore/acinclude.m4
new file mode 100644
index 000000000000..7115869f3113
--- /dev/null
+++ b/libgloss/mcore/acinclude.m4
@@ -0,0 +1,10 @@
+MCORE_BSP_PREFIX=
+case "${target}" in
+  mcore-*-elf)
+	MCORE_BSP_PREFIX=elf-
+	;;
+  mcore-*-pe)
+	MCORE_BSP_PREFIX=pe-
+	;;
+esac
+AC_SUBST(MCORE_BSP_PREFIX)
diff --git a/libgloss/mcore/configure.ac b/libgloss/mcore/configure.ac
deleted file mode 100644
index f6b3f009643e..000000000000
--- a/libgloss/mcore/configure.ac
+++ /dev/null
@@ -1,45 +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
-
-LIB_AC_PROG_CC
-AS=${AS-as}
-AC_SUBST(AS)
-AR=${AR-ar}
-AC_SUBST(AR)
-LD=${LD-ld}
-AC_SUBST(LD)
-AC_PROG_RANLIB
-LIB_AM_PROG_AS
-
-case "${target}" in
-  mcore-*-elf)
-	bsp_prefix=elf-
-	;;
-  mcore-*-pe)
-	bsp_prefix=pe-
-	;;
-esac
-
-AC_SUBST(bsp_prefix)
-
-host_makefile_frag=${srcdir}/../config/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)
-
-AM_ENABLE_MULTILIB(, ../..)
-
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-- 
2.34.1



More information about the Newlib mailing list