source: rtems-source-builder/rtems/config/rtems-bsp.cfg

Last change on this file was 53dd2ee, checked in by Chris Johns <chrisj@…>, on Oct 27, 2019 at 7:23:37 AM

rtems/bsps: Do not raise an error if no cflags when getting source.

  • Property mode set to 100644
File size: 6.8 KB
Line 
1#
2# RTEMS BSP Support
3#
4
5#
6# The RTEMS BSP support requires the host tuple, the RTEMS BSP and the path to
7# the tools. The prefix is set to an installed RTEMS. The built package is
8# installed into the prefix.
9#
10# Keeping the package's installed path in the RTEMS install path and separate
11# to the tools lets the tools version vary independently.
12#
13# Provide the path to the RTEMS tools is not in the prefix with the
14# --with-tools option. If --with-tools is not provided use the prefix.
15#
16# Provide the path to the installed RTEMS kernel is not in the prefix with the
17# --with-rtems option. If --with-rtems is not provided use the prefix.
18#
19# Note, only a single path (--with-rtems) for the RTEMS kernel and any other
20# add on or 3rd party libraries is supported.
21#
22
23#
24# If a dry-run and with download ignore errors and correct setting for tools
25# and BSPs. Only after the source to download.
26#
27%if %{_dry_run}
28 %log BSP configuration errors ignored
29 %define rtems_bsp_error 0
30%else
31 %define rtems_bsp_error 1
32%endif
33
34#
35# We need a host from the user to specifiy the RTEMS architecture and major
36# version. It can be defined in rtems_host.
37#
38%if %{defined rtems_host}
39 %{triplet _host %{rtems_host}}
40%endif
41%if %{rtems_bsp_error}
42 %if %{_host} == %{nil} || %{_host} == %{_build}
43  %error No RTEMS host or BSP specified: --host=<arch>-rtems<ver>
44 %endif
45%endif
46
47#
48# We need a BSP from the user.
49#
50%ifn %{defined with_rtems_bsp}
51 %if %{rtems_bsp_error}
52  %error No RTEMS BSP specified: --with-rtems-bsp=bsp
53 %endif
54 %define with_rtems_bsp sparc/erc32
55%endif
56%define rtems_bsp %{with_rtems_bsp}
57
58#
59# If no tools or RTEMS provided use the prefix. If staging use the staging
60# root.
61#
62%ifn %{defined with_tools}
63 %if %{install_mode} == staging
64  %define with_tools %{stagingroot}
65  %define rtems_waf_tools --rtems-tools=%{with_tools}
66 %else
67  %define with_tools %{_prefix}
68  %define rtems_waf_tools %{nil}
69 %endif
70%else
71 %define rtems_waf_tools --rtems-tools=%{with_tools}
72%endif
73
74%ifn %{defined with_rtems}
75 %if %{install_mode} == staging
76  %define with_rtems %{stagingroot}
77  %define rtems_waf_rtems --rtems=%{with_rtems}
78 %else
79  %define with_rtems %{_prefix}
80  %define rtems_waf_rtems %{nil}
81 %endif
82%else
83 %define rtems_waf_rtems --rtems=%{with_rtems}
84%endif
85
86#
87# Set the path to the tools.
88#
89%{path prepend %{with_tools}/bin}
90
91#
92# Update the configure paths to be BSP specific.
93#
94%define rtems_bsp_prefix  %{_prefix}/%{_host}/%{rtems_bsp}
95%define _exec_prefix      %{rtems_bsp_prefix}
96%define _bindir           %{_exec_prefix}/bin
97%define _sbindir          %{_exec_prefix}/sbin
98%define _libexecdir       %{_exec_prefix}/libexec
99%define _datarootdir      %{_exec_prefix}/share
100%define _datadir          %{_datarootdir}
101%define _sysconfdir       %{_exec_prefix}/etc
102%define _sharedstatedir   %{_exec_prefix}/com
103%define _localstatedir    %{_exec_prefix}/var
104%define _includedir       %{_libdir}/include
105%define _lib              lib
106%define _libdir           %{_exec_prefix}/%{_lib}
107%define _libexecdir       %{_exec_prefix}/libexec
108%define _mandir           %{_datarootdir}/man
109%define _infodir          %{_datarootdir}/info
110%define _localedir        %{_datarootdir}/locale
111%define _localedir        %{_datadir}/locale
112%define _localstatedir    %{_exec_prefix}/var
113
114#
115# Set up how we manage pkgconfig. Set the prefix path to the RTEMS prefix,
116# enable support when crosscompiling, and filter specific optimisation and
117# warning from the flags that RTEMS exports.
118#
119%{pkgconfig prefix %{with_rtems}/lib/pkgconfig}
120%{pkgconfig crosscompile yes}
121%{pkgconfig filter-flags yes}
122
123#
124# The RTEMS BSP Flags
125#
126%define rtems_bsp_includes -I%{_includedir}
127%define rtems_bsp_ccflags  %{pkgconfig ccflags %{_host}-%{rtems_bsp}}
128%define rtems_bsp_cflags   %{pkgconfig cflags  %{_host}-%{rtems_bsp}}
129%define rtems_bsp_ldflags  %{pkgconfig ldflags %{_host}-%{rtems_bsp}}
130%define rtems_bsp_libs     %{pkgconfig libs    %{_host}-%{rtems_bsp}}
131
132%if %{rtems_bsp_cflags} == %{nil} && %{rtems_bsp_error} && !%{_rsb_getting_source}
133 %error No RTEMS BSP CFLAGS found; Please check the --with-rtems-bsp option.
134%endif
135
136#
137# C++ flags are the C flags.
138#
139%if %{rtems_bsp_ccflags} == %{nil}
140 %define rtems_bsp_ccflags %{rtems_bsp_cflags}
141%endif
142
143#
144# If there are no LDFLAGS create a path to RTEMS.
145#
146%if %{rtems_bsp_ldflags} == %{nil}
147 %define rtems_bsp_ldflags -L%{rtems_bsp_prefix}/lib
148%endif
149
150#
151# Support for RTEMS's Makefile.inc support.
152#
153%define rtems_bsp_makefile_inc %{rtems_bsp_prefix}
154%define rtems_bsp_rtems_root   %{_prefix}
155
156#
157# Filter the flags converting any prefix to the staging path if this is a
158# staging build.
159#
160%if %{install_mode} == staging
161 %define staging_filter sed -e 's|%{_prefix}|%{stagingroot}|g'
162 %define rtems_bsp_prefix     $(echo %{rtems_bsp_prefix}   | %{staging_filter})
163 %define rtems_bsp_includes   $(echo %{rtems_bsp_includes} | %{staging_filter})
164 %define rtems_bsp_ccflags    $(echo %{rtems_bsp_ccflags}  | %{staging_filter})
165 %define rtems_bsp_cflags     $(echo %{rtems_bsp_cflags}   | %{staging_filter})
166 %define rtems_bsp_ldflags    $(echo %{rtems_bsp_ldflags}  | %{staging_filter})
167 %define rtems_bsp_rtems_root %{stagingroot}
168%endif
169
170%if %{rtems_bsp_ccflags} == %{nil}
171 %define rtems_bsp_ccflags %{rtems_bsp_cflags}
172%endif
173
174#
175# The RTEMS BSP architecture/bsp.
176#
177%define rtems_bsp_arch_bsp %{_host_arch}/%{rtems_bsp}
178
179#
180# RTEMS BSP paths
181#
182%define rtems_bsp_cc      %{_host}-gcc
183%define rtems_bsp_cxx     %{_host}-g++
184%define rtems_bsp_incpath %{with_rtems}/%{_host}/%{rtems_bsp}/include
185%define rtems_bsp_libpath %{with_rtems}/%{_host}/%{rtems_bsp}/lib
186
187#
188# Check for installed libraries.
189#
190# - Check is LibBSD is install
191# - Add librtemsdefaultconfig so configure scripts work.
192#
193# Note: default BSP flags include the standard RTEMS libraries.
194#
195%define rtems-dep-check %(%{_sbdir}/sb/rtems-build-dep -c %{with_tools}/bin/%{rtems_bsp_cc}
196
197%define rtems-libbsd %{rtems-dep-check} -L %{rtems_bsp_libpath} -l libbsd.a)
198%if %{rtems-libbsd} == found
199 %define rtems_bsp_libs %{rtems_bsp_libs} -lbsd -lm -lz
200%endif
201
202%define rtems-defaultconfig %{rtems-dep-check} -L %{rtems_bsp_libpath} -l librtemsdefaultconfig.a)
203%if %{rtems-defaultconfig} == found
204 %define rtems_bsp_libs %{rtems_bsp_libs} -lrtemsdefaultconfig
205%endif
206
207#
208# The linker flags need to include the machine options for the BSP.
209#
210%define mflags_filter  awk '{for (i=1;i<NF;++i) if ($i ~ /\-m/) printf("%s ",$i);}'
211%define rtems_bsp_ldflags %{rtems_bsp_ldflags} $(echo "%{rtems_bsp_cflags}" | %{mflags_filter})
212
213#
214# Map to names used for cross compiling.
215#
216%define host_cc       %{rtems_bsp_cc}
217%define host_cxx      %{rtems_bsp_cxx}
218%define host_includes %{rtems_bsp_includes}
219%define host_cflags   %{rtems_bsp_cflags}
220%define host_cxxflags %{rtems_bsp_ccflags}
221%define host_ldflags  %{rtems_bsp_ldflags}
222%define host_libs     %{rtems_bsp_libs}
223
224#
225# Handle the Waf install root.
226#
227%ifos win32 mingw ming32
228 %define rtems_waf_build_root_suffix %{waf_build_root_suffix}
229%else
230 %define rtems_waf_build_root_suffix %{nil}
231%endif
Note: See TracBrowser for help on using the repository browser.