aboutsummaryrefslogtreecommitdiff
path: root/sim/m68hc11
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-19 19:36:39 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-21 21:36:51 -0400
commitbe0387eed099dbc2f2bdc92fbf60e04f846c3b2b (patch)
treea61ac0be186cfe159401b1c96892f8554b07c5af /sim/m68hc11
parentb4ee29a4450a88a64d99db0e49bac2e8670e086b (diff)
downloadfsf-binutils-gdb-be0387eed099dbc2f2bdc92fbf60e04f846c3b2b.zip
fsf-binutils-gdb-be0387eed099dbc2f2bdc92fbf60e04f846c3b2b.tar.gz
fsf-binutils-gdb-be0387eed099dbc2f2bdc92fbf60e04f846c3b2b.tar.bz2
sim: hw: rework configure option & device selection
The sim-hardware configure option allows builders to select a set of device models to enable. But this seems like unnecessary overkill: the existence of individual device models doesn't affect performance at all as they are only enabled at runtime if the config uses them, and individually these are all <5KB a piece. Stripping off a total of ~50KB from a ~1MB binary doesn't seem useful, and it's extremely unlikely anyone will ever bother. So let's simplify the configure/make logic by turning sim-hardware into a boolean option like many of the other sim options. Any ports that have unique device models will declare them in their Makefile instead of at configure time. This will allow us to (eventually) unify the setting into the common dir.
Diffstat (limited to 'sim/m68hc11')
-rw-r--r--sim/m68hc11/ChangeLog6
-rw-r--r--sim/m68hc11/Makefile.in2
-rwxr-xr-xsim/m68hc11/configure64
-rw-r--r--sim/m68hc11/configure.ac4
4 files changed, 33 insertions, 43 deletions
diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog
index 9f6a877..ea7373a 100644
--- a/sim/m68hc11/ChangeLog
+++ b/sim/m68hc11/ChangeLog
@@ -1,3 +1,9 @@
+2021-06-21 Mike Frysinger <vapier@gentoo.org>
+
+ * Makefile.in (SIM_EXTRA_HW_DEVICES): Define.
+ * configure.ac (SIM_AC_OPTION_HARDWARE): Delete call.
+ * configure: Regenerate.
+
2021-06-20 Mike Frysinger <vapier@gentoo.org>
* configure.ac (SIM_AC_COMMON): Delete.
diff --git a/sim/m68hc11/Makefile.in b/sim/m68hc11/Makefile.in
index 8a04491..e7b6686 100644
--- a/sim/m68hc11/Makefile.in
+++ b/sim/m68hc11/Makefile.in
@@ -24,6 +24,8 @@ SIM_OBJS = $(M68HC11_OBJS) \
$(SIM_NEW_COMMON_OBJS) \
sim-resume.o
+SIM_EXTRA_HW_DEVICES = m68hc11 m68hc11sio m68hc11eepr m68hc11tim m68hc11spi nvram
+
SIM_PROFILE= -DPROFILE=1 -DWITH_PROFILE=-1
# We must use 32-bit addresses to support memory bank switching.
# The WORD_BITSIZE is normally 16 but must be switched (temporarily)
diff --git a/sim/m68hc11/configure b/sim/m68hc11/configure
index a1e2842..f3b1467 100755
--- a/sim/m68hc11/configure
+++ b/sim/m68hc11/configure
@@ -590,6 +590,10 @@ sim_scache
sim_float
sim_bitsize
cgen_breaks
+sim_hw_sockser
+sim_hw_cflags
+SIM_ENABLE_HW_FALSE
+SIM_ENABLE_HW_TRUE
target_alias
host_alias
build_alias
@@ -627,10 +631,7 @@ PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
-SHELL
-sim_hw
-sim_hw_objs
-sim_hw_cflags'
+SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
@@ -1246,8 +1247,7 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-sim-hardware=LIST
- Specify the hardware to be included in the build.
+ --enable-sim-hardware Whether to enable hardware/device simulation
Report bugs to the package provider.
_ACEOF
@@ -1679,13 +1679,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-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'`"
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sim hardware settings" >&5
+$as_echo_n "checking for sim hardware settings... " >&6; }
# Check whether --enable-sim-hardware was given.
if test "${enable_sim_hardware+set}" = set; then :
enableval=$enable_sim_hardware;
@@ -1693,42 +1688,36 @@ else
enable_sim_hardware="yes"
fi
-case ${enable_sim_hardware} in
- yes|no) ;;
- ,*) hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";;
- *,) hardware="`echo ${enableval} | sed -e 's/,/ /'` ${hardware}";;
- *) hardware="`echo ${enableval} | sed -e 's/,/ /'`"'';;
-esac
-
+sim_hw_sockser=
if test "$enable_sim_hardware" = no; then
- sim_hw_objs=
sim_hw_cflags="-DWITH_HW=0"
- sim_hw=
-else
+elif test "$enable_sim_hardware" = yes; then
sim_hw_cflags="-DWITH_HW=1"
- # remove duplicates
- sim_hw=""
- sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
- for i in $hardware ; do
- case " $sim_hw " in
- *" $i "*) ;;
- *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
- esac
- done
# mingw does not support sockser
case ${host} in
*mingw*) ;;
*) # TODO: We don't add dv-sockser to sim_hw as it is not a "real" device
# that you instatiate. Instead, other code will call into it directly.
# At some point, we should convert it over.
- sim_hw_objs="$sim_hw_objs dv-sockser.o"
+ sim_hw_sockser="dv-sockser.o"
sim_hw_cflags="$sim_hw_cflags -DHAVE_DV_SOCKSER"
;;
esac
- if test x"$silent" != x"yes"; then
- echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
- fi
+else
+ as_fn_error $? "unknown argument \"$enable_sim_hardware\"" "$LINENO" 5
fi
+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
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enable_sim_hardware}" >&5
+$as_echo "${enable_sim_hardware}" >&6; }
+
@@ -1754,9 +1743,6 @@ ac_config_commands="$ac_config_commands stamp-h"
-
-
-
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
diff --git a/sim/m68hc11/configure.ac b/sim/m68hc11/configure.ac
index 02eccf0..99370b3 100644
--- a/sim/m68hc11/configure.ac
+++ b/sim/m68hc11/configure.ac
@@ -2,8 +2,4 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(Makefile.in)
AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
-dnl Options available in this module
-SIM_AC_OPTION_HARDWARE(\
- m68hc11 m68hc11sio m68hc11eepr m68hc11tim m68hc11spi nvram)
-
SIM_AC_OUTPUT