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 681D73858425 for ; Wed, 21 Dec 2022 05:13:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 681D73858425 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 AEB3F3414D7; Wed, 21 Dec 2022 05:13:27 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 2/5] sim: mips: move subtarget defines to top-level configure Date: Wed, 21 Dec 2022 00:13:19 -0500 Message-Id: <20221221051322.4163-2-vapier@gentoo.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221051322.4163-1-vapier@gentoo.org> References: <20221221051322.4163-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_SHORT,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: We want to kill off mips/configure entirely. Move this small part out now to get started. --- sim/Makefile.in | 2 ++ sim/arch-subdir.mk.in | 3 +++ sim/configure | 29 +++++++++++++++++++++++++++-- sim/configure.ac | 1 + sim/mips/Makefile.in | 3 +-- sim/mips/acinclude-top.m4 | 34 ++++++++++++++++++++++++++++++++++ sim/mips/configure | 20 -------------------- sim/mips/configure.ac | 19 ------------------- 8 files changed, 68 insertions(+), 43 deletions(-) create mode 100644 sim/mips/acinclude-top.m4 diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in index 251a9b684d93..086a5cd80a68 100644 --- a/sim/arch-subdir.mk.in +++ b/sim/arch-subdir.mk.in @@ -74,3 +74,6 @@ SIM_HW_CFLAGS = @SIM_HW_CFLAGS@ SIM_HW_SOCKSER = @SIM_HW_SOCKSER@ SIM_HW_OBJS = $(SIM_COMMON_HW_OBJS) $(SIM_HW_DEVICES:%=dv-%.o) $(SIM_HW_SOCKSER) @SIM_ENABLE_HW_FALSE@SIM_HW_OBJS = + +# This can be removed once mips/configure is gone. +SIM_MIPS_SUBTARGET = @SIM_MIPS_SUBTARGET@ diff --git a/sim/configure.ac b/sim/configure.ac index 675fa1bb44d6..a631d2b3a222 100644 --- a/sim/configure.ac +++ b/sim/configure.ac @@ -203,6 +203,7 @@ AC_SUBST(sim_float) dnl Some arches have unique configure flags. m4_include([frv/acinclude.m4]) +m4_include([mips/acinclude-top.m4]) m4_include([riscv/acinclude.m4]) m4_include([rx/acinclude.m4]) diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in index 75438be5a183..50fa7a8fc27f 100644 --- a/sim/mips/Makefile.in +++ b/sim/mips/Makefile.in @@ -67,8 +67,7 @@ SIM_OBJS = \ SIM_EXTRA_HW_DEVICES = tx3904cpu tx3904irc tx3904tmr tx3904sio # List of flags to always pass to $(CC). -SIM_SUBTARGET=@SIM_SUBTARGET@ -SIM_EXTRA_CFLAGS = $(SIM_SUBTARGET) +SIM_EXTRA_CFLAGS = $(SIM_MIPS_SUBTARGET) SIM_EXTRA_CLEAN = clean-extra SIM_EXTRA_DISTCLEAN = distclean-extra diff --git a/sim/mips/acinclude-top.m4 b/sim/mips/acinclude-top.m4 new file mode 100644 index 000000000000..4eb6c19f8123 --- /dev/null +++ b/sim/mips/acinclude-top.m4 @@ -0,0 +1,34 @@ +dnl TODO: Rename this to acinclude.m4 once mips/configure is removed. +dnl +dnl Copyright (C) 2005-2022 Free Software Foundation, Inc. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see . +dnl +dnl NB: This file is included in sim/configure, so keep settings namespaced. + +dnl DEPRECATED +dnl +dnl Instead of defining a `subtarget' macro, code should be checking the value +dnl of {STATE,CPU}_ARCHITECTURE to identify the architecture dnl in question. +AC_MSG_CHECKING([mips subtarget]) +SIM_MIPS_SUBTARGET= +AS_CASE([${target}], + [mips64vr*-*-*], [SIM_MIPS_SUBTARGET="-DTARGET_ENABLE_FR=1"], + [mips*tx39*], [SIM_MIPS_SUBTARGET="-DSUBTARGET_R3900=1"], + [mips*-sde-elf*], [SIM_MIPS_SUBTARGET="-DTARGET_ENABLE_FR=1"], + [mips*-mti-elf*], [SIM_MIPS_SUBTARGET="-DTARGET_ENABLE_FR=1"], + [mipsisa32*-*-*], [SIM_MIPS_SUBTARGET="-DTARGET_ENABLE_FR=1"], + [mipsisa64*-*-*], [SIM_MIPS_SUBTARGET="-DTARGET_ENABLE_FR=1"]) +AC_MSG_RESULT([${SIM_MIPS_SUBTARGET:-none}]) +AC_SUBST(SIM_MIPS_SUBTARGET) diff --git a/sim/mips/configure.ac b/sim/mips/configure.ac index 52e54bc8bceb..308b3aefbeb1 100644 --- a/sim/mips/configure.ac +++ b/sim/mips/configure.ac @@ -6,25 +6,6 @@ dnl The sim shouldn't be checking $target and changing behavior. But it is, dnl and until we clean that up, we need to expand --target for use below. AC_CANONICAL_SYSTEM -# DEPRECATED -# -# Instead of defining a `subtarget' macro, code should be checking -# the value of {STATE,CPU}_ARCHITECTURE to identify the architecture -# in question. -# -case "${target}" in - mips64vr*-*-*) SIM_SUBTARGET="-DTARGET_ENABLE_FR=1" ;; - mips*tx39*) SIM_SUBTARGET="-DSUBTARGET_R3900=1";; - mips*-sde-elf*) SIM_SUBTARGET="-DTARGET_ENABLE_FR=1";; - mips*-mti-elf*) SIM_SUBTARGET="-DTARGET_ENABLE_FR=1";; - mipsisa32*-*-*) SIM_SUBTARGET="-DTARGET_ENABLE_FR=1";; - mipsisa64*-*-*) SIM_SUBTARGET="-DTARGET_ENABLE_FR=1";; - *) SIM_SUBTARGET="";; -esac -AC_SUBST(SIM_SUBTARGET) - - - # # Select the bitsize of the target # -- 2.39.0