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 10BA73858D1E for ; Fri, 11 Feb 2022 12:51:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 10BA73858D1E 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 A2044343172; Fri, 11 Feb 2022 12:51:05 +0000 (UTC) From: Mike Frysinger To: newlib@sourceware.org Subject: [PATCH 6/8] libgloss: merge m68k configure script up a level Date: Fri, 11 Feb 2022 07:50:52 -0500 Message-Id: <20220211125054.12397-7-vapier@gentoo.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211125054.12397-1-vapier@gentoo.org> References: <20220211125054.12397-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_STOCKGEN, 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, 11 Feb 2022 12:51:08 -0000 Move the minor m68k-specific logic to a dedicated file & namespace them so we can merge its configure logic up a level. --- libgloss/Makefile.in | 21 +- libgloss/configure | 53 +- libgloss/configure.ac | 4 +- libgloss/m68k/Makefile.in | 11 +- libgloss/m68k/acinclude.m4 | 16 + libgloss/m68k/aclocal.m4 | 384 --- libgloss/m68k/configure | 5039 ------------------------------------ libgloss/m68k/configure.ac | 65 - 8 files changed, 87 insertions(+), 5506 deletions(-) create mode 100644 libgloss/m68k/acinclude.m4 delete mode 100644 libgloss/m68k/aclocal.m4 delete mode 100755 libgloss/m68k/configure delete mode 100644 libgloss/m68k/configure.ac diff --git a/libgloss/configure.ac b/libgloss/configure.ac index 0218d6763572..a32deae08bf4 100644 --- a/libgloss/configure.ac +++ b/libgloss/configure.ac @@ -68,7 +68,8 @@ case "${target}" in subdirs="$subdirs nds32" ;; fido-*-* | m68*-*-*) - AC_CONFIG_SUBDIRS([m68k]) + AC_CONFIG_FILES([m68k/Makefile]) + subdirs="$subdirs m68k" ;; hppa*-*-pro*) AC_CONFIG_FILES([pa/Makefile]) @@ -326,6 +327,7 @@ AC_DEFINE_UNQUOTED(__SYMBOL_PREFIX, "$libc_cv_symbol_prefix", [symbol prefix]) m4_include([i386/acinclude.m4]) m4_include([libnosys/acinclude.m4]) +m4_include([m68k/acinclude.m4]) m4_include([mcore/acinclude.m4]) m4_include([moxie/acinclude.m4]) diff --git a/libgloss/m68k/Makefile.in b/libgloss/m68k/Makefile.in index 42cf2b2d6f4b..7f67426a638b 100644 --- a/libgloss/m68k/Makefile.in +++ b/libgloss/m68k/Makefile.in @@ -69,7 +69,7 @@ OBJS = close.o fstat.o getpid.o isatty.o kill.o \ unlink.o write.o # What targets to build for. This is a list of {m68k,cf} -TARGET = @TARGET@ +TARGET = @M68K_TARGET@ # Here is all of the simulator stuff SIM_SCRIPTS = sim.ld @@ -476,14 +476,11 @@ clean mostlyclean: rm -f a.out core *.i *~ *.a *.o *-test *.srec *.dis *.x *.map distclean maintainer-clean realclean: clean - rm -f Makefile config.cache config.log config.status + rm -f Makefile info dvi doc: 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/m68k/acinclude.m4 b/libgloss/m68k/acinclude.m4 new file mode 100644 index 000000000000..2fc1c7f7ecb2 --- /dev/null +++ b/libgloss/m68k/acinclude.m4 @@ -0,0 +1,16 @@ +M68K_TARGET=m68k +case "${target}" in + fido-*-* | m68*-*-*) + AC_MSG_CHECKING([target cpu family]) + AC_PREPROC_IFELSE([AC_LANG_PROGRAM([ +#ifndef __mcoldfire__ +#error we are not coldfire +#endif])], M68K_TARGET="cf") + AC_PREPROC_IFELSE([AC_LANG_PROGRAM([ +#ifndef __mfido__ +#error we are not fido +#endif])], M68K_TARGET="fido") + AC_MSG_RESULT($M68K_TARGET) + ;; +esac +AC_SUBST(M68K_TARGET) diff --git a/libgloss/m68k/configure.ac b/libgloss/m68k/configure.ac deleted file mode 100644 index 0230e08d8346..000000000000 --- a/libgloss/m68k/configure.ac +++ /dev/null @@ -1,65 +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. -# -# 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 - -AC_NO_EXECUTABLES - -AC_MSG_CHECKING([target cpu family]) -TARGET=m68k -AC_PREPROC_IFELSE([AC_LANG_PROGRAM([#ifndef __mcoldfire__ - #error we are not coldfire - #endif])], - TARGET="cf",) -AC_PREPROC_IFELSE([AC_LANG_PROGRAM([#ifndef __mfido__ - #error we are not fido - #endif])], - TARGET="fido",) -AC_MSG_RESULT($TARGET) -AC_SUBST(TARGET) - -host_makefile_frag=${srcdir}/../config/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) - -AM_ENABLE_MULTILIB(, ../..) - -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT -- 2.34.1