1 | # |
---|
2 | # RTEMS BSP Support |
---|
3 | # |
---|
4 | |
---|
5 | # |
---|
6 | # The RTEMS BSP support requires the host turple, 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. If --rtems-tools |
---|
12 | # (--with-tools) is not provided use the prefix. |
---|
13 | # |
---|
14 | |
---|
15 | %if %{_target} == %{nil} |
---|
16 | %error No RTEMS target specified: --rtems-bsp=arch/bsp (or --target=target) |
---|
17 | %endif |
---|
18 | |
---|
19 | %if %{_host} != %{_build} |
---|
20 | %error Canadian cross building for BSP is not supported. |
---|
21 | %endif |
---|
22 | |
---|
23 | %ifn %{defined with_rtems_bsp} |
---|
24 | %error No RTEMS BSP specified: --rtems-bsp=arch/bsp (or --with-rtems-bsp=bsp) |
---|
25 | %endif |
---|
26 | |
---|
27 | %ifn %{defined with_tools} |
---|
28 | %define with_tools %{_prefix} |
---|
29 | %endif |
---|
30 | |
---|
31 | # |
---|
32 | # Set the host to the target. |
---|
33 | # |
---|
34 | %define _host %{_target} |
---|
35 | |
---|
36 | # |
---|
37 | # Set the path to the tools. |
---|
38 | # |
---|
39 | %{path prepend %{with_tools}/bin} |
---|
40 | |
---|
41 | # |
---|
42 | # Set up how we manage pkgconfig. Set the prefix path to the RTEMS prefix, |
---|
43 | # enable support when crosscompiling, and filter specific optimisation and |
---|
44 | # warning from the flags that RTEMS exports. |
---|
45 | # |
---|
46 | %{pkgconfig prefix %{_prefix}/lib/pkgconfig} |
---|
47 | %{pkgconfig crosscompile yes} |
---|
48 | %{pkgconfig filter-flags yes} |
---|
49 | |
---|
50 | # |
---|
51 | # The RTEMS BSP Flags |
---|
52 | # |
---|
53 | %define rtems_bsp %{with_rtems_bsp} |
---|
54 | %define rtems_bsp_ccflags %{pkgconfig ccflags %{_host}-%{rtems_bsp}} |
---|
55 | %define rtems_bsp_cflags %{pkgconfig cflags %{_host}-%{rtems_bsp}} |
---|
56 | %define rtems_bsp_ldflags %{pkgconfig ldflags %{_host}-%{rtems_bsp}} |
---|
57 | %define rtems_bsp_libs %{pkgconfig libs %{_host}-%{rtems_bsp}} |
---|
58 | |
---|
59 | %if %{rtems_bsp_cflags} == %{nil} |
---|
60 | %error No RTEMS target CFLAGS found; Please check the --rtems-bsp option. |
---|
61 | %endif |
---|
62 | |
---|
63 | %if %{rtems_bsp_ccflags} == %{nil} |
---|
64 | %define rtems_bsp_ccflags %{rtems_bsp_cflags} |
---|
65 | %endif |
---|
66 | |
---|
67 | # |
---|
68 | # Map to names used for cross compiling. |
---|
69 | # |
---|
70 | %define host_cflags %{rtems_bsp_cflags} |
---|
71 | %define host_cxxflags %{rtems_bsp_ccflags} |
---|
72 | %define host_ldflags %{rtems_bsp_ldflags} |
---|
73 | %define host_libs %{rtems_bsp_libs} |
---|
74 | |
---|
75 | # |
---|
76 | # Update the configure paths to be BSP specific. |
---|
77 | # |
---|
78 | %define rtems_bsp_prefix %{_prefix}/%{_host}/%{rtems_bsp} |
---|
79 | %define _exec_prefix %{rtems_bsp_prefix} |
---|
80 | %define _bindir %{_exec_prefix}/bin |
---|
81 | %define _sbindir %{_exec_prefix}/sbin |
---|
82 | %define _libexecdir %{_exec_prefix}/libexec |
---|
83 | %define _datarootdir %{_exec_prefix}/share |
---|
84 | %define _datadir %{_datarootdir} |
---|
85 | %define _sysconfdir %{_exec_prefix}/etc |
---|
86 | %define _sharedstatedir %{_exec_prefix}/com |
---|
87 | %define _localstatedir %{_exec_prefix}/var |
---|
88 | %define _includedir %{_libdir}/include |
---|
89 | %define _lib lib |
---|
90 | %define _libdir %{_exec_prefix}/%{_lib} |
---|
91 | %define _libexecdir %{_exec_prefix}/libexec |
---|
92 | %define _mandir %{_datarootdir}/man |
---|
93 | %define _infodir %{_datarootdir}/info |
---|
94 | %define _localedir %{_datarootdir}/locale |
---|
95 | %define _localedir %{_datadir}/locale |
---|
96 | %define _localstatedir %{_exec_prefix}/var |
---|