]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: simplify hardware m4 macro
authorMike Frysinger <vapier@gentoo.org>
Sat, 24 Apr 2021 01:58:21 +0000 (21:58 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sat, 24 Apr 2021 01:58:21 +0000 (21:58 -0400)
Every port using this sets the 1st arg to yes and the 2nd arg to "".
These are the defaults we probably want anyways in order to unify the
codebase, so move them to the macro and only allow ports to declare
extra hardware models.

30 files changed:
sim/ChangeLog
sim/README-HACKING
sim/bfin/ChangeLog
sim/bfin/configure
sim/bfin/configure.ac
sim/cris/ChangeLog
sim/cris/configure
sim/cris/configure.ac
sim/frv/ChangeLog
sim/frv/configure
sim/frv/configure.ac
sim/iq2000/ChangeLog
sim/iq2000/configure
sim/iq2000/configure.ac
sim/lm32/ChangeLog
sim/lm32/configure
sim/lm32/configure.ac
sim/m32r/ChangeLog
sim/m32r/configure
sim/m32r/configure.ac
sim/m4/sim_ac_option_hardware.m4
sim/m68hc11/ChangeLog
sim/m68hc11/configure
sim/m68hc11/configure.ac
sim/mips/ChangeLog
sim/mips/configure
sim/mips/configure.ac
sim/mn10300/ChangeLog
sim/mn10300/configure
sim/mn10300/configure.ac

index 47032e0bd53724ba07227d5058e91a9cf7835d2a..fdeed7d8f53b8fa363e1a333ac5cbbb26f2fd78d 100644 (file)
@@ -1,3 +1,9 @@
+2021-04-23  Mike Frysinger  <vapier@gentoo.org>
+
+       * README-HACKING (SIM_AC_OPTION_HARDWARE): Delete first two args.
+       * m4/sim_ac_option_hardware.m4 (SIM_AC_OPTION_HARDWARE): Replace [$1]
+       with yes.  Delete test [$2].  Change [$3] to [$1].  Update comments.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * m4/sim_ac_common.m4 (SIM_AC_COMMON): Don't check for sys/time.h
index 0a1a3b55c1ef5902e26a32e1570b531093aa5567..78580588bf2bbc5f37e946ef33131622b0022148 100644 (file)
@@ -396,7 +396,7 @@ Hardware Devices
 
 The simplest simulator doesn't include hardware device support.  Once you're
 ready to move on to the next level, call the common macro in your configure.ac:
-SIM_AC_OPTION_HARDWARE(yes,,devone devtwo devthree)
+SIM_AC_OPTION_HARDWARE(devone devtwo devthree)
 
 The basic hardware API is documented in common/hw-device.h.
 
index 4473b720ffb98a756c2778a9b8720c0c1012fc58..65c96b2f7b9225ff1687ad5937ca419cdb504ef9 100644 (file)
@@ -1,3 +1,8 @@
+2021-04-23  Mike Frysinger  <vapier@gentoo.org>
+
+       * configure.ac (SIM_AC_OPTION_HARDWARE): Delete first two args.
+       * configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index efdeccbdcc2a3cbed06bad11c1837c4e4174ffa9..128621cdbd4d484d5e612dd7c18969c77eb4455c 100755 (executable)
@@ -12081,12 +12081,7 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; }
 fi
 
 
-if test ""; then
-  hardware=""
-else
-  hardware="cfi core pal glue"
-fi
-hardware="$hardware \
+hardware="cfi core pal glue \
        bfin_cec \
        bfin_ctimer \
        bfin_dma \
@@ -12119,7 +12114,6 @@ hardware="$hardware \
        bfin_wp \
        eth_phy \
 "
-
 sim_hw_cflags="-DWITH_HW=1"
 sim_hw="$hardware"
 sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`"
index cedd9677f5691aa0647b2805774de4e486238ee6..8fef4d47d00cfe04f0463293fc89f9c38691323a 100644 (file)
@@ -8,7 +8,7 @@ SIM_AC_OPTION_ENDIAN(LITTLE)
 SIM_AC_OPTION_ALIGNMENT(STRICT_ALIGNMENT,STRICT_ALIGNMENT)
 SIM_AC_OPTION_DEFAULT_MODEL(bf537)
 SIM_AC_OPTION_WARNINGS
-SIM_AC_OPTION_HARDWARE(yes,,\
+SIM_AC_OPTION_HARDWARE(\
        bfin_cec \
        bfin_ctimer \
        bfin_dma \
index 07d3086f758a74e982dbcfc4558fb2bdf7594c50..d123611e5f38b85584ed466a3b70ef829dd1f369 100644 (file)
@@ -1,3 +1,8 @@
+2021-04-23  Mike Frysinger  <vapier@gentoo.org>
+
+       * configure.ac (SIM_AC_OPTION_HARDWARE): Delete first two args.
+       * configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * rvdummy.c: Update includes.
index 2a615b1af14216f2a3905098903657f24872d1a7..6f0b25e85bf7dc714f3f078ac33e037a0edb9d3e 100755 (executable)
@@ -12071,13 +12071,7 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; }
 fi
 
 
-if test ""; then
-  hardware=""
-else
-  hardware="cfi core pal glue"
-fi
-hardware="$hardware rv cris cris_900000xx"
-
+hardware="cfi core pal glue rv cris cris_900000xx"
 sim_hw_cflags="-DWITH_HW=1"
 sim_hw="$hardware"
 sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`"
index 56afe58331a0ebc5c5535e1817ab93514ff714d8..f8aa533a063c6e959cc941ada162fc8b977e23d0 100644 (file)
@@ -15,7 +15,7 @@ SIM_AC_OPTION_ENDIAN(LITTLE)
 SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT)
 SIM_AC_OPTION_SCACHE(16384)
 SIM_AC_OPTION_WARNINGS(no)
-SIM_AC_OPTION_HARDWARE(yes,,rv cris cris_900000xx)
+SIM_AC_OPTION_HARDWARE(rv cris cris_900000xx)
 
 # The default model shouldn't matter as long as there's a BFD.
 SIM_AC_OPTION_DEFAULT_MODEL(crisv32)
index 339a5f0e6fb0a6da7c382fd9f7449f0bbeb9d2b8..bc981ac1d1e48981b9ae7ff7c9df2a95bc2cc660 100644 (file)
@@ -1,3 +1,8 @@
+2021-04-23  Mike Frysinger  <vapier@gentoo.org>
+
+       * configure.ac (SIM_AC_OPTION_HARDWARE): Delete arguments.
+       * configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index 52a30ab7a45bfb94f609cef2fae401c367cc3385..30c7c817c13326402ebe88334fee24d5dd63faae 100755 (executable)
 
 
 
-if test """"; then
-  hardware=""""
-else
-  hardware="cfi core pal glue"
-fi
-hardware="$hardware """
-
+hardware="cfi core pal glue "
 sim_hw_cflags="-DWITH_HW=1"
 sim_hw="$hardware"
 sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`"
index b4f5953051f00d7a7cfa04417b44d72bb084a491..6588fe5e87e70b52655a6af5455b3ce94c3f894d 100644 (file)
@@ -27,6 +27,6 @@ if test x"$silent" != x"yes" && test x"$sim_trapdump" != x""; then
 fi],[sim_trapdump=""])dnl
 AC_SUBST(sim_trapdump)
 
-SIM_AC_OPTION_HARDWARE(yes,"","")
+SIM_AC_OPTION_HARDWARE
 
 SIM_AC_OUTPUT
index 9857bda1ad0664a2bed95b7592b06b4b545d6909..addf3c6387cf893163854ca0f39504e33a1fcbfa 100644 (file)
@@ -1,3 +1,8 @@
+2021-04-23  Mike Frysinger  <vapier@gentoo.org>
+
+       * configure.ac (SIM_AC_OPTION_HARDWARE): Delete arguments.
+       * configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index df5c33d484f2037d07f5be38956da8d217f1fe35..21b500c807939cd5dc227bf16e278a4e24003548 100755 (executable)
 
 
 
-if test """"; then
-  hardware=""""
-else
-  hardware="cfi core pal glue"
-fi
-hardware="$hardware """
-
+hardware="cfi core pal glue "
 sim_hw_cflags="-DWITH_HW=1"
 sim_hw="$hardware"
 sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`"
index 1a5dcfb276a53b37e7c84da767d80b2fef8e713c..f21bc804bdd80113b45a0d3de1e84290bd19fe34 100644 (file)
@@ -11,6 +11,6 @@ SIM_AC_OPTION_DEFAULT_MODEL(iq2000)
 SIM_AC_OPTION_WARNINGS(no)
 SIM_AC_OPTION_CGEN_MAINT
 
-SIM_AC_OPTION_HARDWARE(yes,"","")
+SIM_AC_OPTION_HARDWARE
 
 SIM_AC_OUTPUT
index f42124274c35d7f32e91765796a5a73cd02f03bc..6a3287a05406fe81eb0021ed0cb5de1c90220a59 100644 (file)
@@ -1,3 +1,8 @@
+2021-04-23  Mike Frysinger  <vapier@gentoo.org>
+
+       * configure.ac (SIM_AC_OPTION_HARDWARE): Delete first two args.
+       * configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index 43f006fc1bdb8b52f1abdc58e23badba3be03d73..4b4b8bc1bd86365159d26c29c3f533c457fbae52 100755 (executable)
 
 
 
-if test ""; then
-  hardware=""
-else
-  hardware="cfi core pal glue"
-fi
-hardware="$hardware lm32cpu lm32timer lm32uart"
-
+hardware="cfi core pal glue lm32cpu lm32timer lm32uart"
 sim_hw_cflags="-DWITH_HW=1"
 sim_hw="$hardware"
 sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`"
index 83ed5034580bb737a392798d43f7b68e8ec84d15..63548874a11429b4cc8144f370e0e083b333894b 100644 (file)
@@ -10,6 +10,6 @@ SIM_AC_OPTION_SCACHE(16384)
 SIM_AC_OPTION_DEFAULT_MODEL(lm32)
 SIM_AC_OPTION_WARNINGS(no)
 SIM_AC_OPTION_CGEN_MAINT
-SIM_AC_OPTION_HARDWARE(yes,,lm32cpu lm32timer lm32uart)
+SIM_AC_OPTION_HARDWARE(lm32cpu lm32timer lm32uart)
 
 SIM_AC_OUTPUT
index 6ba7bb44858b5fe99460747b0b7b1dc62f730ca3..7fb4761a1a5f6447004289557e1b48222bf79c3d 100644 (file)
@@ -1,3 +1,8 @@
+2021-04-23  Mike Frysinger  <vapier@gentoo.org>
+
+       * configure.ac (SIM_AC_OPTION_HARDWARE): Delete first two args.
+       * configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index fb35163c9cf1df2fae1a487954b6e04284c88a99..983afc6ba76a5ce20df42a608d1faac86cf1ae69 100755 (executable)
 
 
 
-if test ""; then
-  hardware=""
-else
-  hardware="cfi core pal glue"
-fi
-hardware="$hardware m32r_cache m32r_uart"
-
+hardware="cfi core pal glue m32r_cache m32r_uart"
 sim_hw_cflags="-DWITH_HW=1"
 sim_hw="$hardware"
 sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`"
index 2fd7f7265b0fbfe66bf1a23d29e1ae1cbd290f8a..8ab55bc155a82b467672df2cf0c74411602f82c4 100644 (file)
@@ -24,6 +24,6 @@ SIM_AC_OPTION_CGEN_MAINT
 AC_SUBST(traps_obj)
 AC_SUBST(sim_extra_cflags)
 
-SIM_AC_OPTION_HARDWARE(yes,,m32r_cache m32r_uart)
+SIM_AC_OPTION_HARDWARE(m32r_cache m32r_uart)
 
 SIM_AC_OUTPUT
index cc84fadcc51863c2dec2e34e0cacb970679a4f3a..75e331eb0b3390e86ef49008d0dba72f6629b5aa 100644 (file)
@@ -14,18 +14,10 @@ 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 --enable-sim-hardware is for users of the simulator
-dnl arg[1] Enable sim-hw by default? ("yes" or "no")
-dnl arg[2] is a space separated list of devices that override the defaults
-dnl arg[3] is a space separated list of extra target specific devices.
+dnl arg[1] is a space separated list of extra target specific devices.
 AC_DEFUN([SIM_AC_OPTION_HARDWARE],
 [
-if test "[$2]"; then
-  hardware="[$2]"
-else
-  hardware="cfi core pal glue"
-fi
-hardware="$hardware [$3]"
-
+hardware="cfi core pal glue [$1]"
 sim_hw_cflags="-DWITH_HW=1"
 sim_hw="$hardware"
 sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([[^ ]][[^ ]]*\)/dv-\1.o/g'`"
@@ -33,7 +25,7 @@ sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([[^ ]][[^ ]]*\)/
 AC_ARG_ENABLE(sim-hardware,
   [AS_HELP_STRING([--enable-sim-hardware=LIST],
                   [Specify the hardware to be included in the build.])],
-  ,[enable_sim_hardware="[$1]"])
+  ,[enable_sim_hardware="yes"])
 case ${enable_sim_hardware} in
   yes|no) ;;
   ,*) hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";;
index 3da7580f6935056df12266ef209f16b9322bba9f..788ecfe4434716c15274d1126bd117c7246ba2d6 100644 (file)
@@ -1,3 +1,8 @@
+2021-04-23  Mike Frysinger  <vapier@gentoo.org>
+
+       * configure.ac (SIM_AC_OPTION_HARDWARE): Delete first two args.
+       * configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index 04e56ffd3bb2c562f0d1a388d814d0d37fbccafa..e2e78f825fe09ba04f0c3f415ac11c01ff959477 100755 (executable)
@@ -12029,13 +12029,8 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; }
 fi
 
 
-if test ""; then
-  hardware=""
-else
-  hardware="cfi core pal glue"
-fi
-hardware="$hardware m68hc11 m68hc11sio m68hc11eepr m68hc11tim m68hc11spi nvram"
-
+hardware="cfi core pal glue \
+  m68hc11 m68hc11sio m68hc11eepr m68hc11tim m68hc11spi nvram"
 sim_hw_cflags="-DWITH_HW=1"
 sim_hw="$hardware"
 sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`"
index 6148d1dae4efab0f290f1298bfda9ea19bfd1bd7..be52b63c209201984ef3454bb8dc06b253d28531 100644 (file)
@@ -8,7 +8,7 @@ dnl Options available in this module
 SIM_AC_OPTION_ENDIAN(BIG)
 SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT)
 SIM_AC_OPTION_WARNINGS(no)
-SIM_AC_OPTION_HARDWARE(yes,,
+SIM_AC_OPTION_HARDWARE(\
   m68hc11 m68hc11sio m68hc11eepr m68hc11tim m68hc11spi nvram)
 
 SIM_AC_OUTPUT
index 2e055ec8e9e5d0f148f9b8bf58fbd9bb39fe3e9e..40c9ad5a6cb3d18c8925ca1c88a9f0b58c2dc9e0 100644 (file)
@@ -1,3 +1,9 @@
+2021-04-23  Mike Frysinger  <vapier@gentoo.org>
+
+       * configure.ac (hw_enabled): Delete.
+       (SIM_AC_OPTION_HARDWARE): Delete first two args.
+       * configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index bdf659dc5dfe5ed675485fc621ff2fc4accaea2b..85e0832a876641c2db636365a9a59ec53c7d05b4 100755 (executable)
@@ -12575,23 +12575,16 @@ sim_micromips_flags=" -F ${sim_micromips_filter}  ${sim_micromips_machine}  ${si
 #
 # Add simulated hardware devices
 #
-hw_enabled=no
+hw_extra_devices=""
 case "${target}" in
   mips*tx39*)
-       hw_enabled=yes
        hw_extra_devices="tx3904cpu tx3904irc tx3904tmr tx3904sio"
        ;;
   *)
        ;;
 esac
 
-if test "$hw_devices"; then
-  hardware="$hw_devices"
-else
-  hardware="cfi core pal glue"
-fi
-hardware="$hardware $hw_extra_devices"
-
+hardware="cfi core pal glue $hw_extra_devices"
 sim_hw_cflags="-DWITH_HW=1"
 sim_hw="$hardware"
 sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`"
@@ -12600,7 +12593,7 @@ sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\
 if test "${enable_sim_hardware+set}" = set; then :
   enableval=$enable_sim_hardware;
 else
-  enable_sim_hardware="$hw_enabled"
+  enable_sim_hardware="yes"
 fi
 
 case ${enable_sim_hardware} in
index ec45245dc1f5afff3066b5acfc5f7db1b4859343..593ee2bb4b0ecb1d8356e12223e99265cf950cf4 100644 (file)
@@ -426,16 +426,15 @@ AC_SUBST(sim_multi_obj)
 #
 # Add simulated hardware devices
 #
-hw_enabled=no
+hw_extra_devices=""
 case "${target}" in
   mips*tx39*)
-       hw_enabled=yes
        hw_extra_devices="tx3904cpu tx3904irc tx3904tmr tx3904sio" 
        ;;
   *)
        ;;
 esac
-SIM_AC_OPTION_HARDWARE($hw_enabled,$hw_devices,$hw_extra_devices)
+SIM_AC_OPTION_HARDWARE($hw_extra_devices)
 
 
 # Choose simulator engine
index 0ad3257aa39a0cee8e988d9945284cc3435b0255..aa09b2cca1412c4ba17e059fd611b3ee8a60cae8 100644 (file)
@@ -1,3 +1,8 @@
+2021-04-23  Mike Frysinger  <vapier@gentoo.org>
+
+       * configure.ac (SIM_AC_OPTION_HARDWARE): Delete first two args.
+       * configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index 4c6ad23b83bc618d89b91f31d5d07b04e155c9ca..f7e634e8f78ebea6cd26529a32076f6dede98eca 100755 (executable)
 fi
 
 
-if test ""; then
-  hardware=""
-else
-  hardware="cfi core pal glue"
-fi
-hardware="$hardware mn103cpu mn103int mn103tim mn103ser mn103iop"
-
+hardware="cfi core pal glue mn103cpu mn103int mn103tim mn103ser mn103iop"
 sim_hw_cflags="-DWITH_HW=1"
 sim_hw="$hardware"
 sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`"
index f8b8ef8d2b350cd371e30f4d079e30d4b909ef58..55aec73be50040a6f0ecc85aeb58f6f468f1e96b 100644 (file)
@@ -9,6 +9,6 @@ SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT)
 SIM_AC_OPTION_WARNINGS(no)
 SIM_AC_OPTION_RESERVED_BITS
 SIM_AC_OPTION_BITSIZE(32,31)
-SIM_AC_OPTION_HARDWARE(yes,,mn103cpu mn103int mn103tim mn103ser mn103iop)
+SIM_AC_OPTION_HARDWARE(mn103cpu mn103int mn103tim mn103ser mn103iop)
 
 SIM_AC_OUTPUT