summaryrefslogtreecommitdiff
path: root/sim/mips
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-11-11 15:44:57 +0700
committerMike Frysinger <vapier@gentoo.org>2022-12-21 22:27:11 -0500
commit2d5700ad4e6e43d76548be5e8148c05f6948aea2 (patch)
tree6af9359f034777f954a6720171417f344c1cea3a /sim/mips
parent0fb6c560ffa591fbb7f8aa7de4f6719e20ced208 (diff)
downloadbinutils-gdb-2d5700ad4e6e43d76548be5e8148c05f6948aea2.tar.gz
sim: mips: move subtarget defines to top-level configure
We want to kill off mips/configure entirely. Move this small part out now to get started.
Diffstat (limited to 'sim/mips')
-rw-r--r--sim/mips/Makefile.in3
-rw-r--r--sim/mips/acinclude-top.m434
-rwxr-xr-xsim/mips/configure20
-rw-r--r--sim/mips/configure.ac19
4 files changed, 35 insertions, 41 deletions
diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index eadb34697c8..d8d50eaabd7 100644
--- a/sim/mips/Makefile.in
+++ b/sim/mips/Makefile.in
@@ -67,8 +67,7 @@ SIM_OBJS = \
sim-resume.o \
# 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 00000000000..4eb6c19f812
--- /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 b/sim/mips/configure
index 19b91fadc29..70939f9851a 100755
--- a/sim/mips/configure
+++ b/sim/mips/configure
@@ -595,7 +595,6 @@ sim_micromips16_flags
sim_micromips_flags
sim_m16_flags
sim_igen_flags
-SIM_SUBTARGET
target_os
target_vendor
target_cpu
@@ -1844,25 +1843,6 @@ test -n "$target_alias" &&
program_prefix=${target_alias}-
-# 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
-
-
-
-
#
# Select the bitsize of the target
#
diff --git a/sim/mips/configure.ac b/sim/mips/configure.ac
index 52e54bc8bce..308b3aefbeb 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
#