summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Erik Werner <martinerikwerner.aac@gmail.com>2023-05-24 20:13:10 +0200
committerChris Johns <chris@contemporary.net.au>2023-05-25 08:47:12 +1000
commitc721249146a510a6746b37e7d731cb1467f91f48 (patch)
tree644788042b3936a36a37514f203fa3972c4c3465
parentParse includes in separate groups so isystem and sysroot paths and managed (diff)
downloadrtems_waf-c721249146a510a6746b37e7d731cb1467f91f48.tar.bz2
Allow vendor field in toolchain target triplet
Rework the splitting of arch and bsp to rely on the last field in the arch section starting with "rtems", instead of relying on the arch being exactly two fields in size. This makes sure that toolchains with a vendor field in their target triplet can be used with this build system. Toolchains produced by the RTEMS source builder tend to omit the vendor field, but for example the SPARC LEON/ERC32 toolchain provided by Gaisler through the RCC package does include a vendor field.
-rw-r--r--rtems.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/rtems.py b/rtems.py
index 0b24645..c65a7d2 100644
--- a/rtems.py
+++ b/rtems.py
@@ -858,11 +858,15 @@ def _check_arch_bsps(req, config, path, archs, version):
def _arch_from_arch_bsp(arch_bsp):
- return '-'.join(arch_bsp.split('-')[:2])
+ fields = arch_bsp.split('-')
+ rtems_field_index = next(i for i, field in enumerate(fields) if field.startswith('rtems'))
+ return '-'.join(fields[:(rtems_field_index + 1)])
def _bsp_from_arch_bsp(arch_bsp):
- return '-'.join(arch_bsp.split('-')[2:])
+ fields = arch_bsp.split('-')
+ rtems_field_index = next(i for i, field in enumerate(fields) if field.startswith('rtems'))
+ return '-'.join(fields[(rtems_field_index + 1):])
def _pkgconfig_path(path):