[2/5] sim: unify hardware settings

Message ID 20210620055519.22229-2-vapier@gentoo.org
State New
Headers show
Series
  • [1/5] sim: hw: rework configure option & device selection
Related show

Commit Message

Eli Zaretskii via Gdb-patches June 20, 2021, 5:55 a.m.
Move these options up to the common dir so we only test & export
them once across all ports.
---
 sim/Makefile.in                  |  3 ++
 sim/aarch64/aclocal.m4           |  1 -
 sim/aarch64/configure            | 53 -------------------------------
 sim/aclocal.m4                   |  1 +
 sim/arch-subdir.mk.in            |  5 +++
 sim/arm/aclocal.m4               |  1 -
 sim/arm/configure                | 53 -------------------------------
 sim/avr/aclocal.m4               |  1 -
 sim/avr/configure                | 53 -------------------------------
 sim/bfin/aclocal.m4              |  1 -
 sim/bfin/configure               | 48 ----------------------------
 sim/bpf/aclocal.m4               |  1 -
 sim/bpf/configure                | 48 ----------------------------
 sim/common/Make-common.in        |  4 ---
 sim/configure                    | 54 ++++++++++++++++++++++++++++++--
 sim/configure.ac                 |  1 +
 sim/cr16/aclocal.m4              |  1 -
 sim/cr16/configure               | 53 -------------------------------
 sim/cris/aclocal.m4              |  1 -
 sim/cris/configure               | 48 ----------------------------
 sim/d10v/aclocal.m4              |  1 -
 sim/d10v/configure               | 53 -------------------------------
 sim/erc32/aclocal.m4             |  1 -
 sim/erc32/configure              | 53 -------------------------------
 sim/example-synacor/aclocal.m4   |  1 -
 sim/example-synacor/configure    | 53 -------------------------------
 sim/frv/aclocal.m4               |  1 -
 sim/frv/configure                | 48 ----------------------------
 sim/ft32/aclocal.m4              |  1 -
 sim/ft32/configure               | 53 -------------------------------
 sim/h8300/aclocal.m4             |  1 -
 sim/h8300/configure              | 53 -------------------------------
 sim/iq2000/aclocal.m4            |  1 -
 sim/iq2000/configure             | 48 ----------------------------
 sim/lm32/aclocal.m4              |  1 -
 sim/lm32/configure               | 48 ----------------------------
 sim/m32c/aclocal.m4              |  1 -
 sim/m32c/configure               | 53 -------------------------------
 sim/m32r/aclocal.m4              |  1 -
 sim/m32r/configure               | 48 ----------------------------
 sim/m4/sim_ac_option_hardware.m4 | 11 +------
 sim/m4/sim_ac_output.m4          |  2 --
 sim/m68hc11/aclocal.m4           |  1 -
 sim/m68hc11/configure            | 53 -------------------------------
 sim/mcore/aclocal.m4             |  1 -
 sim/mcore/configure              | 53 -------------------------------
 sim/microblaze/aclocal.m4        |  1 -
 sim/microblaze/configure         | 53 -------------------------------
 sim/mips/aclocal.m4              |  1 -
 sim/mips/configure               | 48 ----------------------------
 sim/mn10300/aclocal.m4           |  1 -
 sim/mn10300/configure            | 48 ----------------------------
 sim/moxie/aclocal.m4             |  1 -
 sim/moxie/configure              | 53 -------------------------------
 sim/msp430/aclocal.m4            |  1 -
 sim/msp430/configure             | 53 -------------------------------
 sim/or1k/aclocal.m4              |  1 -
 sim/or1k/configure               | 48 ----------------------------
 sim/pru/aclocal.m4               |  1 -
 sim/pru/configure                | 53 -------------------------------
 sim/riscv/aclocal.m4             |  1 -
 sim/riscv/configure              | 48 ----------------------------
 sim/rl78/aclocal.m4              |  1 -
 sim/rl78/configure               | 53 -------------------------------
 sim/rx/aclocal.m4                |  1 -
 sim/rx/configure                 | 48 ----------------------------
 sim/sh/aclocal.m4                |  1 -
 sim/sh/configure                 | 53 -------------------------------
 sim/v850/aclocal.m4              |  1 -
 sim/v850/configure               | 48 ----------------------------
 70 files changed, 63 insertions(+), 1627 deletions(-)

-- 
2.31.1

Patch

diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in
index 92b217d20be6..f145f1a3c6bd 100644
--- a/sim/arch-subdir.mk.in
+++ b/sim/arch-subdir.mk.in
@@ -68,3 +68,8 @@  CGEN_MAINT = ; @true
 CGENDIR = @cgendir@
 
 SIM_INLINE = @SIM_INLINE@
+
+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 =
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 6d7c9c47b64a..41becaa05f16 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -72,8 +72,6 @@  SHELL = @SHELL@
 SIM_BITSIZE = @sim_bitsize@
 SIM_DEFAULT_MODEL = @sim_default_model@
 SIM_FLOAT = @sim_float@
-SIM_HW_CFLAGS = @sim_hw_cflags@
-SIM_HW_SOCKSER = @sim_hw_sockser@
 SIM_RESERVED_BITS = @sim_reserved_bits@
 SIM_SCACHE = @sim_scache@
 SIM_WARN_CFLAGS = $(WARN_CFLAGS)
@@ -216,8 +214,6 @@  BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(CSEARCH)
 COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(SIM_EXTRA_CFLAGS)
 
 SIM_HW_DEVICES = cfi core pal glue $(SIM_EXTRA_HW_DEVICES)
-SIM_HW_OBJS = $(SIM_COMMON_HW_OBJS) $(SIM_HW_DEVICES:%=dv-%.o) $(SIM_HW_SOCKSER)
-@SIM_ENABLE_HW_FALSE@SIM_HW_OBJS =
 
 ZLIB = $(zlibdir) -lz
 LIBIBERTY_LIB = ../../libiberty/libiberty.a
diff --git a/sim/configure.ac b/sim/configure.ac
index 9530268ddc59..042bfbfd1cd3 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -122,6 +122,7 @@  SIM_AC_OPTION_CGEN_MAINT
 SIM_AC_OPTION_DEBUG
 SIM_AC_OPTION_ENDIAN
 SIM_AC_OPTION_ENVIRONMENT
+SIM_AC_OPTION_HARDWARE
 SIM_AC_OPTION_INLINE
 SIM_AC_OPTION_PROFILE
 SIM_AC_OPTION_STDIO
diff --git a/sim/m4/sim_ac_option_hardware.m4 b/sim/m4/sim_ac_option_hardware.m4
index 14101830e828..ed53cd2f1206 100644
--- a/sim/m4/sim_ac_option_hardware.m4
+++ b/sim/m4/sim_ac_option_hardware.m4
@@ -39,16 +39,7 @@  elif test "$enable_sim_hardware" = yes; then
 else
   AC_MSG_ERROR([unknown argument "$enable_sim_hardware"])
 fi
-dnl AM_CONDITIONAL([SIM_ENABLE_HW], [test "$enable_sim_hardware" = "yes"])
-if test "$enable_sim_hardware" = "yes"; then
-  SIM_ENABLE_HW_TRUE=
-  SIM_ENABLE_HW_FALSE='#'
-else
-  SIM_ENABLE_HW_TRUE='#'
-  SIM_ENABLE_HW_FALSE=
-fi
-AC_SUBST(SIM_ENABLE_HW_TRUE)
-AC_SUBST(SIM_ENABLE_HW_FALSE)
+AM_CONDITIONAL([SIM_ENABLE_HW], [test "$enable_sim_hardware" = "yes"])
 AC_MSG_RESULT(${enable_sim_hardware})
 AC_SUBST(sim_hw_cflags)
 AC_SUBST(sim_hw_sockser)
diff --git a/sim/m4/sim_ac_output.m4 b/sim/m4/sim_ac_output.m4
index 8d260421e0e9..aba45b0bc33e 100644
--- a/sim/m4/sim_ac_output.m4
+++ b/sim/m4/sim_ac_output.m4
@@ -21,8 +21,6 @@  dnl one afterwards.  The two pieces of the common fragment are inserted into
 dnl the target's fragment at the appropriate points.
 AC_DEFUN([SIM_AC_OUTPUT],
 [dnl
-AC_REQUIRE([SIM_AC_OPTION_HARDWARE])dnl
-
 dnl Make @cgen_breaks@ non-null only if the sim uses CGEN.
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then