summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2022-09-07 18:21:50 +1000
committerChris Johns <chrisj@rtems.org>2022-09-09 09:08:09 +1000
commite1f87e5d72e6161089ec143a0f2f07e9f84ae8ab (patch)
treea96deedca01b50562adeb66097804c5b0ed25fc7
parentsb/build.py: Output build scripts to trace (diff)
downloadrtems-source-builder-e1f87e5d72e6161089ec143a0f2f07e9f84ae8ab.tar.bz2
rtems/rtems-bsp: Support a kernel configuration file
- Support a single BSP defined in a kernel config file
-rw-r--r--rtems/config/rtems-bsp.cfg46
1 files changed, 31 insertions, 15 deletions
diff --git a/rtems/config/rtems-bsp.cfg b/rtems/config/rtems-bsp.cfg
index 801cd5c..4f9343a 100644
--- a/rtems/config/rtems-bsp.cfg
+++ b/rtems/config/rtems-bsp.cfg
@@ -40,28 +40,44 @@
%{pkgconfig filter-flags yes}
#
-# We need a host from the user to specifiy the RTEMS architecture and major
-# version. It can be defined in rtems_host.
+# We need a BSP from the user.
#
-%if %{defined rtems_host}
- %{triplet _host %{rtems_host}}
-%endif
-%if %{rtems_bsp_error}
- %if %{_host} == %{nil} || %{_host} == %{_build}
- %error No RTEMS host or BSP specified: --host=<arch>-rtems<ver>
+%if %{defined with_rtems_bsp_config}
+ %define rtems_bsp %(%{_sbdir}/sb/rtems-kernel-config-check \
+ -c %{with_rtems_bsp_config})
+%else
+ %ifn %{defined with_rtems_bsp}
+ %if %{rtems_bsp_error}
+ %error No RTEMS BSP specified: --with-rtems-bsp=bsp
+ %endif
+ %define with_rtems_bsp sparc/erc32
%endif
+ %define rtems_bsp %{with_rtems_bsp}
%endif
#
-# We need a BSP from the user.
+# Count the BSPs. Currently only one is supported
#
-%ifn %{defined with_rtems_bsp}
- %if %{rtems_bsp_error}
- %error No RTEMS BSP specified: --with-rtems-bsp=bsp
- %endif
- %define with_rtems_bsp sparc/erc32
+%define rtems_bsp_count %(echo %{rtems_bsp} | tr ' ' '\n' | wc -l)
+
+%if %{rtems_bsp_count} > 1
+ %error RTEMS packages do not support multiple BSP builds
+%endif
+
+#
+# Separate out the arch and bsp
+#
+%define rtems_arch %(echo %{rtems_bsp} | sed -e 's^\/.*^^g')
+%define rtems_bsp %(echo %{rtems_bsp} | sed -e 's^.*\/^^g')
+
+#
+# We need a host from the user to specifiy the RTEMS architecture and major
+# version. It can be defined in rtems_host.
+#
+%if !%{defined rtems_host}
+ %define rtems_host %{rtems_arch}-rtems%{rtems_version}
%endif
-%define rtems_bsp %{with_rtems_bsp}
+%{triplet _host %{rtems_host}}
#
# If no tools or RTEMS provided use the prefix. If staging use the staging