summaryrefslogtreecommitdiffstats
path: root/rtems/config/rtems-bsp.cfg
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2019-07-06 19:20:09 +1000
committerChris Johns <chrisj@rtems.org>2019-07-21 21:09:34 +1000
commitc799e04a8fe85bf90d7f9dfe59298a696f4b0893 (patch)
tree82006becec36090a9647cc65d65215d8cdf2a490 /rtems/config/rtems-bsp.cfg
parent6: Update unstable RTEMS 6 tool chain (diff)
downloadrtems-source-builder-c799e04a8fe85bf90d7f9dfe59298a696f4b0893.tar.bz2
5/packages: Add curl and update all packages with RTEMS 5 and LibBSD
- Update rtems-bsp support to correctly handle hosts for BSP. - Clean up the options for a BSP. - Check all RTEMS 5 packages and add 5/rtems-packages for all that build. - Update download locations and checksum of all packages. - The work requires the kernel and Libbsd hacve the same prefix.
Diffstat (limited to 'rtems/config/rtems-bsp.cfg')
-rw-r--r--rtems/config/rtems-bsp.cfg83
1 files changed, 65 insertions, 18 deletions
diff --git a/rtems/config/rtems-bsp.cfg b/rtems/config/rtems-bsp.cfg
index 28d250f..8e1c12a 100644
--- a/rtems/config/rtems-bsp.cfg
+++ b/rtems/config/rtems-bsp.cfg
@@ -3,13 +3,21 @@
#
#
-# The RTEMS BSP support requires the host turple, the RTEMS BSP and the path to
+# The RTEMS BSP support requires the host tuple, the RTEMS BSP and the path to
# the tools. The prefix is set to an installed RTEMS. The built package is
# installed into the prefix.
#
# Keeping the package's installed path in the RTEMS install path and separate
-# to the tools lets the tools version vary independently. If --rtems-tools
-# (--with-tools) is not provided use the prefix.
+# to the tools lets the tools version vary independently.
+#
+# Provide the path to the RTEMS tools is not in the prefix with the
+# --with-tools option. If --with-tools is not provided use the prefix.
+#
+# Provide the path to the installed RTEMS kernel is not in the prefix with the
+# --with-rtems option. If --with-rtems is not provided use the prefix.
+#
+# Note, only a single path (--with-rtems) for the RTEMS kernel and any other
+# add on or 3rd party libraries is supported.
#
#
@@ -23,14 +31,24 @@
%define rtems_bsp_error 1
%endif
-%if %{_target} == %{nil} && %{rtems_bsp_error}
- %error No RTEMS target specified: --rtems-bsp=arch/bsp (or --target=target)
+#
+# The target is used by compilers or Cxc builds.
+#
+%if %{_target} != %{nil}
+ %error RTEMS BSP builds use --host and not --target
%endif
-%if %{_host} != %{_build}
- %error Canadian cross building for BSP is not supported.
+#
+# We need a host from the user to specifiy the RTEMS architecture and major
+# version.
+#
+%if %{_host} == %{nil} && %{rtems_bsp_error}
+ %error No RTEMS host or BSP specified: --host=<arch>-rtems<ver>
%endif
+#
+# We need a BSP from the user.
+#
%ifn %{defined with_rtems_bsp}
%if %{rtems_bsp_error}
%error No RTEMS BSP specified: --rtems-bsp=arch/bsp (or --with-rtems-bsp=bsp)
@@ -38,14 +56,16 @@
%define with_rtems_bsp sparc/erc32
%endif
+#
+# If no tools or RTEMS provided use the prefix.
+#
%ifn %{defined with_tools}
%define with_tools %{_prefix}
%endif
-#
-# Set the host to the target.
-#
-%define _host %{_target}
+%ifn %{defined with_rtems}
+ %define with_rtems %{_prefix}
+%endif
#
# Set the path to the tools.
@@ -57,21 +77,21 @@
# enable support when crosscompiling, and filter specific optimisation and
# warning from the flags that RTEMS exports.
#
-%{pkgconfig prefix %{_prefix}/lib/pkgconfig}
+%{pkgconfig prefix %{with_rtems}/lib/pkgconfig}
%{pkgconfig crosscompile yes}
%{pkgconfig filter-flags yes}
#
# The RTEMS BSP Flags
#
-%define rtems_bsp %{with_rtems_bsp}
-%define rtems_bsp_ccflags %{pkgconfig ccflags %{_host}-%{rtems_bsp}}
-%define rtems_bsp_cflags %{pkgconfig cflags %{_host}-%{rtems_bsp}}
-%define rtems_bsp_ldflags %{pkgconfig ldflags %{_host}-%{rtems_bsp}}
-%define rtems_bsp_libs %{pkgconfig libs %{_host}-%{rtems_bsp}}
+%define rtems_bsp %{with_rtems_bsp}
+%define rtems_bsp_ccflags %{pkgconfig ccflags %{_host}-%{rtems_bsp}}
+%define rtems_bsp_cflags %{pkgconfig cflags %{_host}-%{rtems_bsp}}
+%define rtems_bsp_ldflags %{pkgconfig ldflags %{_host}-%{rtems_bsp}}
+%define rtems_bsp_libs %{pkgconfig libs %{_host}-%{rtems_bsp}}
%if %{rtems_bsp_cflags} == %{nil} && %{rtems_bsp_error}
- %error No RTEMS target CFLAGS found; Please check the --rtems-bsp option.
+ %error No RTEMS BSP CFLAGS found; Please check the --rtems-bsp option.
%endif
%if %{rtems_bsp_ccflags} == %{nil}
@@ -79,6 +99,33 @@
%endif
#
+# RTEMS BSP paths
+#
+%define rtems_bsp_cc %{_host}-gcc
+%define rtems_bsp_incpath %{with_rtems}/%{_host}/%{rtems_bsp}/include
+%define rtems_bsp_libpath %{with_rtems}/%{_host}/%{rtems_bsp}/lib
+
+#
+# Check for installed libraries.
+#
+# - Check is LibBSD is install
+# - Add librtemsdefaultconfig so configure scripts work.
+#
+# Note: default BSP flags include the standard RTEMS libraries.
+#
+%define rtems-dep-check %(%{_sbdir}/sb/rtems-build-dep -c %{with_tools}/bin/%{rtems_bsp_cc}
+
+%define rtems-libbsd %{rtems-dep-check} -L %{rtems_bsp_libpath} -l libbsd.a)
+%if %{rtems-libbsd} == found
+ %define rtems_bsp_libs %{rtems_bsp_libs} -lbsd -lm -lz
+%endif
+
+%define rtems-defaultconfig %{rtems-dep-check} -L %{rtems_bsp_libpath} -l librtemsdefaultconfig.a)
+%if %{rtems-defaultconfig} == found
+ %define rtems_bsp_libs %{rtems_bsp_libs} -lrtemsdefaultconfig
+%endif
+
+#
# Update the configure paths to be BSP specific.
#
%define rtems_bsp_prefix %{_prefix}/%{_host}/%{rtems_bsp}