From c721249146a510a6746b37e7d731cb1467f91f48 Mon Sep 17 00:00:00 2001 From: Martin Erik Werner Date: Wed, 24 May 2023 20:13:10 +0200 Subject: 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. --- rtems.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'rtems.py') 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): -- cgit v1.2.3