1 | # |
---|
2 | # RTEMS 4.xx Version 1. |
---|
3 | # |
---|
4 | # This configuration file configure's, make's and install's RTEMS. |
---|
5 | # |
---|
6 | |
---|
7 | %include %{_configdir}/checks.cfg |
---|
8 | |
---|
9 | Name: %{_target}-kernel-%{rtems_kernel_version}-%{release} |
---|
10 | Summary: RTEMS v%{rtems_kernel_version} for target %{_target} on host %{_host} |
---|
11 | Version: %{rtems_kernel_version} |
---|
12 | Release: %{release} |
---|
13 | URL: http://www.rtems.org/ |
---|
14 | BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) |
---|
15 | |
---|
16 | # |
---|
17 | # Source |
---|
18 | # |
---|
19 | %if %{rsb_released} |
---|
20 | %if ! %{defined rtems_kernel_compression} |
---|
21 | %define rtems_kernel_compression xz |
---|
22 | %endif |
---|
23 | %source set rtems %{rtems_release_url}/%{rtems_kernel_version}/rtems-%{rtems_kernel_version}.tar.%{rtems_kernel_compression} |
---|
24 | %define rtems_bootstrap 0 |
---|
25 | %define without_release_url |
---|
26 | %else |
---|
27 | %if ! %{defined rtems_kernel_version} |
---|
28 | %define rtems_kernel_version HEAD |
---|
29 | %endif |
---|
30 | %if %{defined rtems_kernel_git_commit_hash} |
---|
31 | %define rtems_kernel_git_checkout ?checkout=%{defined rtems_kernel_git_commit_hash} |
---|
32 | %else |
---|
33 | %define rtems_kernel_git_checkout %{nil} |
---|
34 | %endif |
---|
35 | |
---|
36 | %source set rtems git://git.rtems.org/rtems.git?reset=hard?branch=%{rtems_kernel_version}?pull%{rtems_kernel_git_checkout} |
---|
37 | |
---|
38 | # |
---|
39 | # The code in git needs to be bootstrapped. Do each build because we have |
---|
40 | # no way to change what changes may have happened in the code. |
---|
41 | # |
---|
42 | %define rtems_bootstrap 1 |
---|
43 | %endif |
---|
44 | |
---|
45 | # |
---|
46 | # If C++ defined for the tool set use it to control RTEMS's setting.. |
---|
47 | # |
---|
48 | %if %{defined enable_cxx} |
---|
49 | %define rtems_cxx %{enable_cxx} |
---|
50 | %endif |
---|
51 | |
---|
52 | # |
---|
53 | # Default set up. |
---|
54 | # |
---|
55 | %ifn %{defined rtems_posix} |
---|
56 | %define rtems_posix 1 |
---|
57 | %endif |
---|
58 | %ifn %{defined rtems_networking} |
---|
59 | %define rtems_networking 1 |
---|
60 | %endif |
---|
61 | %ifn %{defined rtems_cxx} |
---|
62 | %define rtems_cxx 1 |
---|
63 | %endif |
---|
64 | %ifn %{defined rtems_tests} |
---|
65 | %define rtems_tests samples |
---|
66 | %endif |
---|
67 | |
---|
68 | %if %{rtems_tests} == disable |
---|
69 | %define rtems_tests_opt --disable-tests |
---|
70 | %else |
---|
71 | %define rtems_tests_opt --enable-tests=%{rtems_tests} |
---|
72 | %endif |
---|
73 | |
---|
74 | # |
---|
75 | # Check the various --with/--without options we support. |
---|
76 | # |
---|
77 | # --with-rtemsbsp : Supported, list of BSPs |
---|
78 | # --without-rtemsbsp: Not supported |
---|
79 | # --with-tests : Supported, samples/yes/no |
---|
80 | # --without-tests : Not supported |
---|
81 | # --with-smp : Supported |
---|
82 | # --without-smp : Not care |
---|
83 | # |
---|
84 | # |
---|
85 | %if %{defined without_rtemsbsp} |
---|
86 | %error Option --without-rtemsbsp is not supported. |
---|
87 | %endif |
---|
88 | %if %{defined without_rtems_tests} |
---|
89 | %define with_rtems_tests no |
---|
90 | %endif |
---|
91 | |
---|
92 | # |
---|
93 | # Prepare the source code. |
---|
94 | # |
---|
95 | %prep |
---|
96 | source_dir_rtems="rtems-%{rtems_kernel_version}" |
---|
97 | %source setup rtems -q -c -n %{name}-%{version} |
---|
98 | cd ${source_dir_rtems} |
---|
99 | %patch setup rtems -p1 |
---|
100 | %if %{rtems_bootstrap} |
---|
101 | %if %{defined _internal_autotools_path} |
---|
102 | export PATH="%{_internal_autotools_path}/bin:${PATH}" |
---|
103 | %endif |
---|
104 | ./bootstrap -c |
---|
105 | %{_sbdir}/sb-bootstrap --preinstall |
---|
106 | %{_sbdir}/sb-bootstrap |
---|
107 | %endif |
---|
108 | cd .. |
---|
109 | |
---|
110 | %build |
---|
111 | # Build directory support. |
---|
112 | if test "%{_build}" != "%{_host}" ; then |
---|
113 | build_dir="build-cxc" |
---|
114 | else |
---|
115 | build_dir="build" |
---|
116 | fi |
---|
117 | mkdir -p ${build_dir} |
---|
118 | cd ${build_dir} |
---|
119 | |
---|
120 | ../${source_dir_rtems}/configure \ |
---|
121 | --build=%{_build} --host=%{_host} \ |
---|
122 | --target=%{_target} \ |
---|
123 | %{?rtems_posix:--enable-posix}%{!?rtems_posix:--disable-posix} \ |
---|
124 | %{?rtems_networking:--enable-networking}%{!?rtems_networking:--disable-networking} \ |
---|
125 | %{?rtems_cxx:--enable-cxx}%{!?rtems_cxx:--disable-cxx} \ |
---|
126 | %{?with_rtems_tests:--enable-tests=%{with_rtems_tests}} \ |
---|
127 | %{?with_rtemsbsp:--enable-rtemsbsp="%{with_rtemsbsp}"} \ |
---|
128 | %{?with_rtems_smp:--enable-smp} \ |
---|
129 | --prefix=%{_prefix} --bindir=%{_bindir} \ |
---|
130 | --exec-prefix=%{_exec_prefix} \ |
---|
131 | --includedir=%{_includedir} --libdir=%{_libdir} \ |
---|
132 | --mandir=%{_mandir} --infodir=%{_infodir} |
---|
133 | |
---|
134 | %{__make} %{?_smp_mflags} all |
---|
135 | cd .. |
---|
136 | |
---|
137 | %install |
---|
138 | %{__rmdir} $SB_BUILD_ROOT |
---|
139 | |
---|
140 | cd ${build_dir} |
---|
141 | %{__make} DESTDIR=$SB_BUILD_ROOT install |
---|
142 | |
---|
143 | cd .. |
---|
144 | |
---|
145 | %testing |
---|