From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 5CA3D3858D20 for ; Fri, 18 Feb 2022 02:29:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5CA3D3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 1CDB0342B80; Fri, 18 Feb 2022 02:29:32 +0000 (UTC) From: Mike Frysinger To: newlib@sourceware.org Subject: [PATCH] libgloss: merge sparc configure script up a level Date: Thu, 17 Feb 2022 21:29:26 -0500 Message-Id: <20220218022926.10341-1-vapier@gentoo.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2022 02:29:38 -0000 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