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 | %ifn %{defined Source0} |
---|
20 | Source0: http://ftp.rtems.org/ftp/pub/rtems/%{rtems_kernel_version}/rtems-%{rtems_kernel_version}.tar.bz2 |
---|
21 | %endif |
---|
22 | |
---|
23 | # |
---|
24 | # If C++ defined for the tool set use it to control RTEMS's setting.. |
---|
25 | # |
---|
26 | %ifn %{defined enable_cxx} |
---|
27 | %define rtems_cxx %{enable_cxx} |
---|
28 | %endif |
---|
29 | |
---|
30 | # |
---|
31 | # Default set up. |
---|
32 | # |
---|
33 | %ifn %{defined rtems_posix} |
---|
34 | %define rtems_posix 1 |
---|
35 | %endif |
---|
36 | %ifn %{defined rtems_networking} |
---|
37 | %define rtems_networking 1 |
---|
38 | %endif |
---|
39 | %ifn %{defined rtems_cxx} |
---|
40 | %define rtems_cxx 1 |
---|
41 | %endif |
---|
42 | %ifn %{defined rtems_tests} |
---|
43 | %define rtems_tests samples |
---|
44 | %endif |
---|
45 | |
---|
46 | %if %{rtems_tests} == disable |
---|
47 | %define rtems_tests_opt --disable-tests |
---|
48 | %else |
---|
49 | %define rtems_tests_opt --enable-tests=%{rtems_tests} |
---|
50 | %endif |
---|
51 | |
---|
52 | # |
---|
53 | # It the rtems_bsps is all undefine it |
---|
54 | # |
---|
55 | %if %{rtems_bsps} == all |
---|
56 | %undefine rtems_bsps |
---|
57 | %endif |
---|
58 | |
---|
59 | # |
---|
60 | # Prepare the source code. |
---|
61 | # |
---|
62 | %prep |
---|
63 | source_dir_0="rtems-%{rtems_kernel_version}" |
---|
64 | %setup -q -c -n %{name}-%{version} |
---|
65 | cd ${source_dir_0} |
---|
66 | %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}} |
---|
67 | %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}} |
---|
68 | %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}} |
---|
69 | %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}} |
---|
70 | %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}} |
---|
71 | %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}} |
---|
72 | %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}} |
---|
73 | %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}} |
---|
74 | %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}} |
---|
75 | %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}} |
---|
76 | %if %{rtems_bootstrap} |
---|
77 | ./bootstrap -c |
---|
78 | %{_sbdir}/sb-bootstrap --preinstall |
---|
79 | %{_sbdir}/sb-bootstrap |
---|
80 | %endif |
---|
81 | cd .. |
---|
82 | |
---|
83 | %build |
---|
84 | # Build directory support. |
---|
85 | if test "%{_build}" != "%{_host}" ; then |
---|
86 | build_dir="build-cxc" |
---|
87 | else |
---|
88 | build_dir="build" |
---|
89 | fi |
---|
90 | mkdir -p ${build_dir} |
---|
91 | cd ${build_dir} |
---|
92 | |
---|
93 | ../${source_dir_0}/configure \ |
---|
94 | --build=%{_build} --host=%{_host} \ |
---|
95 | --target=%{_target} \ |
---|
96 | %{?rtems_posix:--enable-posix}%{!?rtems_posix:--disable-posix} \ |
---|
97 | %{?rtems_networking:--enable-networking}%{!?rtems_networking:--disable-networking} \ |
---|
98 | %{?rtems_cxx:--enable-cxx}%{!?rtems_cxx:--disable-cxx} \ |
---|
99 | %{rtems_tests_opt} \ |
---|
100 | %{?rtems_bsps:--enable-rtemsbsp=%{rtems_bsps}} \ |
---|
101 | --prefix=%{_prefix} --bindir=%{_bindir} \ |
---|
102 | --exec-prefix=%{_exec_prefix} \ |
---|
103 | --includedir=%{_includedir} --libdir=%{_libdir} \ |
---|
104 | --mandir=%{_mandir} --infodir=%{_infodir} |
---|
105 | |
---|
106 | %{__make} %{?_smp_mflags} all |
---|
107 | cd .. |
---|
108 | |
---|
109 | %install |
---|
110 | %{__rmdir} $SB_BUILD_ROOT |
---|
111 | |
---|
112 | cd ${build_dir} |
---|
113 | %{__make} DESTDIR=$SB_BUILD_ROOT install |
---|
114 | |
---|
115 | cd .. |
---|
116 | |
---|
117 | %testing |
---|