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.
+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
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.
+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.
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 \
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'`"
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 \
+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.
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'`"
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)
+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.
-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'`"
fi],[sim_trapdump=""])dnl
AC_SUBST(sim_trapdump)
-SIM_AC_OPTION_HARDWARE(yes,"","")
+SIM_AC_OPTION_HARDWARE
SIM_AC_OUTPUT
+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.
-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'`"
SIM_AC_OPTION_WARNINGS(no)
SIM_AC_OPTION_CGEN_MAINT
-SIM_AC_OPTION_HARDWARE(yes,"","")
+SIM_AC_OPTION_HARDWARE
SIM_AC_OUTPUT
+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.
-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'`"
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
+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.
-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'`"
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
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'`"
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/,/ /'`";;
+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.
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'`"
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
+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.
#
# 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'`"
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
#
# 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
+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.
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'`"
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