public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 3/3] sim: add preliminary support for --enable-targets
Date: Sun,  7 Mar 2021 22:33:20 -0500	[thread overview]
Message-ID: <20210308033320.29670-3-vapier@gentoo.org> (raw)
In-Reply-To: <20210308033320.29670-1-vapier@gentoo.org>

This doesn't actually create one `run` program like other projects,
but creates multiple `run-$arch` targets.  While it might not seem
that useful initially, this has some nice properties:
- Allows us to quickly build all sim targets in a single tree.
- Positions us better for converting targets over to a proper
  multitarget build+install.

We don't have the ability to actually run tests against them, but
that's due to a limitation in gas: it doesn't support multitarget.
If that ever changes, we should be able to turn on our tests too.
---
 sim/configure    | 232 ++++++++++++++++++++++++++++++++++++++++-------
 sim/configure.ac | 150 +++++++++++-------------------
 2 files changed, 252 insertions(+), 130 deletions(-)

diff --git a/sim/configure.ac b/sim/configure.ac
index 0a7b6884fabf..7727eb61988a 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -18,110 +18,64 @@ yes | no) ;;
 *)	AC_MSG_ERROR(bad value ${enableval} given for --enable-sim option) ;;
 esac])
 
+AC_ARG_ENABLE(targets,
+[  --enable-targets        alternative target configurations],
+[case "${enableval}" in
+  yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
+	    ;;
+  no)       enable_targets= ;;
+  *)        enable_targets=$enableval ;;
+esac])
+
+m4_define([SIM_TARGET], [
+  case "${targ}" in
+    all|$1)
+      AC_CONFIG_SUBDIRS($2)
+      $3
+      ;;
+  esac
+])
+
 dnl WHEN ADDING ENTRIES TO THIS MATRIX:
 dnl Make sure that the left side always has two dashes.  Otherwise you can get
 dnl spurious matches.  Even for unambiguous cases, do this as a convention, else
 dnl the table becomes a real mess to understand and maintain.
 if test "${enable_sim}" != no; then
   sim_igen=no
-  case "${target}" in
-    aarch64*-*-*)
-      AC_CONFIG_SUBDIRS(aarch64)
-      ;;
-    arm*-*-*)
-      AC_CONFIG_SUBDIRS(arm)
-      ;;
-    avr*-*-*)
-      AC_CONFIG_SUBDIRS(avr)
-      ;;
-    bfin-*-*)
-      AC_CONFIG_SUBDIRS(bfin)
-      ;;
-    bpf-*-*)
-      AC_CONFIG_SUBDIRS(bpf)
-      ;;
-    cr16*-*-*)
-      AC_CONFIG_SUBDIRS(cr16)
-      ;;
-    cris-*-* | crisv32-*-*)
-      AC_CONFIG_SUBDIRS(cris)
-      ;;
-    d10v-*-*)
-      AC_CONFIG_SUBDIRS(d10v)
-      ;;
-    frv-*-*)
-      AC_CONFIG_SUBDIRS(frv)
-      ;;
-    h8300*-*-*)
-      AC_CONFIG_SUBDIRS(h8300)
-      ;;
-    iq2000-*-*)
-      AC_CONFIG_SUBDIRS(iq2000)
-      ;;
-    lm32-*-*)
-      AC_CONFIG_SUBDIRS(lm32)
-      ;;
-    m32c-*-*)
-      AC_CONFIG_SUBDIRS(m32c)
-      ;;
-    m32r-*-*)
-      AC_CONFIG_SUBDIRS(m32r)
-      ;;
-    m68hc11-*-*|m6811-*-*)
-      AC_CONFIG_SUBDIRS(m68hc11)
-      ;;
-    mcore-*-*)
-      AC_CONFIG_SUBDIRS(mcore)
-      ;;
-    microblaze-*-*)
-      AC_CONFIG_SUBDIRS(microblaze)
-      ;;
-    mips*-*-*)
-      AC_CONFIG_SUBDIRS(mips)
-      sim_igen=yes
-      ;;
-    mn10300*-*-*)
-      AC_CONFIG_SUBDIRS(mn10300)
-      sim_igen=yes
-      ;;
-    moxie-*-*)
-      AC_CONFIG_SUBDIRS(moxie)
-      ;;
-    msp430*-*-*)
-      AC_CONFIG_SUBDIRS(msp430)
-      ;;
-    or1k-*-* | or1knd-*-*)
-      AC_CONFIG_SUBDIRS(or1k)
-      ;;
-    pru*-*-*)
-      AC_CONFIG_SUBDIRS(pru)
-      ;;
-    riscv*-*-*)
-      AC_CONFIG_SUBDIRS(riscv)
-      ;;
-    rl78-*-*)
-      AC_CONFIG_SUBDIRS(rl78)
-      ;;
-    rx-*-*)
-      AC_CONFIG_SUBDIRS(rx)
-      ;;
-    sh*-*-*)
-      AC_CONFIG_SUBDIRS(sh)
-      ;;
-    sparc-*-rtems*|sparc-*-elf*)
-      AC_CONFIG_SUBDIRS(erc32)
-      ;;
-    powerpc*-*-*)
-      AC_CONFIG_SUBDIRS(ppc)
-      ;;
-    ft32-*-*)
-      AC_CONFIG_SUBDIRS(ft32)
-      ;;
-    v850*-*-*)
-      AC_CONFIG_SUBDIRS(v850)
-      sim_igen=yes
-      ;;
-  esac
+  for targ in `echo $target $enable_targets | sed 's/,/ /g'`
+  do
+    SIM_TARGET([aarch64*-*-*], [aarch64])
+    SIM_TARGET([arm*-*-*], [arm])
+    SIM_TARGET([avr*-*-*], [avr])
+    SIM_TARGET([bfin-*-*], [bfin])
+    SIM_TARGET([bpf-*-*], [bpf])
+    SIM_TARGET([cr16*-*-*], [cr16])
+    SIM_TARGET([cris-*-* | crisv32-*-*], [cris])
+    SIM_TARGET([d10v-*-*], [d10v])
+    SIM_TARGET([frv-*-*], [frv])
+    SIM_TARGET([h8300*-*-*], [h8300])
+    SIM_TARGET([iq2000-*-*], [iq2000])
+    SIM_TARGET([lm32-*-*], [lm32])
+    SIM_TARGET([m32c-*-*], [m32c])
+    SIM_TARGET([m32r-*-*], [m32r])
+    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([moxie-*-*], [moxie])
+    SIM_TARGET([msp430*-*-*], [msp430])
+    SIM_TARGET([or1k-*-* | or1knd-*-*], [or1k])
+    SIM_TARGET([pru*-*-*], [pru])
+    SIM_TARGET([riscv*-*-*], [riscv])
+    SIM_TARGET([rl78-*-*], [rl78])
+    SIM_TARGET([rx-*-*], [rx])
+    SIM_TARGET([sh*-*-*], [sh])
+    SIM_TARGET([sparc-*-rtems*|sparc-*-elf*], [erc32])
+    SIM_TARGET([powerpc*-*-*], [ppc])
+    SIM_TARGET([ft32-*-*], [ft32])
+    SIM_TARGET([v850*-*-*], [v850], [sim_igen=yes])
+  done
 fi
 AM_CONDITIONAL([SIM_ENABLE_IGEN], [test "$sim_igen" = "yes"])
 
-- 
2.30.0


  parent reply	other threads:[~2021-03-08  3:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08  3:33 [PATCH 1/3] sim: unify toolchain settings Mike Frysinger
2021-03-08  3:33 ` [PATCH 2/3] sim: igen: merge build into top level Mike Frysinger
2021-03-08  3:33 ` Mike Frysinger [this message]
2021-03-13 17:24 ` [PATCH v2 1/3] sim: unify toolchain settings Mike Frysinger
2021-03-13 17:24   ` [PATCH v2 2/3] sim: igen: merge build into top level Mike Frysinger
2021-03-13 17:24   ` [PATCH v2 3/3] sim: add preliminary support for --enable-targets Mike Frysinger
2021-03-14  2:09   ` [PATCH] sim: testsuite: integrate common tests into build Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210308033320.29670-3-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).