public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
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	[thread overview]
Message-ID: <20221221051322.4163-2-vapier@gentoo.org> (raw)
In-Reply-To: <20221221051322.4163-1-vapier@gentoo.org>

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 <http://www.gnu.org/licenses/>.
+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


  reply	other threads:[~2022-12-21  5:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21  5:13 [PATCH 1/5] sim: mips: always resolve active bfd mach dynamically Mike Frysinger
2022-12-21  5:13 ` Mike Frysinger [this message]
2022-12-21  5:13 ` [PATCH 3/5] sim: mips: move bitsize defines to top-level configure Mike Frysinger
2022-12-21  5:13 ` [PATCH 4/5] sim: mips: move fpu " Mike Frysinger
2022-12-21  5:13 ` [PATCH 5/5] sim: mips: match target on cpu settings Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221221051322.4163-2-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).