1 | # |
---|
2 | # Please send bugfixes or comments to |
---|
3 | # http://www.rtems.org/bugzilla |
---|
4 | # |
---|
5 | |
---|
6 | |
---|
7 | %ifos cygwin cygwin32 mingw mingw32 |
---|
8 | %define _exeext .exe |
---|
9 | %define debug_package %{nil} |
---|
10 | %define _libdir %{_exec_prefix}/lib |
---|
11 | %else |
---|
12 | %define _exeext %{nil} |
---|
13 | %endif |
---|
14 | |
---|
15 | %ifos cygwin cygwin32 |
---|
16 | %define optflags -O3 -pipe -march=i486 -funroll-loops |
---|
17 | %endif |
---|
18 | |
---|
19 | %ifos mingw mingw32 |
---|
20 | %if %{defined _mingw32_cflags} |
---|
21 | %define optflags %{_mingw32_cflags} |
---|
22 | %else |
---|
23 | %define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields |
---|
24 | %endif |
---|
25 | %endif |
---|
26 | |
---|
27 | %if "%{_build}" != "%{_host}" |
---|
28 | %define _host_rpmprefix %{_host}- |
---|
29 | %else |
---|
30 | %define _host_rpmprefix %{nil} |
---|
31 | %endif |
---|
32 | |
---|
33 | |
---|
34 | %define gcc_pkgvers 4.5.2 |
---|
35 | %define gcc_version 4.5.2 |
---|
36 | %define gcc_rpmvers %{expand:%(echo "4.5.2" | tr - _ )} |
---|
37 | |
---|
38 | |
---|
39 | Name: i386-pc-netbsdelf5.1-gcc |
---|
40 | Summary: i386-pc-netbsdelf5.1 gcc |
---|
41 | |
---|
42 | Group: Development/Tools |
---|
43 | Version: %{gcc_rpmvers} |
---|
44 | Release: 0.20110321.1%{?dist} |
---|
45 | License: GPL |
---|
46 | URL: http://gcc.gnu.org |
---|
47 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
48 | |
---|
49 | %define _use_internal_dependency_generator 0 |
---|
50 | |
---|
51 | BuildRequires: %{_host_rpmprefix}gcc |
---|
52 | |
---|
53 | # FIXME: Disable lto for now, to avoid dependencies on libelf |
---|
54 | %bcond_with lto |
---|
55 | |
---|
56 | # FIXME: Disable python gdb scripts |
---|
57 | # ATM, no idea how to package them |
---|
58 | %bcond_with pygdb |
---|
59 | |
---|
60 | # FIXME: Disable GCC-plugin |
---|
61 | # Bug in gcc-4.5-20100318, doesn't build them on x86_84 hosts. |
---|
62 | %bcond_with plugin |
---|
63 | |
---|
64 | # EXPERIMENTAL: Use gcc's stdint.h instead of newlib's |
---|
65 | # Should be applicable to gcc >= 4.5.0 |
---|
66 | %bcond_with gcc_stdint |
---|
67 | |
---|
68 | # versions of libraries, we conditionally bundle if necessary |
---|
69 | %global mpc_version 0.8.1 |
---|
70 | %global mpfr_version 2.4.2 |
---|
71 | %global gmp_version 4.3.2 |
---|
72 | %global libelf_version 0.8.13 |
---|
73 | |
---|
74 | # versions of libraries these distros are known to ship |
---|
75 | %if 0%{?fc15} |
---|
76 | %global mpc_provided 0.8.3 |
---|
77 | %global mpfr_provided 3.0.0 |
---|
78 | %global gmp_provided 4.3.2 |
---|
79 | %endif |
---|
80 | |
---|
81 | %if 0%{?fc14} |
---|
82 | %global mpc_provided 0.8.1 |
---|
83 | %global mpfr_provided 2.4.2 |
---|
84 | %global gmp_provided 4.3.1 |
---|
85 | %endif |
---|
86 | |
---|
87 | %if 0%{?fc13} |
---|
88 | %global mpc_provided 0.8.1 |
---|
89 | %global mpfr_provided 2.4.2 |
---|
90 | %global gmp_provided 4.3.1 |
---|
91 | %endif |
---|
92 | |
---|
93 | %if 0%{?el6} |
---|
94 | %global mpc_provided %{nil} |
---|
95 | %global mpfr_provided 2.4.1 |
---|
96 | %global gmp_provided 4.3.1 |
---|
97 | %endif |
---|
98 | |
---|
99 | %if 0%{?el5} |
---|
100 | %global mpc_provided %{nil} |
---|
101 | %global mpfr_provided %{nil} |
---|
102 | %global gmp_provided 4.1.4 |
---|
103 | %endif |
---|
104 | |
---|
105 | %if 0%{?suse11_2} |
---|
106 | %global mpc_provided 0.7 |
---|
107 | %global mpfr_provided 2.4.1 |
---|
108 | %global gmp_provided 4.3.1 |
---|
109 | %endif |
---|
110 | |
---|
111 | %if 0%{?suse11_3} |
---|
112 | %global mpc_provided 0.8.1 |
---|
113 | %global mpfr_provided 2.4.2 |
---|
114 | %global gmp_provided 4.3.2 |
---|
115 | %endif |
---|
116 | |
---|
117 | %if 0%{?suse11_4} |
---|
118 | %global mpc_provided 0.8.2 |
---|
119 | %global mpfr_provided 3.0.0 |
---|
120 | %global gmp_provided 5.0.1 |
---|
121 | %endif |
---|
122 | |
---|
123 | %if 0%{?cygwin} |
---|
124 | %global mpc_provided 0.8 |
---|
125 | %global mpfr_provided 2.4.1 |
---|
126 | %global gmp_provided 4.3.1 |
---|
127 | %endif |
---|
128 | |
---|
129 | %if 0%{?mingw32} |
---|
130 | %global mpc_provided 0.8.1 |
---|
131 | %global mpfr_provided 2.4.1 |
---|
132 | %global gmp_provided 4.3.2 |
---|
133 | %endif |
---|
134 | |
---|
135 | %if "%{gcc_version}" >= "4.2.0" |
---|
136 | %define gmp_required 4.1 |
---|
137 | %define mpfr_required 2.2.1 |
---|
138 | %endif |
---|
139 | |
---|
140 | %if "%{gcc_version}" >= "4.3.0" |
---|
141 | %define gmp_required 4.1 |
---|
142 | %define mpfr_required 2.3.1 |
---|
143 | %endif |
---|
144 | |
---|
145 | %if "%{gcc_version}" >= "4.3.3" |
---|
146 | %define cloog_required 0.15 |
---|
147 | %endif |
---|
148 | |
---|
149 | %if "%{gcc_version}" >= "4.4.0" |
---|
150 | %define mpfr_required 2.3.2 |
---|
151 | %endif |
---|
152 | |
---|
153 | %if "%{gcc_version}" >= "4.5.0" |
---|
154 | %define mpc_required 0.8 |
---|
155 | %if %{with lto} |
---|
156 | %define libelf_required 0.8.12 |
---|
157 | %endif |
---|
158 | %endif |
---|
159 | |
---|
160 | %if %{defined mpc_required} |
---|
161 | %if "%{mpc_provided}" >= "%{mpc_required}" |
---|
162 | %{?fedora:BuildRequires: libmpc-devel >= %{mpc_required}} |
---|
163 | %{?suse:BuildRequires: mpc-devel >= %{mpc_required}} |
---|
164 | %if "%{_build}" != "%{_host}" |
---|
165 | BuildRequires: %{_host_rpmprefix}mpc-devel >= %{mpc_required} |
---|
166 | %endif |
---|
167 | %else |
---|
168 | %define _build_mpc 1 |
---|
169 | %define gmp_required 4.2 |
---|
170 | %endif |
---|
171 | %endif |
---|
172 | |
---|
173 | %if %{defined gmp_required} |
---|
174 | %if "%{gmp_provided}" >= "%{gmp_required}" |
---|
175 | BuildRequires: gmp-devel >= %{gmp_required} |
---|
176 | %if "%{_build}" != "%{_host}" |
---|
177 | BuildRequires: %{_host_rpmprefix}gmp-devel >= %{gmp_required} |
---|
178 | %endif |
---|
179 | %else |
---|
180 | %define _build_gmp 1 |
---|
181 | %endif |
---|
182 | %endif |
---|
183 | |
---|
184 | %if %{defined libelf_required} |
---|
185 | %if "%{libelf_provided}" >= "%{libelf_required}" |
---|
186 | BuildRequires: libelf-devel >= %{libelf_required} |
---|
187 | %if "%{_build}" != "%{_host}" |
---|
188 | BuildRequires: %{_host_rpmprefix}libelf-devel >= %{libelf_required} |
---|
189 | %endif |
---|
190 | %else |
---|
191 | %define _build_libelf 1 |
---|
192 | %endif |
---|
193 | %endif |
---|
194 | |
---|
195 | |
---|
196 | %if %{defined cloog_required} |
---|
197 | %{?fc13:BuildRequires: cloog-ppl-devel >= %cloog_required} |
---|
198 | %{?fc14:BuildRequires: cloog-ppl-devel >= %cloog_required} |
---|
199 | %{?fc15:BuildRequires: cloog-ppl-devel >= %cloog_required} |
---|
200 | %{?el6:BuildRequires: cloog-ppl-devel >= %cloog_required} |
---|
201 | %{?suse11_4:BuildRequires: cloog-devel >= %cloog_required, ppl-devel} |
---|
202 | %{?suse11_3:BuildRequires: cloog-devel >= %cloog_required, ppl-devel} |
---|
203 | %{?suse11_2:BuildRequires: cloog-devel >= %cloog_required, ppl-devel} |
---|
204 | %endif |
---|
205 | |
---|
206 | |
---|
207 | %if %{defined mpfr_required} |
---|
208 | %if "%{mpfr_provided}" >= "%{mpfr_required}" |
---|
209 | BuildRequires: mpfr-devel >= %{mpfr_required} |
---|
210 | %if "%{_build}" != "%{_host}" |
---|
211 | BuildRequires: %{_host_rpmprefix}mpfr-devel >= %{mpfr_required} |
---|
212 | %endif |
---|
213 | %else |
---|
214 | %define _build_mpfr 1 |
---|
215 | %endif |
---|
216 | %endif |
---|
217 | |
---|
218 | %if "%{_build}" != "%{_host}" |
---|
219 | BuildRequires: i386-pc-netbsdelf5.1-gcc = %{gcc_rpmvers} |
---|
220 | %endif |
---|
221 | |
---|
222 | %if "%{gcc_version}" >= "4.2.0" |
---|
223 | BuildRequires: flex bison |
---|
224 | %endif |
---|
225 | |
---|
226 | |
---|
227 | BuildRequires: texinfo >= 4.2 |
---|
228 | BuildRequires: i386-pc-netbsdelf5.1-binutils |
---|
229 | BuildRequires: i386-pc-netbsdelf5.1-sys-root |
---|
230 | |
---|
231 | Requires: i386-pc-netbsdelf5.1-binutils |
---|
232 | Requires: i386-pc-netbsdelf5.1-sys-root |
---|
233 | Requires: i386-pc-netbsdelf5.1-gcc-libgcc = %{gcc_rpmvers}-%{release} |
---|
234 | |
---|
235 | %if "%{gcc_version}" >= "4.5.0" |
---|
236 | BuildRequires: zlib-devel |
---|
237 | %if "%{_build}" != "%{_host}" |
---|
238 | BuildRequires: %{_host_rpmprefix}zlib-devel |
---|
239 | %endif |
---|
240 | %else |
---|
241 | %endif |
---|
242 | |
---|
243 | %global _gcclibdir %{_prefix}/lib |
---|
244 | |
---|
245 | Source0: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_pkgvers}.tar.bz2 |
---|
246 | %if "%{gcc_version}" == "4.5.0" |
---|
247 | Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.11/gcc-core-4.5.0-rtems4.11-20100609.diff |
---|
248 | %endif |
---|
249 | %if "%{gcc_version}" == "4.5.2" |
---|
250 | Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.11/gcc-core-4.5.2-rtems4.11-20110220.diff |
---|
251 | %endif |
---|
252 | %{?_without_sources:NoSource: 0} |
---|
253 | |
---|
254 | Source1: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-g++-%{gcc_pkgvers}.tar.bz2 |
---|
255 | %if "%{gcc_version}" == "4.5.2" |
---|
256 | Patch1: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.11/gcc-g++-4.5.2-rtems4.11-20110131.diff |
---|
257 | %endif |
---|
258 | %{?_without_sources:NoSource: 1} |
---|
259 | |
---|
260 | Source2: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-fortran-%{gcc_pkgvers}.tar.bz2 |
---|
261 | %{?_without_sources:NoSource: 2} |
---|
262 | |
---|
263 | Source5: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-objc-%{gcc_pkgvers}.tar.bz2 |
---|
264 | %{?_without_sources:NoSource: 5} |
---|
265 | |
---|
266 | %if 0%{?_build_mpfr} |
---|
267 | Source60: http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2 |
---|
268 | %endif |
---|
269 | |
---|
270 | %if 0%{?_build_mpc} |
---|
271 | Source61: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz |
---|
272 | %endif |
---|
273 | |
---|
274 | %if 0%{?_build_gmp} |
---|
275 | Source62: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2 |
---|
276 | %endif |
---|
277 | |
---|
278 | %if 0%{?_build_libelf} |
---|
279 | Source63: http://www.mr511.de/software/libelf-%{libelf_version}.tar.gz |
---|
280 | %endif |
---|
281 | |
---|
282 | %description |
---|
283 | Cross gcc for i386-pc-netbsdelf5.1. |
---|
284 | |
---|
285 | %prep |
---|
286 | %setup -c -T -n %{name}-%{version} |
---|
287 | |
---|
288 | %setup -q -T -D -n %{name}-%{version} -a0 |
---|
289 | cd gcc-%{gcc_pkgvers} |
---|
290 | %{?PATCH0:%patch0 -p1} |
---|
291 | cd .. |
---|
292 | |
---|
293 | %setup -q -T -D -n %{name}-%{version} -a1 |
---|
294 | cd gcc-%{gcc_pkgvers} |
---|
295 | %{?PATCH1:%patch1 -p1} |
---|
296 | cd .. |
---|
297 | |
---|
298 | %setup -q -T -D -n %{name}-%{version} -a2 |
---|
299 | %{?PATCH2:%patch2 -p0} |
---|
300 | |
---|
301 | |
---|
302 | |
---|
303 | %setup -q -T -D -n %{name}-%{version} -a5 |
---|
304 | %{?PATCH5:%patch5 -p0} |
---|
305 | |
---|
306 | %if %{with gcc_stdint} |
---|
307 | sed -i -e '/thread_file=.*rtems/,/use_gcc_stdint=wrap/ { s/use_gcc_stdint=wrap/use_gcc_stdint=provide/}' gcc-%{gcc_pkgvers}/gcc/config.gcc |
---|
308 | %endif |
---|
309 | |
---|
310 | |
---|
311 | %if 0%{?_build_mpfr} |
---|
312 | %setup -q -T -D -n %{name}-%{version} -a60 |
---|
313 | %{?PATCH60:%patch60 -p1} |
---|
314 | # Build mpfr one-tree style |
---|
315 | ln -s ../mpfr-%{mpfr_version} gcc-%{gcc_pkgvers}/mpfr |
---|
316 | %endif |
---|
317 | |
---|
318 | %if 0%{?_build_mpc} |
---|
319 | %setup -q -T -D -n %{name}-%{version} -a61 |
---|
320 | %{?PATCH61:%patch61 -p1} |
---|
321 | # Build mpc one-tree style |
---|
322 | ln -s ../mpc-%{mpc_version} gcc-%{gcc_pkgvers}/mpc |
---|
323 | %endif |
---|
324 | |
---|
325 | %if 0%{?_build_gmp} |
---|
326 | %setup -q -T -D -n %{name}-%{version} -a62 |
---|
327 | %{?PATCH62:%patch62 -p1} |
---|
328 | # Build gmp one-tree style |
---|
329 | ln -s ../gmp-%{gmp_version} gcc-%{gcc_pkgvers}/gmp |
---|
330 | %endif |
---|
331 | |
---|
332 | %if 0%{?_build_libelf} |
---|
333 | %setup -q -T -D -n %{name}-%{version} -a63 |
---|
334 | %{?PATCH63:%patch63 -p1} |
---|
335 | # Build libelf one-tree style |
---|
336 | ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf |
---|
337 | %endif |
---|
338 | |
---|
339 | |
---|
340 | # Fix timestamps |
---|
341 | cd gcc-%{gcc_pkgvers} |
---|
342 | contrib/gcc_update --touch |
---|
343 | cd .. |
---|
344 | %build |
---|
345 | mkdir -p build |
---|
346 | |
---|
347 | cd build |
---|
348 | |
---|
349 | languages="c" |
---|
350 | languages="$languages,c++" |
---|
351 | case i386-pc-netbsdelf5.1 in |
---|
352 | *-rtems4.11) optargs="$optargs --enable-libstdcxx-time";; |
---|
353 | esac |
---|
354 | languages="$languages,fortran" |
---|
355 | languages="$languages,objc" |
---|
356 | %if "%{_build}" != "%{_host}" |
---|
357 | CFLAGS_FOR_BUILD="-g -O2 -Wall" \ |
---|
358 | CC="%{_host}-gcc ${RPM_OPT_FLAGS}" \ |
---|
359 | %else |
---|
360 | # gcc is not ready to be compiled with -std=gnu99 |
---|
361 | CC=$(echo "%{__cc} ${RPM_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,') \ |
---|
362 | %endif |
---|
363 | ../gcc-%{gcc_pkgvers}/configure \ |
---|
364 | --prefix=%{_prefix} \ |
---|
365 | --bindir=%{_bindir} \ |
---|
366 | --exec_prefix=%{_exec_prefix} \ |
---|
367 | --includedir=%{_includedir} \ |
---|
368 | --libdir=%{_gcclibdir} \ |
---|
369 | --libexecdir=%{_libexecdir} \ |
---|
370 | --mandir=%{_mandir} \ |
---|
371 | --infodir=%{_infodir} \ |
---|
372 | --datadir=%{_datadir} \ |
---|
373 | --build=%_build --host=%_host \ |
---|
374 | --target=i386-pc-netbsdelf5.1 \ |
---|
375 | --disable-libstdcxx-pch \ |
---|
376 | --with-gnu-as --with-gnu-ld --verbose \ |
---|
377 | --with-system-zlib \ |
---|
378 | --disable-nls --without-included-gettext \ |
---|
379 | --disable-win32-registry \ |
---|
380 | --enable-version-specific-runtime-libs \ |
---|
381 | --enable-threads \ |
---|
382 | --with-sysroot=%{_exec_prefix}/i386-pc-netbsdelf5.1/sys-root \ |
---|
383 | %{?with_lto:--enable-lto}%{!?with_lto:--disable-lto} \ |
---|
384 | %{?with_plugin:--enable-plugin}%{!?with_plugin:--disable-plugin} \ |
---|
385 | --enable-languages="$languages" $optargs |
---|
386 | |
---|
387 | %if "%_host" != "%_build" |
---|
388 | # Bug in gcc-3.2.1: |
---|
389 | # Somehow, gcc doesn't get syslimits.h right for Cdn-Xs |
---|
390 | mkdir -p gcc/include |
---|
391 | cp ../gcc-%{gcc_pkgvers}/gcc/gsyslimits.h gcc/include/syslimits.h |
---|
392 | %endif |
---|
393 | |
---|
394 | make %{?_smp_mflags} all |
---|
395 | cd .. |
---|
396 | |
---|
397 | %install |
---|
398 | rm -rf $RPM_BUILD_ROOT |
---|
399 | |
---|
400 | cd build |
---|
401 | |
---|
402 | make DESTDIR=$RPM_BUILD_ROOT install |
---|
403 | cd .. |
---|
404 | |
---|
405 | |
---|
406 | %if "%{gcc_version}" <= "4.1.2" |
---|
407 | # Misplaced header file |
---|
408 | if test -f $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h; then |
---|
409 | mv $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h \ |
---|
410 | $RPM_BUILD_ROOT%{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/include/ |
---|
411 | fi |
---|
412 | %endif |
---|
413 | |
---|
414 | # host library |
---|
415 | %if "%{gcc_version}" >= "4.2.0" |
---|
416 | # libiberty doesn't honor --libdir, but always installs to a |
---|
417 | # magically guessed _libdir |
---|
418 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty.a |
---|
419 | %else |
---|
420 | # libiberty installs to --libdir=... |
---|
421 | rm -f ${RPM_BUILD_ROOT}%{_gcclibdir}/libiberty.a |
---|
422 | %endif |
---|
423 | |
---|
424 | # We use the version from binutils |
---|
425 | rm -f $RPM_BUILD_ROOT%{_bindir}/i386-pc-netbsdelf5.1-c++filt%{_exeext} |
---|
426 | |
---|
427 | |
---|
428 | # Conflict with a native GCC's infos |
---|
429 | rm -rf $RPM_BUILD_ROOT%{_infodir} |
---|
430 | |
---|
431 | # Conflict with a native GCC's man pages |
---|
432 | rm -rf $RPM_BUILD_ROOT%{_mandir}/man7 |
---|
433 | |
---|
434 | # Bug in gcc-3.4.0pre |
---|
435 | rm -f $RPM_BUILD_ROOT%{_bindir}/i386-pc-netbsdelf5.1-i386-pc-netbsdelf5.1-gcjh%{_exeext} |
---|
436 | |
---|
437 | # Bug in gcc-3.3.x/gcc-3.4.x: Despite we don't need fixincludes, it installs |
---|
438 | # the fixinclude-install-tools |
---|
439 | rm -rf ${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/install-tools |
---|
440 | rm -rf ${RPM_BUILD_ROOT}%{_libexecdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/install-tools |
---|
441 | |
---|
442 | # Bug in gcc > 4.1.0: Installs an unused, empty directory |
---|
443 | if test -d ${RPM_BUILD_ROOT}%{_prefix}/i386-pc-netbsdelf5.1/include/bits; then |
---|
444 | rmdir ${RPM_BUILD_ROOT}%{_prefix}/i386-pc-netbsdelf5.1/include/bits |
---|
445 | fi |
---|
446 | |
---|
447 | # gcc >= 4.5.0: installs weird libstdc++ python bindings. |
---|
448 | %if ! %{with pygdb} |
---|
449 | if test -d ${RPM_BUILD_ROOT}%{_datadir}/gcc-%{gcc_version}/python; then |
---|
450 | rm -rf ${RPM_BUILD_ROOT}%{_datadir}/gcc-%{gcc_version}/python/libstdcxx |
---|
451 | fi |
---|
452 | %endif |
---|
453 | |
---|
454 | # Collect multilib subdirectories |
---|
455 | multilibs=`build/gcc/xgcc -Bbuild/gcc/ --print-multi-lib | sed -e 's,;.*$,,'` |
---|
456 | |
---|
457 | |
---|
458 | rm -f dirs ; |
---|
459 | echo "%defattr(-,root,root,-)" >> dirs |
---|
460 | TGTDIR="%{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}" |
---|
461 | for i in $multilibs; do |
---|
462 | case $i in |
---|
463 | \.) ;; # ignore, handled elsewhere |
---|
464 | *) echo "%dir ${TGTDIR}/$i" >> dirs |
---|
465 | ;; |
---|
466 | esac |
---|
467 | done |
---|
468 | |
---|
469 | # Collect files to go into different packages |
---|
470 | cp dirs build/files.gcc |
---|
471 | cp dirs build/files.gfortran |
---|
472 | cp dirs build/files.objc |
---|
473 | cp dirs build/files.gcj |
---|
474 | cp dirs build/files.g++ |
---|
475 | |
---|
476 | TGTDIR="%{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}" |
---|
477 | f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
478 | for i in $f; do |
---|
479 | case $i in |
---|
480 | *lib*.la) rm ${RPM_BUILD_ROOT}/$i ;; # ignore: gcc produces bogus libtool libs |
---|
481 | *f771) ;; |
---|
482 | *f951) ;; |
---|
483 | *cc1) ;; |
---|
484 | *cc1obj) ;; |
---|
485 | *cc1plus) ;; # ignore: explicitly put into rpm elsewhere |
---|
486 | *collect2) ;; |
---|
487 | *libobjc*) echo "$i" >> build/files.objc ;; |
---|
488 | *include/objc*) ;; |
---|
489 | *include/g++*);; |
---|
490 | *include/c++*);; |
---|
491 | *include-fixed/*);; |
---|
492 | *finclude/*);; |
---|
493 | *adainclude*);; |
---|
494 | *adalib*);; |
---|
495 | *gnat1);; |
---|
496 | *jc1) ;; |
---|
497 | *jvgenmain) ;; |
---|
498 | */libgfortran*.*) echo "$i" >> build/files.gfortran ;; |
---|
499 | %{!?with_pygdb:*/libstdc++*gdb.py*) rm ${RPM_BUILD_ROOT}/$i ;;} # ignore for now |
---|
500 | %{?with_pygdb:*/libstdc++*gdb.py*) >> build/files.g++ ;;} |
---|
501 | */libstdc++.*) echo "$i" >> build/files.g++ ;; |
---|
502 | */libsupc++.*) echo "$i" >> build/files.g++ ;; |
---|
503 | *) echo "$i" >> build/files.gcc ;; |
---|
504 | esac |
---|
505 | done |
---|
506 | |
---|
507 | TGTDIR="%{_exec_prefix}/i386-pc-netbsdelf5.1/lib" |
---|
508 | f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
509 | for i in $f; do |
---|
510 | case $i in |
---|
511 | *lib*.la) rm ${RPM_BUILD_ROOT}/$i;; # ignore - gcc produces bogus libtool libs |
---|
512 | *libiberty.a) rm ${RPM_BUILD_ROOT}/$i ;; # ignore - GPL'ed |
---|
513 | # all other files belong to newlib |
---|
514 | *) echo "$i" >> build/files.newlib ;; |
---|
515 | esac |
---|
516 | done |
---|
517 | # Extract %%__os_install_post into os_install_post~ |
---|
518 | cat << \EOF > os_install_post~ |
---|
519 | %__os_install_post |
---|
520 | EOF |
---|
521 | |
---|
522 | # Generate customized brp-*scripts |
---|
523 | cat os_install_post~ | while read a x y; do |
---|
524 | case $a in |
---|
525 | # Prevent brp-strip* from trying to handle foreign binaries |
---|
526 | */brp-strip*) |
---|
527 | b=$(basename $a) |
---|
528 | sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b |
---|
529 | chmod a+x $b |
---|
530 | ;; |
---|
531 | esac |
---|
532 | done |
---|
533 | |
---|
534 | sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ |
---|
535 | < os_install_post~ > os_install_post |
---|
536 | %define __os_install_post . ./os_install_post |
---|
537 | |
---|
538 | |
---|
539 | cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides |
---|
540 | #!/bin/sh |
---|
541 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i386-pc-netbsdelf5.1/(lib|include|sys-root)' \ |
---|
542 | %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/'} | %__find_provides |
---|
543 | EOF |
---|
544 | chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides |
---|
545 | %define __find_provides %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides |
---|
546 | |
---|
547 | cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires |
---|
548 | #!/bin/sh |
---|
549 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i386-pc-netbsdelf5.1/(lib|include|sys-root)' \ |
---|
550 | %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/'} | %__find_requires |
---|
551 | EOF |
---|
552 | chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires |
---|
553 | %define __find_requires %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires |
---|
554 | |
---|
555 | %ifnarch noarch |
---|
556 | # Extract %%__debug_install_post into debug_install_post~ |
---|
557 | cat << \EOF > debug_install_post~ |
---|
558 | %__debug_install_post |
---|
559 | EOF |
---|
560 | |
---|
561 | # Generate customized debug_install_post script |
---|
562 | cat debug_install_post~ | while read a x y; do |
---|
563 | case $a in |
---|
564 | # Prevent find-debuginfo.sh* from trying to handle foreign binaries |
---|
565 | */find-debuginfo.sh) |
---|
566 | b=$(basename $a) |
---|
567 | sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b |
---|
568 | chmod a+x $b |
---|
569 | ;; |
---|
570 | esac |
---|
571 | done |
---|
572 | |
---|
573 | sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \ |
---|
574 | < debug_install_post~ > debug_install_post |
---|
575 | %define __debug_install_post . ./debug_install_post |
---|
576 | |
---|
577 | %endif |
---|
578 | |
---|
579 | %clean |
---|
580 | rm -rf $RPM_BUILD_ROOT |
---|
581 | |
---|
582 | # ============================================================== |
---|
583 | # i386-pc-netbsdelf5.1-gcc |
---|
584 | # ============================================================== |
---|
585 | # %package -n i386-pc-netbsdelf5.1-gcc |
---|
586 | # Summary: GNU cc compiler for i386-pc-netbsdelf5.1 |
---|
587 | # Group: Development/Tools |
---|
588 | # Version: %{gcc_rpmvers} |
---|
589 | # Requires: i386-pc-netbsdelf5.1-binutils |
---|
590 | # License: GPL |
---|
591 | |
---|
592 | # %if %build_infos |
---|
593 | # Requires: gcc-common |
---|
594 | # %endif |
---|
595 | |
---|
596 | %description -n i386-pc-netbsdelf5.1-gcc |
---|
597 | GNU cc compiler for i386-pc-netbsdelf5.1. |
---|
598 | |
---|
599 | # ============================================================== |
---|
600 | # i386-pc-netbsdelf5.1-gcc-libgcc |
---|
601 | # ============================================================== |
---|
602 | %package -n i386-pc-netbsdelf5.1-gcc-libgcc |
---|
603 | Summary: libgcc for i386-pc-netbsdelf5.1-gcc |
---|
604 | Group: Development/Tools |
---|
605 | Version: %{gcc_rpmvers} |
---|
606 | %{?_with_noarch_subpackages:BuildArch: noarch} |
---|
607 | License: GPL |
---|
608 | |
---|
609 | %description -n i386-pc-netbsdelf5.1-gcc-libgcc |
---|
610 | libgcc i386-pc-netbsdelf5.1-gcc. |
---|
611 | |
---|
612 | |
---|
613 | %files -n i386-pc-netbsdelf5.1-gcc |
---|
614 | %defattr(-,root,root) |
---|
615 | |
---|
616 | %{_mandir}/man1/i386-pc-netbsdelf5.1-gcc.1* |
---|
617 | %{_mandir}/man1/i386-pc-netbsdelf5.1-cpp.1* |
---|
618 | %{_mandir}/man1/i386-pc-netbsdelf5.1-gcov.1* |
---|
619 | |
---|
620 | %{_bindir}/i386-pc-netbsdelf5.1-cpp%{_exeext} |
---|
621 | %{_bindir}/i386-pc-netbsdelf5.1-gcc%{_exeext} |
---|
622 | %{_bindir}/i386-pc-netbsdelf5.1-gcc-%{gcc_version}%{_exeext} |
---|
623 | %{_bindir}/i386-pc-netbsdelf5.1-gcov%{_exeext} |
---|
624 | %{_bindir}/i386-pc-netbsdelf5.1-gccbug |
---|
625 | |
---|
626 | %dir %{_libexecdir}/gcc |
---|
627 | %dir %{_libexecdir}/gcc/i386-pc-netbsdelf5.1 |
---|
628 | %dir %{_libexecdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version} |
---|
629 | %{_libexecdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/cc1%{_exeext} |
---|
630 | %{_libexecdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/collect2%{_exeext} |
---|
631 | %if "%{gcc_version}" >= "4.5.0" |
---|
632 | %{?with_lto:%{_libexecdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/lto%{_exeext}} |
---|
633 | %{_libexecdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/lto-wrapper%{_exeext} |
---|
634 | %endif |
---|
635 | |
---|
636 | %files -n i386-pc-netbsdelf5.1-gcc-libgcc -f build/files.gcc |
---|
637 | %defattr(-,root,root) |
---|
638 | %dir %{_gcclibdir}/gcc |
---|
639 | %dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1 |
---|
640 | %dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version} |
---|
641 | %dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/include |
---|
642 | |
---|
643 | %if "%{gcc_version}" > "4.0.3" |
---|
644 | %dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/include/ssp |
---|
645 | %endif |
---|
646 | |
---|
647 | %if "%{gcc_version}" >= "4.3.0" |
---|
648 | %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/include-fixed |
---|
649 | %endif |
---|
650 | |
---|
651 | # ============================================================== |
---|
652 | # i386-pc-netbsdelf5.1-gcc-c++ |
---|
653 | # ============================================================== |
---|
654 | %package -n i386-pc-netbsdelf5.1-gcc-c++ |
---|
655 | Summary: GCC c++ compiler for i386-pc-netbsdelf5.1 |
---|
656 | Group: Development/Tools |
---|
657 | Version: %{gcc_rpmvers} |
---|
658 | License: GPL |
---|
659 | Requires: i386-pc-netbsdelf5.1-gcc-libstdc++ = %{gcc_rpmvers}-%{release} |
---|
660 | |
---|
661 | %if "%{_build}" != "%{_host}" |
---|
662 | BuildRequires: i386-pc-netbsdelf5.1-gcc-c++ = %{gcc_rpmvers} |
---|
663 | %endif |
---|
664 | |
---|
665 | Requires: i386-pc-netbsdelf5.1-gcc = %{gcc_rpmvers}-%{release} |
---|
666 | |
---|
667 | %description -n i386-pc-netbsdelf5.1-gcc-c++ |
---|
668 | GCC c++ compiler for i386-pc-netbsdelf5.1. |
---|
669 | |
---|
670 | |
---|
671 | %package -n i386-pc-netbsdelf5.1-gcc-libstdc++ |
---|
672 | Summary: libstdc++ for i386-pc-netbsdelf5.1 |
---|
673 | Group: Development/Tools |
---|
674 | Version: %{gcc_rpmvers} |
---|
675 | %{?_with_noarch_subpackages:BuildArch: noarch} |
---|
676 | License: GPL |
---|
677 | |
---|
678 | %description -n i386-pc-netbsdelf5.1-gcc-libstdc++ |
---|
679 | %{summary} |
---|
680 | |
---|
681 | |
---|
682 | %files -n i386-pc-netbsdelf5.1-gcc-c++ |
---|
683 | %defattr(-,root,root) |
---|
684 | |
---|
685 | %{_mandir}/man1/i386-pc-netbsdelf5.1-g++.1* |
---|
686 | |
---|
687 | %{_bindir}/i386-pc-netbsdelf5.1-c++%{_exeext} |
---|
688 | %{_bindir}/i386-pc-netbsdelf5.1-g++%{_exeext} |
---|
689 | |
---|
690 | %dir %{_libexecdir}/gcc |
---|
691 | %dir %{_libexecdir}/gcc/i386-pc-netbsdelf5.1 |
---|
692 | %dir %{_libexecdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version} |
---|
693 | %{_libexecdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/cc1plus%{_exeext} |
---|
694 | |
---|
695 | |
---|
696 | %files -n i386-pc-netbsdelf5.1-gcc-libstdc++ -f build/files.g++ |
---|
697 | %defattr(-,root,root) |
---|
698 | %dir %{_gcclibdir}/gcc |
---|
699 | %dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1 |
---|
700 | %dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version} |
---|
701 | %dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/include |
---|
702 | %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/include/c++ |
---|
703 | |
---|
704 | # ============================================================== |
---|
705 | # i386-pc-netbsdelf5.1-gcc-gfortran |
---|
706 | # ============================================================== |
---|
707 | %package -n i386-pc-netbsdelf5.1-gcc-gfortran |
---|
708 | Summary: Fortran 95 support for i386-pc-netbsdelf5.1-gcc |
---|
709 | Group: Development/Tools |
---|
710 | Version: %{gcc_rpmvers} |
---|
711 | License: GPL |
---|
712 | |
---|
713 | Requires: i386-pc-netbsdelf5.1-gcc = %{gcc_rpmvers}-%{release} |
---|
714 | Requires: i386-pc-netbsdelf5.1-gcc-libgfortran = %{gcc_rpmvers}-%{release} |
---|
715 | |
---|
716 | %description -n i386-pc-netbsdelf5.1-gcc-gfortran |
---|
717 | GCC fortran compiler for i386-pc-netbsdelf5.1. |
---|
718 | |
---|
719 | %files -n i386-pc-netbsdelf5.1-gcc-gfortran |
---|
720 | %defattr(-,root,root) |
---|
721 | %{_bindir}/i386-pc-netbsdelf5.1-gfortran%{_exeext} |
---|
722 | |
---|
723 | %{_mandir}/man1/i386-pc-netbsdelf5.1-gfortran.1* |
---|
724 | |
---|
725 | %dir %{_libexecdir}/gcc |
---|
726 | %dir %{_libexecdir}/gcc/i386-pc-netbsdelf5.1 |
---|
727 | %dir %{_libexecdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version} |
---|
728 | %{_libexecdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/f951%{_exeext} |
---|
729 | |
---|
730 | # ============================================================== |
---|
731 | # i386-pc-netbsdelf5.1-gcc-libgfortran |
---|
732 | # ============================================================== |
---|
733 | %package -n i386-pc-netbsdelf5.1-gcc-libgfortran |
---|
734 | Summary: Fortran 95 support libraries for i386-pc-netbsdelf5.1-gcc |
---|
735 | Group: Development/Tools |
---|
736 | Version: %{gcc_rpmvers} |
---|
737 | %{?_with_noarch_subpackages:BuildArch: noarch} |
---|
738 | License: GPL |
---|
739 | |
---|
740 | %description -n i386-pc-netbsdelf5.1-gcc-libgfortran |
---|
741 | %{summary} |
---|
742 | |
---|
743 | %files -n i386-pc-netbsdelf5.1-gcc-libgfortran -f build/files.gfortran |
---|
744 | %defattr(-,root,root) |
---|
745 | %dir %{_gcclibdir}/gcc |
---|
746 | %dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1 |
---|
747 | %dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version} |
---|
748 | %if "%{gcc_version}" >= "4.2.0" |
---|
749 | %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/finclude |
---|
750 | %endif |
---|
751 | |
---|
752 | # ============================================================== |
---|
753 | # i386-pc-netbsdelf5.1-gcc-objc |
---|
754 | # ============================================================== |
---|
755 | %package -n i386-pc-netbsdelf5.1-gcc-objc |
---|
756 | Summary: Objective C support for i386-pc-netbsdelf5.1-gcc |
---|
757 | Group: Development/Tools |
---|
758 | Version: %{gcc_rpmvers} |
---|
759 | License: GPL |
---|
760 | |
---|
761 | Requires: i386-pc-netbsdelf5.1-gcc = %{gcc_rpmvers}-%{release} |
---|
762 | Requires: i386-pc-netbsdelf5.1-gcc-libobjc = %{gcc_rpmvers}-%{release} |
---|
763 | |
---|
764 | %description -n i386-pc-netbsdelf5.1-gcc-objc |
---|
765 | GCC objc compiler for i386-pc-netbsdelf5.1. |
---|
766 | |
---|
767 | %files -n i386-pc-netbsdelf5.1-gcc-objc |
---|
768 | %defattr(-,root,root) |
---|
769 | %dir %{_libexecdir}/gcc |
---|
770 | %dir %{_libexecdir}/gcc/i386-pc-netbsdelf5.1 |
---|
771 | %dir %{_libexecdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version} |
---|
772 | %{_libexecdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/cc1obj%{_exeext} |
---|
773 | |
---|
774 | # ============================================================== |
---|
775 | # i386-pc-netbsdelf5.1-gcc-libobjc |
---|
776 | # ============================================================== |
---|
777 | %package -n i386-pc-netbsdelf5.1-gcc-libobjc |
---|
778 | Summary: Objective C support for i386-pc-netbsdelf5.1-gcc |
---|
779 | Group: Development/Tools |
---|
780 | Version: %{gcc_rpmvers} |
---|
781 | %{?_with_noarch_subpackages:BuildArch: noarch} |
---|
782 | License: GPL |
---|
783 | |
---|
784 | %description -n i386-pc-netbsdelf5.1-gcc-libobjc |
---|
785 | Support libraries for GCC's objc compiler for i386-pc-netbsdelf5.1. |
---|
786 | |
---|
787 | %files -n i386-pc-netbsdelf5.1-gcc-libobjc -f build/files.objc |
---|
788 | %defattr(-,root,root) |
---|
789 | %dir %{_gcclibdir}/gcc |
---|
790 | %dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1 |
---|
791 | %dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version} |
---|
792 | %dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/include |
---|
793 | %{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/%{gcc_version}/include/objc |
---|
794 | |
---|