sim: mips: move subtarget defines to top-level configure
authorMike Frysinger <vapier@gentoo.org>
Fri, 11 Nov 2022 08:44:57 +0000 (15:44 +0700)
committerMike Frysinger <vapier@gentoo.org>
Thu, 22 Dec 2022 03:27:11 +0000 (22:27 -0500)
We want to kill off mips/configure entirely.  Move this small part
out now to get started.

sim/Makefile.in
sim/arch-subdir.mk.in
sim/configure
sim/configure.ac
sim/mips/Makefile.in
sim/mips/acinclude-top.m4 [new file with mode: 0644]
sim/mips/configure
sim/mips/configure.ac

index 0c9975ecbad54ff52ee41261c93281523a72f51e..a1483457ba4cd02fa8405e078a74fd3bb73d3aea 100644 (file)
@@ -246,6 +246,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
        $(top_srcdir)/m4/sim_ac_platform.m4 \
        $(top_srcdir)/m4/sim_ac_toolchain.m4 \
        $(top_srcdir)/frv/acinclude.m4 \
+       $(top_srcdir)/mips/acinclude-top.m4 \
        $(top_srcdir)/riscv/acinclude.m4 $(top_srcdir)/rx/acinclude.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -1105,6 +1106,7 @@ SIM_FRV_TRAPDUMP_FLAGS = @SIM_FRV_TRAPDUMP_FLAGS@
 SIM_HW_CFLAGS = @SIM_HW_CFLAGS@
 SIM_HW_SOCKSER = @SIM_HW_SOCKSER@
 SIM_INLINE = @SIM_INLINE@
+SIM_MIPS_SUBTARGET = @SIM_MIPS_SUBTARGET@
 SIM_PRIMARY_TARGET = @SIM_PRIMARY_TARGET@
 SIM_RISCV_BITSIZE = @SIM_RISCV_BITSIZE@
 SIM_RX_CYCLE_ACCURATE_FLAGS = @SIM_RX_CYCLE_ACCURATE_FLAGS@
index cfde3f3fb785d3ced05e5f94c80eca97a55bf1b9..ca2d2417ec6a8b41f2e48720223ffcdbc548ed87 100644 (file)
@@ -73,3 +73,6 @@ SIM_INLINE = @SIM_INLINE@
 SIM_HW_CFLAGS = @SIM_HW_CFLAGS@
 SIM_HW_OBJS = $(SIM_HW_DEVICES:%=dv-%.o)
 @SIM_ENABLE_HW_FALSE@SIM_HW_OBJS =
+
+# This can be removed once mips/configure is gone.
+SIM_MIPS_SUBTARGET = @SIM_MIPS_SUBTARGET@
index 57c4fcf6972e4713cd865c1e657cea63d1e833ef..bf81c8326960a9dc8da25ca0089f9624642ba5a7 100755 (executable)
@@ -641,6 +641,7 @@ LTLIBOBJS
 include_makefile
 SIM_RX_CYCLE_ACCURATE_FLAGS
 SIM_RISCV_BITSIZE
+SIM_MIPS_SUBTARGET
 SIM_FRV_TRAPDUMP_FLAGS
 sim_float
 sim_bitsize
@@ -12431,7 +12432,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12434 "configure"
+#line 12435 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12537,7 +12538,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12540 "configure"
+#line 12541 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16276,6 +16277,30 @@ $as_echo "no" >&6; }
 fi
 
 
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking mips subtarget" >&5
+$as_echo_n "checking mips subtarget... " >&6; }
+SIM_MIPS_SUBTARGET=
+case ${target} in #(
+  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" ;; #(
+  *) :
+     ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${SIM_MIPS_SUBTARGET:-none}" >&5
+$as_echo "${SIM_MIPS_SUBTARGET:-none}" >&6; }
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking riscv bitsize" >&5
 $as_echo_n "checking riscv bitsize... " >&6; }
 SIM_RISCV_BITSIZE=64
index 675fa1bb44d6d05f8569b0fab5dce4a7a8ac7e12..a631d2b3a222183f4d32b63894c7a7ca2586f764 100644 (file)
@@ -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])
 
index eadb34697c89620e4103b0872219986a3894a3a7..d8d50eaabd71a5c63057f84abb397e063ec9a3a9 100644 (file)
@@ -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 (file)
index 0000000..4eb6c19
--- /dev/null
@@ -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)
index 19b91fadc2904f1ddf6bad13ccc3f58907c9fc8b..70939f9851a2caff857fef462a05907a7cd42ff8 100755 (executable)
@@ -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
 #
index 52e54bc8bcebfe9fe1735b587e28f7a4968bb0ec..308b3aefbeb150d53d432e500915ebdf7784d415 100644 (file)
@@ -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
 #