source: rtems-source-builder/rtems/config/tools/rtems-kernel-common.cfg @ 599c4d7

5
Last change on this file since 599c4d7 was df2a714, checked in by Chris Johns <chrisj@…>, on 11/17/19 at 21:59:47

rtems/kernel: Fix the git download extension for the kernel.

  • Property mode set to 100644
File size: 5.3 KB
Line 
1#
2# RTEMS Kernel.
3#
4# This configuration file configure's, make's and install's RTEMS.
5#
6
7#
8# If a dry-run and with download ignore errors and correct setting for tools
9# and BSPs. Only after the source to download.
10#
11%if %{_dry_run} && %{defined with_download}
12 %log Kenrel configuration errors ignored
13 %define rtems_kernel_error 0
14%else
15 %define rtems_kernel_error 1
16%endif
17
18%if %{rsb_released}
19 %define rtems_kernel_version %{rsb_version}
20%endif
21
22#
23# The target. It could be set in rtems_target.
24#
25%if %{defined rtems_target}
26 %define _target %{rtems_target}
27%endif
28%if %{_target} == %{nil} && %{rtems_kernel_error}
29 %error No RTEMS target specified: --target=<arch>-rtems<ver>.
30%endif
31
32#
33# The BSP.
34#
35%if !%{defined with_rtems_bsp} && %{rtems_kernel_error}
36 %error No RTEMS BSP specified: --with-rtems-bsp=bsp
37%endif
38%define rtems_bsp %{with_rtems_bsp}
39
40#
41# If no tools are provided use the prefix.
42#
43%ifn %{defined with_tools}
44 %define with_tools %{_prefix}
45%endif
46
47#
48# Set the path to the tools.
49#
50%{path prepend %{with_tools}/bin}
51
52#
53# Define the package.
54#
55package: rtems-%{rtems_version}-%{_target}-%{rtems_bsp}-%{_host}-%{release}
56
57#
58# Package details.
59#
60Name:    %{_target}-kernel-%{rtems_bsp}-%{release}
61Summary: RTEMS v%{rtems_kernel_version} for target %{_target} BSP %{rtems_bsp}
62Version: %{rtems_kernel_version}
63Release: %{release}
64URL:     https://www.rtems.org/
65
66%include %{_configdir}/checks.cfg
67%include %{_configdir}/base.cfg
68%include %{_configdir}/versions.cfg
69
70#
71# A magic internal path that would break if changes in the defaults.mc
72# macro file are made.
73#
74%define _internal_autotools_path %{_tmppath}/sb-%{_uid}/${SB_PREFIX_CLEAN}
75
76#
77# Check the version of autoconf. Check autoreconf as it is used.
78#
79%if %{__autoreconf_ver} <= 2.68
80 %if %{__autoreconf_bindir_ver} <= 2.68
81  %if %{__autoreconf_path_ver} <= 2.68
82   %error Autoconf (autoreconf) version 2.69 or higher is needed.
83  %endif
84 %endif
85%endif
86
87#
88# If no tools provided use the prefix.
89#
90%ifn %{defined with_tools}
91 %define with_tools %{_prefix}
92%endif
93
94#
95# Check options.
96#
97%if %{defined without_rtems_posix}
98 %define rtems_posix 0
99%endif
100
101%if %{defined with_rtems_legacy_network}
102 %define rtems_networking 1
103%endif
104
105%if %{defined with_rtems_cxx}
106 %define rtems_cxx 1
107%endif
108
109%if %{defined with_rtems_bspopts}
110 %define bspopts %{with_rtems_bspopts}
111%endif
112
113#
114# Source
115#
116%if %{rsb_released}
117 %define rtems_kernel_file rtems-%{rtems_kernel_version}.tar.xz
118 %define rtems_bootstrap 0
119%else
120 %define rtems_kernel_file rtems-kernel-%{rtems_kernel_version}.tar.bz2
121 #
122 # The code in git needs to be bootstrapped. Do each build because we have
123 # no way to change what changes may have happened in the code.
124 #
125 %define rtems_bootstrap 1
126%endif
127
128%if ! %{defined rtems_kernel_version}
129 %error No RTEMS kernel version defined
130%endif
131
132%source set rtems_kernel --rsb-file=%{rtems_kernel_file} \
133              https://git.rtems.org/rtems/snapshot/rtems-%{rtems_kernel_version}.tar.bz2
134
135# If C++ defined for the tool set use it to control RTEMS's setting..
136#
137%if %{defined enable_cxx}
138 %define rtems_cxx %{enable_cxx}
139%endif
140
141#
142# Default set up.
143#
144%ifn %{defined rtems_posix}
145 %define rtems_posix 1
146%endif
147%ifn %{defined rtems_networking}
148 %define rtems_networking 0
149%endif
150%ifn %{defined rtems_cxx}
151 %define rtems_cxx 0
152%endif
153%ifn %{defined rtems_tests}
154 %define rtems_tests samples
155%endif
156%ifn %{defined bspopts}
157 %define bspopts %{nil}
158%endif
159
160%if %{rtems_tests} == disable
161 %define rtems_tests_opt --disable-tests
162%else
163 %define rtems_tests_opt --enable-tests=%{rtems_tests}
164%endif
165
166#
167# Check the various --with/--without options we support.
168#
169# --target          : The architecture
170# --with-rtems-bsp  : The BSP
171# --with-tests      : Supported, samples/yes/no
172# --without-tests   : Not supported
173# --with-smp        : Supported
174# --without-smp     : Not care
175#
176#
177%if %{defined without_rtemsbsp}
178 %error Option --without-rtemsbsp is not supported.
179%endif
180%if %{defined without_rtems_tests}
181 %define with_rtems_tests no
182%endif
183
184#
185# Prepare the source code.
186#
187%prep
188  source_dir_rtems="rtems-%{rtems_kernel_version}"
189  %source setup rtems_kernel -q -c -n %{name}-%{version}
190  cd ${source_dir_rtems}
191  %patch setup rtems_kernel -p1
192  %if %{rtems_bootstrap}
193    %if %{defined _internal_autotools_path}
194      export PATH="%{_internal_autotools_path}/bin:${PATH}"
195    %endif
196    ./bootstrap -c
197    %{_sbdir}/sb-bootstrap --preinstall
198    %{_sbdir}/sb-bootstrap
199  %endif
200  cd ..
201
202%build
203  # Build directory support.
204  if test "%{_build}" != "%{_host}" ; then
205    build_dir="build-cxc"
206  else
207    build_dir="build"
208  fi
209  mkdir -p ${build_dir}
210  cd ${build_dir}
211
212  ../${source_dir_rtems}/configure \
213    --build=%{_build} --host=%{_host} \
214    --target=%{_target} \
215    --enable-rtemsbsp="%{rtems_bsp}" \
216    %{?rtems_posix:--enable-posix}%{!?rtems_posix:--disable-posix} \
217    %{?rtems_networking:--enable-networking}%{!?rtems_networking:--disable-networking} \
218    %{?rtems_cxx:--enable-cxx}%{!?rtems_cxx:--disable-cxx} \
219    %{?with_rtems_tests:--enable-tests=%{with_rtems_tests}} \
220    %{?with_rtems_smp:--enable-smp} \
221    --prefix=%{_prefix} --bindir=%{_bindir} \
222    --exec-prefix=%{_exec_prefix} \
223    --includedir=%{_includedir} --libdir=%{_libdir} \
224    --mandir=%{_mandir} --infodir=%{_infodir} \
225    %{bspopts}
226
227  %{__make} %{?_smp_mflags} all
228  cd ..
229
230%install
231  %{__rmdir} $SB_BUILD_ROOT
232
233  cd ${build_dir}
234  %{__make} DESTDIR=$SB_BUILD_ROOT install
235
236  cd ..
Note: See TracBrowser for help on using the repository browser.