[PATCH] libgloss: merge sparc configure script up a level

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Move the minor sparc-specific logic to a dedicated variable so we can
merge its configure logic up a level.
---
 libgloss/Makefile.in              |   19 +-
 libgloss/configure                |    5 +-
 libgloss/configure.ac             |    3 +-
 libgloss/sparc/Makefile.in        |   14 +-
 libgloss/sparc/acinclude.m4       |   15 +
 libgloss/sparc/aclocal.m4         |  384 ---
 libgloss/sparc/configure          | 3937 -----------------------------
 libgloss/sparc/configure.ac       |   64 -
 libgloss/sparc/libsys/Makefile.in |    4 +-
 9 files changed, 38 insertions(+), 4407 deletions(-)
 create mode 100644 libgloss/sparc/acinclude.m4
 delete mode 100644 libgloss/sparc/aclocal.m4
 delete mode 100755 libgloss/sparc/configure
 delete mode 100644 libgloss/sparc/configure.ac

diff --git a/libgloss/configure.ac b/libgloss/configure.ac
index b5a0fce08c9b..4aa0f19140fe 100644
--- a/libgloss/configure.ac
+++ b/libgloss/configure.ac
@@ -84,7 +84,8 @@ case "${target}" in
 	subdirs="$subdirs sparc_leon"
 	;;
   sparclet-*-aout* | sparc-*-elf* | sparc64-*-elf* | sparc86x-*-* | sparclite-*-*)
-	AC_CONFIG_SUBDIRS([sparc])
+	AC_CONFIG_FILES([sparc/Makefile])
+	subdirs="$subdirs sparc"
 	;;
   sh*-*-pe | mips*-*-pe | *arm*-wince-pe)
 	config_wince=true
diff --git a/libgloss/sparc/Makefile.in b/libgloss/sparc/Makefile.in
index 5c3ac661880a..2342518b54d1 100644
--- a/libgloss/sparc/Makefile.in
+++ b/libgloss/sparc/Makefile.in
@@ -93,7 +93,7 @@ OBJS = close.o fstat.o getpid.o isatty.o kill.o \
 # variants (via runtime switches).  However, the compiler [currently] doesn't.
 # Of course, it may be the case that there isn't any cpu specific code in
 # C source files, but there might be in the future.
-CPU = @CPU@
+CPU = @SPARC_CPU@
 
 # sparc stuff (not sparclite or sparclet)
 SPARC_ALL = $(CYGMON_BSP) $(CYGMON_CRT0) $(objdir)/cygmon.ld
@@ -170,7 +170,7 @@ sparcl-stub.o: $(srcdir)/sparcl-stub.c $(srcdir)/../debug.h $(srcdir)/../debug.c
 erc32-stub.o: $(srcdir)/erc32-stub.c $(srcdir)/../debug.h $(srcdir)/../debug.c
 fixctors.o : $(srcdir)/fixctors.c
 
-$(objdir)/cygmon.ld: @CYGMONLDSCRIPTTEMPL@
+$(objdir)/cygmon.ld: @SPARC_CYGMONLDSCRIPTTEMPL@
 	sed 's/TARGET_OBJ_FORMAT/$($(CPU)_OBJ_FORMAT)/g;s/TARGET_RAM_START/$($(CPU)_RAM_START)/g;' < $(<) > $(objdir)/cygmon.ld
 
 install: $($(CPU)_INSTALL)
@@ -278,16 +278,12 @@ clean mostlyclean:
 	rm -f *.o *.a *.map *.x
 
 distclean maintainer-clean realclean: clean
-	rm -f Makefile config.cache config.log config.status
+	rm -f Makefile
 
 .PHONY: info dvi doc install-info clean-info
 info doc dvi:
 install-info:
 clean-info:
 
-Makefile: Makefile.in config.status @host_makefile_frag_path@ \
-	@target_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/sparc/acinclude.m4 b/libgloss/sparc/acinclude.m4
new file mode 100644
index 000000000000..bba852b9a887
--- /dev/null
+++ b/libgloss/sparc/acinclude.m4
@@ -0,0 +1,15 @@
+SPARC_CPU=SPARC
+case ${target_cpu} in
+sparclite*) SPARC_CPU=SLITE ;;
+sparclet*) SPARC_CPU=SPLET ;;
+sparc64*) SPARC_CPU=SPARC64 ;;
+sparc86x*) SPARC_CPU=SLITE ;;
+esac
+AC_SUBST(SPARC_CPU)
+
+SPARC_CYGMONLDSCRIPTTEMPL=${srcdir}/sparc/cygmon.ld.src
+case ${target_cpu} in
+sparc64*) SPARC_CYGMONLDSCRIPTTEMPL=${srcdir}/sparc/cygmon-sparc64-ld.src ;;
+sparclet-*-aout*) SPARC_CYGMONLDSCRIPTTEMPL=${srcdir}/sparc/cygmon.ld.src; AC_CONFIG_FILES([sparc/libsys/Makefile]) ;;
+esac
+AC_SUBST(SPARC_CYGMONLDSCRIPTTEMPL)
diff --git a/libgloss/sparc/configure.ac b/libgloss/sparc/configure.ac
deleted file mode 100644
index 4a5b9ef4b76a..000000000000
--- a/libgloss/sparc/configure.ac
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright (c) 1995, 1996 Cygnus Support
-#
-# The authors hereby grant permission to use, copy, modify, distribute,
-# and license this software and its documentation for any purpose, provided
-# that existing copyright notices are retained in all copies and that this
-# notice is included verbatim in any distributions. No written agreement,
-# license, or royalty fee is required for any of the authorized uses.
-# Modifications to this software may be copyrighted by their authors
-# and need not follow the licensing terms described here, provided that
-# the new terms are clearly indicated on the first page of each file where
-# they apply.
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(sparc-stub.c)
-
-AC_CONFIG_AUX_DIR(../..)
-
-AC_PROG_INSTALL
-
-AC_CANONICAL_SYSTEM
-
-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_cpu} in
-sparclite*) CPU=SLITE ;;
-sparclet*) CPU=SPLET ;;
-sparc64*) CPU=SPARC64 ;;
-sparc86x*) CPU=SLITE ;;
-*) CPU=SPARC ;;
-esac
-AC_SUBST(CPU)
-
-case ${target_cpu} in
-sparc64*) CYGMONLDSCRIPTTEMPL=${srcdir}/cygmon-sparc64-ld.src ;;
-sparclet-*-aout*) CYGMONLDSCRIPTTEMPL-${srcdir}/cygmon.ld.src; AC_CONFIG_FILES([libsys/Makefile]) ;;
-*) CYGMONLDSCRIPTTEMPL=${srcdir}/cygmon.ld.src
-esac
-
-host_makefile_frag=`cd $srcdir/../config;pwd`/default.mh
-target_makefile_frag=${srcdir}/../config/default.mt
-
-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)
-target_makefile_frag_path=$target_makefile_frag
-AC_SUBST(target_makefile_frag_path)
-AC_SUBST_FILE(target_makefile_frag)
-AC_SUBST(CYGMONLDSCRIPTTEMPL)
-
-AM_ENABLE_MULTILIB(, ../..)
-
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
diff --git a/libgloss/sparc/libsys/Makefile.in b/libgloss/sparc/libsys/Makefile.in
index 81dcfad16900..618ea8b9f6ac 100644
--- a/libgloss/sparc/libsys/Makefile.in
+++ b/libgloss/sparc/libsys/Makefile.in
@@ -108,8 +108,8 @@ clean mostlyclean:
 distclean maintainer-clean realclean: clean
 	rm -f Makefile
 
-Makefile: Makefile.in ../config.status
-	cd .. && $(SHELL) config.status
+Makefile: Makefile.in ../../config.status
+	cd ../.. && $(SHELL) config.status
 
 stamp-srcs: Makefile template.S template_r.S
 	for f in $(TEMPLATE_SFILES:_=) ; \
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.