sim: build: add var for tracking sim enable directly

Rather than rely on SIM_SUBDIRS being set, add a dedicated variable
to track whether to enable the sim.  While the current code works
fine, it won't work as we remove the recursive make logic (i.e. the
SIM_SUBDIRS variable).
This commit is contained in:
Mike Frysinger
2023-01-02 22:40:49 -05:00
parent 127d167a98
commit 7c9a934c4d
2 changed files with 69 additions and 34 deletions

35
sim/configure vendored
View File

@ -14247,6 +14247,7 @@ SIM_COMMON_BUILD_FALSE='#'
ac_config_files="$ac_config_files Make-common.sim:common/Make-common.in"
ENABLE_SIM=no
@ -14260,6 +14261,7 @@ if test "${enable_sim}" != no; then
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=aarch64
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " aarch64"
ac_config_files="$ac_config_files aarch64/Makefile.sim:aarch64/Makefile.in"
@ -14431,6 +14433,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=arm
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " arm"
ac_config_files="$ac_config_files arm/Makefile.sim:arm/Makefile.in"
@ -14475,6 +14478,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=avr
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " avr"
ac_config_files="$ac_config_files avr/Makefile.sim:avr/Makefile.in"
@ -14519,6 +14523,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=bfin
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " bfin"
ac_config_files="$ac_config_files bfin/Makefile.sim:bfin/Makefile.in"
@ -14563,6 +14568,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=bpf
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " bpf"
ac_config_files="$ac_config_files bpf/Makefile.sim:bpf/Makefile.in"
@ -14607,6 +14613,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=cr16
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " cr16"
ac_config_files="$ac_config_files cr16/Makefile.sim:cr16/Makefile.in"
@ -14651,6 +14658,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=cris
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " cris"
ac_config_files="$ac_config_files cris/Makefile.sim:cris/Makefile.in"
@ -14695,6 +14703,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=d10v
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " d10v"
ac_config_files="$ac_config_files d10v/Makefile.sim:d10v/Makefile.in"
@ -14739,6 +14748,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=frv
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " frv"
ac_config_files="$ac_config_files frv/Makefile.sim:frv/Makefile.in"
@ -14783,6 +14793,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=ft32
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " ft32"
ac_config_files="$ac_config_files ft32/Makefile.sim:ft32/Makefile.in"
@ -14827,6 +14838,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=h8300
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " h8300"
ac_config_files="$ac_config_files h8300/Makefile.sim:h8300/Makefile.in"
@ -14871,6 +14883,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=iq2000
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " iq2000"
ac_config_files="$ac_config_files iq2000/Makefile.sim:iq2000/Makefile.in"
@ -14915,6 +14928,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=lm32
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " lm32"
ac_config_files="$ac_config_files lm32/Makefile.sim:lm32/Makefile.in"
@ -14959,6 +14973,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=m32c
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " m32c"
ac_config_files="$ac_config_files m32c/Makefile.sim:m32c/Makefile.in"
@ -15003,6 +15018,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=m32r
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " m32r"
ac_config_files="$ac_config_files m32r/Makefile.sim:m32r/Makefile.in"
@ -15047,6 +15063,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=m68hc11
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " m68hc11"
ac_config_files="$ac_config_files m68hc11/Makefile.sim:m68hc11/Makefile.in"
@ -15091,6 +15108,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=mcore
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " mcore"
ac_config_files="$ac_config_files mcore/Makefile.sim:mcore/Makefile.in"
@ -15135,6 +15153,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=microblaze
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " microblaze"
ac_config_files="$ac_config_files microblaze/Makefile.sim:microblaze/Makefile.in"
@ -15179,6 +15198,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=mips
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " mips"
ac_config_files="$ac_config_files mips/Makefile.sim:mips/Makefile.in"
@ -15223,6 +15243,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=mn10300
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " mn10300"
ac_config_files="$ac_config_files mn10300/Makefile.sim:mn10300/Makefile.in"
@ -15267,6 +15288,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=moxie
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " moxie"
ac_config_files="$ac_config_files moxie/Makefile.sim:moxie/Makefile.in"
@ -15311,6 +15333,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=msp430
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " msp430"
ac_config_files="$ac_config_files msp430/Makefile.sim:msp430/Makefile.in"
@ -15355,6 +15378,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=or1k
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " or1k"
ac_config_files="$ac_config_files or1k/Makefile.sim:or1k/Makefile.in"
@ -15399,6 +15423,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=ppc
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " ppc"
@ -15442,6 +15467,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=pru
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " pru"
ac_config_files="$ac_config_files pru/Makefile.sim:pru/Makefile.in"
@ -15486,6 +15512,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=riscv
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " riscv"
ac_config_files="$ac_config_files riscv/Makefile.sim:riscv/Makefile.in"
@ -15530,6 +15557,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=rl78
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " rl78"
ac_config_files="$ac_config_files rl78/Makefile.sim:rl78/Makefile.in"
@ -15574,6 +15602,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=rx
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " rx"
ac_config_files="$ac_config_files rx/Makefile.sim:rx/Makefile.in"
@ -15618,6 +15647,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=sh
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " sh"
ac_config_files="$ac_config_files sh/Makefile.sim:sh/Makefile.in"
@ -15662,6 +15692,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=erc32
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " erc32"
ac_config_files="$ac_config_files erc32/Makefile.sim:erc32/Makefile.in"
@ -15706,6 +15737,7 @@ fi
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=v850
fi
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " v850"
ac_config_files="$ac_config_files v850/Makefile.sim:v850/Makefile.in"
@ -15757,6 +15789,7 @@ fi
as_fn_append SIM_TOOLCHAIN_VARS " AS_FOR_TARGET_EXAMPLE_SYNACOR LD_FOR_TARGET_EXAMPLE_SYNACOR CC_FOR_TARGET_EXAMPLE_SYNACOR"
ENABLE_SIM=yes
as_fn_append SIM_ENABLED_ARCHES " example-synacor"
ac_config_files="$ac_config_files example-synacor/Makefile.sim:example-synacor/Makefile.in"
@ -15787,7 +15820,7 @@ else
SIM_ENABLE_IGEN_FALSE=
fi
if test -n "$SIM_SUBDIRS"; then
if test "$ENABLE_SIM" = "yes"; then
ENABLE_SIM_TRUE=
ENABLE_SIM_FALSE='#'
else

View File

@ -63,10 +63,12 @@ AC_SUBST(SIM_COMMON_BUILD_TRUE)
AC_SUBST(SIM_COMMON_BUILD_FALSE)
AC_CONFIG_FILES(Make-common.sim:common/Make-common.in)
ENABLE_SIM=no
dnl Build a particular arch subdir.
dnl arg[1] is the arch subdir name.
dnl arg[2] is whether the arch has a dedicated configure script.
m4_define([SIM_BUILD_TARGET], [dnl
ENABLE_SIM=yes
AS_VAR_APPEND([SIM_ENABLED_ARCHES], [" $1"])
m4_if($2, [true], [dnl
AC_CONFIG_SUBDIRS($1)
@ -165,7 +167,7 @@ if test "${enable_sim}" != no; then
AM_CONDITIONAL([SIM_ENABLE_ARCH_examples], [test "${enable_example_sims}" = "yes"])
fi
AM_CONDITIONAL([SIM_ENABLE_IGEN], [test "$sim_igen" = "yes"])
AM_CONDITIONAL([ENABLE_SIM], [test -n "$SIM_SUBDIRS"])
AM_CONDITIONAL([ENABLE_SIM], [test "$ENABLE_SIM" = "yes"])
dnl Standard (and optional) simulator options.
dnl Eventually all simulators will support these.