sim: igen: simplify build logic a little

Message ID 20230115031017.28159-1-vapier@gentoo.org
State Committed
Headers
Series sim: igen: simplify build logic a little |

Commit Message

Mike Frysinger Jan. 15, 2023, 3:10 a.m. UTC
  Now that all ports (that use igen) build in the top-level and depend
on igen, we can move the conditional logic out of configure.  We also
switch from noinst_LIBRARIES to EXTRA_LIBRARIES so that the library
is only built when needed (i.e. the igen tool is used).
---
 sim/Makefile.am   |   3 +-
 sim/Makefile.in   | 564 ++++++++++++++++++++++------------------------
 sim/configure     |  50 +---
 sim/configure.ac  |  10 +-
 sim/igen/local.mk |   2 +-
 5 files changed, 275 insertions(+), 354 deletions(-)
  

Patch

diff --git a/sim/Makefile.am b/sim/Makefile.am
index 0e9fc3c67a9e..3693eb18d496 100644
--- a/sim/Makefile.am
+++ b/sim/Makefile.am
@@ -33,6 +33,7 @@  SIM_PRIMARY_TARGET = @SIM_PRIMARY_TARGET@
 pkginclude_HEADERS =
 check_PROGRAMS =
 noinst_PROGRAMS =
+EXTRA_LIBRARIES =
 noinst_LIBRARIES =
 EXTRA_PROGRAMS =
 BUILT_SOURCES =
@@ -101,9 +102,7 @@  SIM_COMPILE = \
 	$(am__mv) $(SIM_DEPBASE).Tpo $(SIM_DEPBASE).Po
 
 include common/local.mk
-if SIM_ENABLE_IGEN
 include igen/local.mk
-endif
 include testsuite/local.mk
 
 ## Arch includes must come after common/local.mk.
diff --git a/sim/configure.ac b/sim/configure.ac
index b4ea1e7de9b6..ecda34a6b3fc 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -68,7 +68,6 @@  dnl Enable a particular arch subdir.
 dnl arg[1] is the matching target triple.
 dnl arg[2] is the arch subdir name.
 dnl arg[3] is whether the arch has a dedicated configure script.
-dnl arg[4] is any additional shell code to run for this arch.
 m4_define([SIM_TARGET], [dnl
   sim_enable_arch_$2=false
   case "${targ}" in
@@ -78,7 +77,6 @@  m4_define([SIM_TARGET], [dnl
       fi
       SIM_BUILD_TARGET($2, $3)
       sim_enable_arch_$2=true
-      $4
       ;;
   esac
   SIM_AC_TOOLCHAIN_FOR_TARGET($2)
@@ -93,7 +91,6 @@  dnl
 dnl NB: Target matching is aligned with gdb/configure.tgt.  Changes must be kept
 dnl in sync with that file.
 if test "${enable_sim}" != no; then
-  sim_igen=no
   for targ in `echo $target $enable_targets | sed 's/,/ /g'`
   do
     SIM_TARGET([aarch64*-*-*], [aarch64])
@@ -114,8 +111,8 @@  if test "${enable_sim}" != no; then
     SIM_TARGET([m68hc11-*-*|m6811-*-*], [m68hc11])
     SIM_TARGET([mcore-*-*], [mcore])
     SIM_TARGET([microblaze*-*-*], [microblaze])
-    SIM_TARGET([mips*-*-*], [mips], [], [sim_igen=yes])
-    SIM_TARGET([mn10300*-*-*], [mn10300], [], [sim_igen=yes])
+    SIM_TARGET([mips*-*-*], [mips])
+    SIM_TARGET([mn10300*-*-*], [mn10300])
     SIM_TARGET([moxie-*-*], [moxie])
     SIM_TARGET([msp430*-*-*], [msp430])
     SIM_TARGET([or1k*-*-*], [or1k])
@@ -126,7 +123,7 @@  if test "${enable_sim}" != no; then
     SIM_TARGET([rx-*-*], [rx])
     SIM_TARGET([sh*-*-*], [sh])
     SIM_TARGET([sparc-*-*], [erc32])
-    SIM_TARGET([v850*-*-*], [v850], [], [sim_igen=yes])
+    SIM_TARGET([v850*-*-*], [v850])
   done
 
   if test "x${enable_example_sims}" = xyes; then
@@ -135,7 +132,6 @@  if test "${enable_sim}" != no; then
   fi
   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 "$ENABLE_SIM" = "yes"])
 
 dnl Standard (and optional) simulator options.
diff --git a/sim/igen/local.mk b/sim/igen/local.mk
index 0126a2cdb7eb..75b9cebd8f7b 100644
--- a/sim/igen/local.mk
+++ b/sim/igen/local.mk
@@ -27,7 +27,7 @@  IGEN_RUN = ASAN_OPTIONS=detect_leaks=0 $(IGEN) $(IGEN_FLAGS_SMP)
 # Alias for developers.
 igen: $(IGEN)
 
-noinst_LIBRARIES += %D%/libigen.a
+EXTRA_LIBRARIES += %D%/libigen.a
 %C%_libigen_a_SOURCES = \
 	%D%/table.c \
 	%D%/lf.c \