[RSB 5 PATCH 5/6] rtems/kernel: Support deployment standard buildset configs
chrisj at rtems.org
chrisj at rtems.org
Sun Sep 18 01:51:26 UTC 2022
From: Chris Johns <chrisj at rtems.org>
- Check and optionally support arch/bsp format 'with_rtems_bsp' defines
Updates #4717
---
rtems/config/tools/rtems-kernel-common.cfg | 49 +++++++++++++++++-----
1 file changed, 39 insertions(+), 10 deletions(-)
diff --git a/rtems/config/tools/rtems-kernel-common.cfg b/rtems/config/tools/rtems-kernel-common.cfg
index 3a17a28..ea2e0ac 100644
--- a/rtems/config/tools/rtems-kernel-common.cfg
+++ b/rtems/config/tools/rtems-kernel-common.cfg
@@ -19,6 +19,43 @@
%define rtems_kernel_version %{rsb_version}
%endif
+#
+# The BSP.
+#
+%if !%{defined with_rtems_bsp} && %{rtems_kernel_error}
+ %error No RTEMS BSP specified: --with-rtems-bsp=bsp
+%endif
+%define rtems_bsp %{with_rtems_bsp}
+
+#
+# If the BSP(s) have a '/' it is the arch/bsp notation.
+#
+%define is_arch_bsp %(echo %{rtems_bsp} | sed -e 's/.*\/.*/yes/g')
+%if %{is_arch_bsp} == yes
+ %define rtems_ab_bsps \
+ %(x=''; \
+ for b in %{rtems_bsp}; do x="$x "$(echo $b | sed -e 's/.*\///g'); done; \
+ echo $x)
+ %define rtems_ab_archs \
+ %(x=''; \
+ for b in %{rtems_bsp}; do x="$x "$(echo $b | sed -e 's/\/.*//g'); done; \
+ echo $x | tr ' ' '\n' | sort | uniq)
+ %define rtems_arch_count %(echo %{rtems_ab_archs} | tr ' ' '\n' | wc -l)
+ %if %{rtems_arch_count} != 1
+ %error Invalid BSP architecture count
+ %endif
+ %define rtems_bsp %{rtems_ab_bsps}
+ %define rtems_target %{rtems_ab_archs}-rtems%{rtems_version}
+ %define rtems_host %{rtems_target}
+%endif
+
+%define rtems_bsp_count %(echo %{rtems_bsp} | tr ' ' '\n' | wc -l)
+%if %{rtems_bsp_count} == 1
+ %define rtems_bsp_pkgname %{rtems_bsp}
+%else
+ %define rtems_bsp_pkgname bsps
+%endif
+
#
# The target. It could be set in rtems_target.
#
@@ -29,14 +66,6 @@
%error No RTEMS target specified: --target=<arch>-rtems<ver>.
%endif
-#
-# The BSP.
-#
-%if !%{defined with_rtems_bsp} && %{rtems_kernel_error}
- %error No RTEMS BSP specified: --with-rtems-bsp=bsp
-%endif
-%define rtems_bsp %{with_rtems_bsp}
-
#
# If no tools are provided use the prefix.
#
@@ -52,12 +81,12 @@
#
# Define the package.
#
-package: rtems-%{rtems_version}-%{_target}-%{rtems_bsp}-%{_host}-%{release}
+package: rtems-%{rtems_version}-%{_target}-%{rtems_bsp_pkgname}-%{_host}-%{release}
#
# Package details.
#
-Name: %{_target}-kernel-%{rtems_bsp}-%{release}
+Name: %{_target}-kernel-%{rtems_bsp_pkgname}-%{release}
Summary: RTEMS v%{rtems_kernel_version} for target %{_target} BSP %{rtems_bsp}
Version: %{rtems_kernel_version}
Release: %{release}
--
2.37.1
More information about the devel
mailing list