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 3.4.4 |
---|
35 | %define gcc_version 3.4.4 |
---|
36 | %define gcc_rpmvers %{expand:%(echo "3.4.4" | tr - _ )} |
---|
37 | |
---|
38 | |
---|
39 | Name: i686-pc-cygwin-gcc |
---|
40 | Summary: i686-pc-cygwin gcc |
---|
41 | |
---|
42 | Group: Development/Tools |
---|
43 | Version: %{gcc_rpmvers} |
---|
44 | Release: 0.20100225.0%{?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 | # versions of libraries, we conditionally bundle if necessary |
---|
65 | %global mpc_version 0.8.1 |
---|
66 | %global mpfr_version 2.4.1 |
---|
67 | %global gmp_version 4.3.2 |
---|
68 | %global libelf_version 0.8.13 |
---|
69 | |
---|
70 | # versions of libraries these distros are known to ship |
---|
71 | %if 0%{?fc13} |
---|
72 | %global mpc_provided 0.8.1 |
---|
73 | %global mpfr_provided 2.4.1 |
---|
74 | %global gmp_provided 4.3.1 |
---|
75 | %endif |
---|
76 | |
---|
77 | %if 0%{?fc12} |
---|
78 | %global mpc_provided 0.8 |
---|
79 | %global mpfr_provided 2.4.1 |
---|
80 | %global gmp_provided 4.3.1 |
---|
81 | %endif |
---|
82 | |
---|
83 | %if 0%{?fc11} |
---|
84 | %global mpc_provided %{nil} |
---|
85 | %global mpfr_provided 2.4.1 |
---|
86 | %global gmp_provided 4.2.4 |
---|
87 | %endif |
---|
88 | |
---|
89 | %if 0%{?el6} |
---|
90 | %global mpc_provided %{nil} |
---|
91 | # el6 beta ships mpfr but mpfr-devel is missing |
---|
92 | %global mpfr_provided %{nil} |
---|
93 | %global gmp_provided 4.3.1 |
---|
94 | %endif |
---|
95 | |
---|
96 | %if 0%{?el5} |
---|
97 | %global mpc_provided %{nil} |
---|
98 | %global mpfr_provided %{nil} |
---|
99 | %global gmp_provided 4.1.4 |
---|
100 | %endif |
---|
101 | |
---|
102 | %if 0%{?suse11_0} |
---|
103 | %global mpc_provided %{nil} |
---|
104 | %global mpfr_provided 2.3.1 |
---|
105 | %global gmp_provided 4.2.2 |
---|
106 | %endif |
---|
107 | |
---|
108 | %if 0%{?suse11_1} |
---|
109 | %global mpc_provided %{nil} |
---|
110 | %global mpfr_provided 2.3.2 |
---|
111 | %global gmp_provided 4.2.3 |
---|
112 | %endif |
---|
113 | |
---|
114 | %if 0%{?suse11_2} |
---|
115 | %global mpc_provided 0.7 |
---|
116 | %global mpfr_provided 2.4.1 |
---|
117 | %global gmp_provided 4.3.1 |
---|
118 | %endif |
---|
119 | |
---|
120 | %if 0%{?cygwin} |
---|
121 | %global mpc_provided 0.8 |
---|
122 | %global mpfr_provided 2.4.1 |
---|
123 | %global gmp_provided 4.3.1 |
---|
124 | %endif |
---|
125 | |
---|
126 | %if 0%{?mingw32} |
---|
127 | %global mpc_provided 0.8.1 |
---|
128 | %global mpfr_provided 2.4.1 |
---|
129 | %global gmp_provided 4.3.2 |
---|
130 | %endif |
---|
131 | |
---|
132 | %if "%{gcc_version}" >= "4.2.0" |
---|
133 | %endif |
---|
134 | |
---|
135 | %if "%{gcc_version}" >= "4.3.0" |
---|
136 | %define gmp_required 4.1 |
---|
137 | %define mpfr_required 2.3.1 |
---|
138 | %endif |
---|
139 | |
---|
140 | %if "%{gcc_version}" >= "4.3.3" |
---|
141 | %define cloog_required 0.15 |
---|
142 | %endif |
---|
143 | |
---|
144 | %if "%{gcc_version}" >= "4.4.0" |
---|
145 | %define mpfr_required 2.3.2 |
---|
146 | %endif |
---|
147 | |
---|
148 | %if "%{gcc_version}" >= "4.5.0" |
---|
149 | %define mpc_required 0.8 |
---|
150 | %if %{with lto} |
---|
151 | %define libelf_required 0.8.12 |
---|
152 | %endif |
---|
153 | %endif |
---|
154 | |
---|
155 | %if %{defined mpc_required} |
---|
156 | %if "%{mpc_provided}" >= "%{mpc_required}" |
---|
157 | %{?fedora:BuildRequires: libmpc-devel >= %{mpc_required}} |
---|
158 | %{?suse:BuildRequires: mpc-devel >= %{mpc_required}} |
---|
159 | %if "%{_build}" != "%{_host}" |
---|
160 | BuildRequires: %{_host_rpmprefix}mpc-devel >= %{mpc_required} |
---|
161 | %endif |
---|
162 | %else |
---|
163 | %define _build_mpc 1 |
---|
164 | %define gmp_required 4.2 |
---|
165 | %endif |
---|
166 | %endif |
---|
167 | |
---|
168 | %if %{defined gmp_required} |
---|
169 | %if "%{gmp_provided}" >= "%{gmp_required}" |
---|
170 | BuildRequires: gmp-devel >= %{gmp_required} |
---|
171 | %if "%{_build}" != "%{_host}" |
---|
172 | BuildRequires: %{_host_rpmprefix}gmp-devel >= %{gmp_required} |
---|
173 | %endif |
---|
174 | %else |
---|
175 | %define _build_gmp 1 |
---|
176 | %endif |
---|
177 | %endif |
---|
178 | |
---|
179 | %if %{defined libelf_required} |
---|
180 | %if "%{libelf_provided}" >= "%{libelf_required}" |
---|
181 | BuildRequires: libelf-devel >= %{libelf_required} |
---|
182 | %if "%{_build}" != "%{_host}" |
---|
183 | BuildRequires: %{_host_rpmprefix}libelf-devel >= %{libelf_required} |
---|
184 | %endif |
---|
185 | %else |
---|
186 | %define _build_libelf 1 |
---|
187 | %endif |
---|
188 | %endif |
---|
189 | |
---|
190 | |
---|
191 | %if %{defined cloog_required} |
---|
192 | %{?fc11:BuildRequires: cloog-ppl-devel >= %cloog_required} |
---|
193 | %{?fc12:BuildRequires: cloog-ppl-devel >= %cloog_required} |
---|
194 | %{?fc13:BuildRequires: cloog-ppl-devel >= %cloog_required} |
---|
195 | # el6 ships cloog-ppl, but cloog-ppl-devel is missing |
---|
196 | %{?suse11_2:BuildRequires: cloog-devel >= %cloog_required, ppl-devel} |
---|
197 | %{?suse11_1:BuildRequires: cloog-devel >= %cloog_required, ppl-devel} |
---|
198 | %endif |
---|
199 | |
---|
200 | |
---|
201 | %if %{defined mpfr_required} |
---|
202 | %if "%{mpfr_provided}" >= "%{mpfr_required}" |
---|
203 | BuildRequires: mpfr-devel >= %{mpfr_required} |
---|
204 | %if "%{_build}" != "%{_host}" |
---|
205 | BuildRequires: %{_host_rpmprefix}mpfr-devel >= %{mpfr_required} |
---|
206 | %endif |
---|
207 | %else |
---|
208 | %define _build_mpfr 1 |
---|
209 | %endif |
---|
210 | %endif |
---|
211 | |
---|
212 | %if "%{_build}" != "%{_host}" |
---|
213 | BuildRequires: i686-pc-cygwin-gcc = %{gcc_rpmvers} |
---|
214 | %endif |
---|
215 | |
---|
216 | %if "%{gcc_version}" >= "4.2.0" |
---|
217 | BuildRequires: flex bison |
---|
218 | %endif |
---|
219 | |
---|
220 | |
---|
221 | BuildRequires: texinfo >= 4.2 |
---|
222 | BuildRequires: i686-pc-cygwin-binutils |
---|
223 | BuildRequires: i686-pc-cygwin-sys-root |
---|
224 | |
---|
225 | Requires: i686-pc-cygwin-binutils |
---|
226 | Requires: i686-pc-cygwin-sys-root |
---|
227 | Requires: i686-pc-cygwin-w32api |
---|
228 | Requires: i686-pc-cygwin-gcc-libgcc = %{gcc_rpmvers}-%{release} |
---|
229 | |
---|
230 | %if "%{gcc_version}" >= "4.5.0" |
---|
231 | BuildRequires: zlib-devel |
---|
232 | %if "%{_build}" != "%{_host}" |
---|
233 | BuildRequires: %{_host_rpmprefix}zlib-devel |
---|
234 | %endif |
---|
235 | %else |
---|
236 | %endif |
---|
237 | |
---|
238 | %global _gcclibdir %{_prefix}/lib |
---|
239 | |
---|
240 | Source0: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_pkgvers}.tar.bz2 |
---|
241 | %{?_without_sources:NoSource: 0} |
---|
242 | |
---|
243 | Source1: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-g++-%{gcc_pkgvers}.tar.bz2 |
---|
244 | %{?_without_sources:NoSource: 1} |
---|
245 | |
---|
246 | |
---|
247 | %if "%{gcc_version}" == "3.4.4" |
---|
248 | # Cygwin patch extracted from |
---|
249 | # ftp://sourceware.org/pub/cygwin/release/gcc/gcc-3.4.4-3-src.tar.bz2 |
---|
250 | Patch70: gcc-3.4.4-3.patch |
---|
251 | |
---|
252 | Patch71: cygwin-gcc-3.4.4-3.diff |
---|
253 | %endif |
---|
254 | %if "%{gcc_version}" == "4.3.4" |
---|
255 | # Cygwin patch extracted from |
---|
256 | # ftp://sourceware.org/pub/cygwin/release/gcc4/gcc4-4.3.4-3-src.tar.bz2 |
---|
257 | Patch70: gcc4-4.3.4-3.src.patch |
---|
258 | |
---|
259 | Patch71: cygwin-gcc4-4.3.4-3.diff |
---|
260 | %endif |
---|
261 | |
---|
262 | %if 0%{?_build_mpfr} |
---|
263 | Source60: http://www.mpfr.org/mpfr-current/mpfr-%{mpfr_version}.tar.bz2 |
---|
264 | %endif |
---|
265 | |
---|
266 | %if 0%{?_build_mpc} |
---|
267 | Source61: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz |
---|
268 | %endif |
---|
269 | |
---|
270 | %if 0%{?_build_gmp} |
---|
271 | Source62: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2 |
---|
272 | %endif |
---|
273 | |
---|
274 | %if 0%{?_build_libelf} |
---|
275 | Source63: http://www.mr511.de/software/libelf-%{libelf_version}.tar.gz |
---|
276 | %endif |
---|
277 | |
---|
278 | %description |
---|
279 | Cross gcc for i686-pc-cygwin. |
---|
280 | |
---|
281 | %prep |
---|
282 | %setup -c -T -n %{name}-%{version} |
---|
283 | |
---|
284 | %setup -q -T -D -n %{name}-%{version} -a0 |
---|
285 | cd gcc-%{gcc_pkgvers} |
---|
286 | %{?PATCH0:%patch0 -p1} |
---|
287 | cd .. |
---|
288 | |
---|
289 | %setup -q -T -D -n %{name}-%{version} -a1 |
---|
290 | cd gcc-%{gcc_pkgvers} |
---|
291 | %{?PATCH1:%patch1 -p1} |
---|
292 | cd .. |
---|
293 | |
---|
294 | |
---|
295 | |
---|
296 | |
---|
297 | |
---|
298 | |
---|
299 | %if 0%{?_build_mpfr} |
---|
300 | %setup -q -T -D -n %{name}-%{version} -a60 |
---|
301 | %{?PATCH60:%patch60 -p1} |
---|
302 | # Build mpfr one-tree style |
---|
303 | ln -s ../mpfr-%{mpfr_version} gcc-%{gcc_pkgvers}/mpfr |
---|
304 | %endif |
---|
305 | |
---|
306 | %if 0%{?_build_mpc} |
---|
307 | %setup -q -T -D -n %{name}-%{version} -a61 |
---|
308 | %{?PATCH61:%patch61 -p1} |
---|
309 | # Build mpc one-tree style |
---|
310 | ln -s ../mpc-%{mpc_version} gcc-%{gcc_pkgvers}/mpc |
---|
311 | %endif |
---|
312 | |
---|
313 | %if 0%{?_build_gmp} |
---|
314 | %setup -q -T -D -n %{name}-%{version} -a62 |
---|
315 | %{?PATCH62:%patch62 -p1} |
---|
316 | # Build gmp one-tree style |
---|
317 | ln -s ../gmp-%{gmp_version} gcc-%{gcc_pkgvers}/gmp |
---|
318 | %endif |
---|
319 | |
---|
320 | %if 0%{?_build_libelf} |
---|
321 | %setup -q -T -D -n %{name}-%{version} -a63 |
---|
322 | %{?PATCH63:%patch63 -p1} |
---|
323 | # Build libelf one-tree style |
---|
324 | ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf |
---|
325 | %endif |
---|
326 | |
---|
327 | # cygwin patches can't be directly applied through rpm |
---|
328 | cd gcc-%{gcc_pkgvers} |
---|
329 | %if "%{gcc_version}" < "4.0" |
---|
330 | patch -p1 -t < %{PATCH70} || true |
---|
331 | %else |
---|
332 | patch -p2 -t < %{PATCH70} || true |
---|
333 | %endif |
---|
334 | %{?PATCH71:patch -p1 < %{PATCH71}} |
---|
335 | cd .. |
---|
336 | |
---|
337 | # Fix timestamps |
---|
338 | cd gcc-%{gcc_pkgvers} |
---|
339 | contrib/gcc_update --touch |
---|
340 | cd .. |
---|
341 | %build |
---|
342 | mkdir -p build |
---|
343 | |
---|
344 | cd build |
---|
345 | |
---|
346 | languages="c" |
---|
347 | languages="$languages,c++" |
---|
348 | %if "%{_build}" != "%{_host}" |
---|
349 | CFLAGS_FOR_BUILD="-g -O2 -Wall" \ |
---|
350 | CC="%{_host}-gcc ${RPM_OPT_FLAGS}" \ |
---|
351 | %else |
---|
352 | # gcc is not ready to be compiled with -std=gnu99 |
---|
353 | CC=$(echo "%{__cc} ${RPM_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,') \ |
---|
354 | %endif |
---|
355 | ../gcc-%{gcc_pkgvers}/configure \ |
---|
356 | --prefix=%{_prefix} \ |
---|
357 | --bindir=%{_bindir} \ |
---|
358 | --exec_prefix=%{_exec_prefix} \ |
---|
359 | --includedir=%{_includedir} \ |
---|
360 | --libdir=%{_gcclibdir} \ |
---|
361 | --libexecdir=%{_libexecdir} \ |
---|
362 | --mandir=%{_mandir} \ |
---|
363 | --infodir=%{_infodir} \ |
---|
364 | --datadir=%{_datadir} \ |
---|
365 | --build=%_build --host=%_host \ |
---|
366 | --target=i686-pc-cygwin \ |
---|
367 | --disable-libstdcxx-pch \ |
---|
368 | --with-gnu-as --with-gnu-ld --verbose \ |
---|
369 | --with-newlib \ |
---|
370 | --with-system-zlib \ |
---|
371 | --disable-nls --without-included-gettext \ |
---|
372 | --disable-win32-registry \ |
---|
373 | --enable-version-specific-runtime-libs \ |
---|
374 | --enable-threads \ |
---|
375 | --with-sysroot=%{_exec_prefix}/i686-pc-cygwin/sys-root \ |
---|
376 | %{?with_lto:--enable-lto}%{!?with_lto:--disable-lto} \ |
---|
377 | %{?with_plugin:--enable-plugin}%{!?with_plugin:--disable-plugin} \ |
---|
378 | --enable-languages="$languages" $optargs |
---|
379 | |
---|
380 | %if "%_host" != "%_build" |
---|
381 | # Bug in gcc-3.2.1: |
---|
382 | # Somehow, gcc doesn't get syslimits.h right for Cdn-Xs |
---|
383 | mkdir -p gcc/include |
---|
384 | cp ../gcc-%{gcc_pkgvers}/gcc/gsyslimits.h gcc/include/syslimits.h |
---|
385 | %endif |
---|
386 | |
---|
387 | make %{?_smp_mflags} all |
---|
388 | cd .. |
---|
389 | |
---|
390 | %install |
---|
391 | rm -rf $RPM_BUILD_ROOT |
---|
392 | |
---|
393 | cd build |
---|
394 | |
---|
395 | make DESTDIR=$RPM_BUILD_ROOT install |
---|
396 | cd .. |
---|
397 | |
---|
398 | |
---|
399 | %if "%{gcc_version}" <= "4.1.2" |
---|
400 | # Misplaced header file |
---|
401 | if test -f $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h; then |
---|
402 | mv $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h \ |
---|
403 | $RPM_BUILD_ROOT%{_gcclibdir}/gcc/i686-pc-cygwin/%{gcc_version}/include/ |
---|
404 | fi |
---|
405 | %endif |
---|
406 | |
---|
407 | # host library |
---|
408 | %if "%{gcc_version}" >= "4.2.0" |
---|
409 | # libiberty doesn't honor --libdir, but always installs to a |
---|
410 | # magically guessed _libdir |
---|
411 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty.a |
---|
412 | %else |
---|
413 | # libiberty installs to --libdir=... |
---|
414 | rm -f ${RPM_BUILD_ROOT}%{_gcclibdir}/libiberty.a |
---|
415 | %endif |
---|
416 | |
---|
417 | # We use the version from binutils |
---|
418 | rm -f $RPM_BUILD_ROOT%{_bindir}/i686-pc-cygwin-c++filt%{_exeext} |
---|
419 | |
---|
420 | |
---|
421 | # Conflict with a native GCC's infos |
---|
422 | rm -rf $RPM_BUILD_ROOT%{_infodir} |
---|
423 | |
---|
424 | # Conflict with a native GCC's man pages |
---|
425 | rm -rf $RPM_BUILD_ROOT%{_mandir}/man7 |
---|
426 | |
---|
427 | # Bug in gcc-3.4.0pre |
---|
428 | rm -f $RPM_BUILD_ROOT%{_bindir}/i686-pc-cygwin-i686-pc-cygwin-gcjh%{_exeext} |
---|
429 | |
---|
430 | # Bug in gcc-3.3.x/gcc-3.4.x: Despite we don't need fixincludes, it installs |
---|
431 | # the fixinclude-install-tools |
---|
432 | rm -rf ${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i686-pc-cygwin/%{gcc_version}/install-tools |
---|
433 | rm -rf ${RPM_BUILD_ROOT}%{_libexecdir}/gcc/i686-pc-cygwin/%{gcc_version}/install-tools |
---|
434 | |
---|
435 | # Bug in gcc > 4.1.0: Installs an unused, empty directory |
---|
436 | if test -d ${RPM_BUILD_ROOT}%{_prefix}/i686-pc-cygwin/include/bits; then |
---|
437 | rmdir ${RPM_BUILD_ROOT}%{_prefix}/i686-pc-cygwin/include/bits |
---|
438 | fi |
---|
439 | |
---|
440 | # gcc >= 4.5.0: installs weird libstdc++ python bindings. |
---|
441 | %if ! %{with pygdb} |
---|
442 | if test -d ${RPM_BUILD_ROOT}%{_datadir}/gcc-%{gcc_version}/python; then |
---|
443 | rm -rf ${RPM_BUILD_ROOT}%{_datadir}/gcc-%{gcc_version}/python/libstdcxx |
---|
444 | fi |
---|
445 | %endif |
---|
446 | |
---|
447 | # Collect multilib subdirectories |
---|
448 | multilibs=`build/gcc/xgcc -Bbuild/gcc/ --print-multi-lib | sed -e 's,;.*$,,'` |
---|
449 | |
---|
450 | |
---|
451 | rm -f dirs ; |
---|
452 | echo "%defattr(-,root,root,-)" >> dirs |
---|
453 | TGTDIR="%{_gcclibdir}/gcc/i686-pc-cygwin/%{gcc_version}" |
---|
454 | for i in $multilibs; do |
---|
455 | case $i in |
---|
456 | \.) ;; # ignore, handled elsewhere |
---|
457 | *) echo "%dir ${TGTDIR}/$i" >> dirs |
---|
458 | ;; |
---|
459 | esac |
---|
460 | done |
---|
461 | |
---|
462 | # Collect files to go into different packages |
---|
463 | cp dirs build/files.gcc |
---|
464 | cp dirs build/files.gfortran |
---|
465 | cp dirs build/files.objc |
---|
466 | cp dirs build/files.gcj |
---|
467 | cp dirs build/files.g++ |
---|
468 | |
---|
469 | TGTDIR="%{_gcclibdir}/gcc/i686-pc-cygwin/%{gcc_version}" |
---|
470 | f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
471 | for i in $f; do |
---|
472 | case $i in |
---|
473 | *lib*.la) rm ${RPM_BUILD_ROOT}/$i ;; # ignore: gcc produces bogus libtool libs |
---|
474 | *f771) ;; |
---|
475 | *f951) ;; |
---|
476 | *cc1) ;; |
---|
477 | *cc1obj) ;; |
---|
478 | *cc1plus) ;; # ignore: explicitly put into rpm elsewhere |
---|
479 | *collect2) ;; |
---|
480 | *libobjc*) echo "$i" >> build/files.objc ;; |
---|
481 | *include/objc*) ;; |
---|
482 | *include/g++*);; |
---|
483 | *include/c++*);; |
---|
484 | *include-fixed/*);; |
---|
485 | *finclude/*);; |
---|
486 | *adainclude*);; |
---|
487 | *adalib*);; |
---|
488 | *gnat1);; |
---|
489 | *jc1) ;; |
---|
490 | *jvgenmain) ;; |
---|
491 | */libgfortran*.*) echo "$i" >> build/files.gfortran ;; |
---|
492 | %{!?with_pygdb:*/libstdc++*gdb.py*) rm ${RPM_BUILD_ROOT}/$i ;;} # ignore for now |
---|
493 | %{?with_pygdb:*/libstdc++*gdb.py*) >> build/files.g++ ;;} |
---|
494 | */libstdc++.*) echo "$i" >> build/files.g++ ;; |
---|
495 | */libsupc++.*) echo "$i" >> build/files.g++ ;; |
---|
496 | *) echo "$i" >> build/files.gcc ;; |
---|
497 | esac |
---|
498 | done |
---|
499 | |
---|
500 | TGTDIR="%{_exec_prefix}/i686-pc-cygwin/lib" |
---|
501 | f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
502 | for i in $f; do |
---|
503 | case $i in |
---|
504 | *lib*.la) rm ${RPM_BUILD_ROOT}/$i;; # ignore - gcc produces bogus libtool libs |
---|
505 | *libiberty.a) rm ${RPM_BUILD_ROOT}/$i ;; # ignore - GPL'ed |
---|
506 | # all other files belong to newlib |
---|
507 | *) echo "$i" >> build/files.newlib ;; |
---|
508 | esac |
---|
509 | done |
---|
510 | # Extract %%__os_install_post into os_install_post~ |
---|
511 | cat << \EOF > os_install_post~ |
---|
512 | %__os_install_post |
---|
513 | EOF |
---|
514 | |
---|
515 | # Generate customized brp-*scripts |
---|
516 | cat os_install_post~ | while read a x y; do |
---|
517 | case $a in |
---|
518 | # Prevent brp-strip* from trying to handle foreign binaries |
---|
519 | */brp-strip*) |
---|
520 | b=$(basename $a) |
---|
521 | sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b |
---|
522 | chmod a+x $b |
---|
523 | ;; |
---|
524 | esac |
---|
525 | done |
---|
526 | |
---|
527 | sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ |
---|
528 | < os_install_post~ > os_install_post |
---|
529 | %define __os_install_post . ./os_install_post |
---|
530 | |
---|
531 | |
---|
532 | cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides |
---|
533 | #!/bin/sh |
---|
534 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-cygwin/(lib|include|sys-root)' \ |
---|
535 | %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i686-pc-cygwin/'} | %__find_provides |
---|
536 | EOF |
---|
537 | chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides |
---|
538 | %define __find_provides %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides |
---|
539 | |
---|
540 | cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires |
---|
541 | #!/bin/sh |
---|
542 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-cygwin/(lib|include|sys-root)' \ |
---|
543 | %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i686-pc-cygwin/'} | %__find_requires |
---|
544 | EOF |
---|
545 | chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires |
---|
546 | %define __find_requires %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires |
---|
547 | |
---|
548 | %ifnarch noarch |
---|
549 | # Extract %%__debug_install_post into debug_install_post~ |
---|
550 | cat << \EOF > debug_install_post~ |
---|
551 | %__debug_install_post |
---|
552 | EOF |
---|
553 | |
---|
554 | # Generate customized debug_install_post script |
---|
555 | cat debug_install_post~ | while read a x y; do |
---|
556 | case $a in |
---|
557 | # Prevent find-debuginfo.sh* from trying to handle foreign binaries |
---|
558 | */find-debuginfo.sh) |
---|
559 | b=$(basename $a) |
---|
560 | sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b |
---|
561 | chmod a+x $b |
---|
562 | ;; |
---|
563 | esac |
---|
564 | done |
---|
565 | |
---|
566 | sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \ |
---|
567 | < debug_install_post~ > debug_install_post |
---|
568 | %define __debug_install_post . ./debug_install_post |
---|
569 | |
---|
570 | %endif |
---|
571 | |
---|
572 | %clean |
---|
573 | rm -rf $RPM_BUILD_ROOT |
---|
574 | |
---|
575 | # ============================================================== |
---|
576 | # i686-pc-cygwin-gcc |
---|
577 | # ============================================================== |
---|
578 | # %package -n i686-pc-cygwin-gcc |
---|
579 | # Summary: GNU cc compiler for i686-pc-cygwin |
---|
580 | # Group: Development/Tools |
---|
581 | # Version: %{gcc_rpmvers} |
---|
582 | # Requires: i686-pc-cygwin-binutils |
---|
583 | # License: GPL |
---|
584 | |
---|
585 | # %if %build_infos |
---|
586 | # Requires: gcc-common |
---|
587 | # %endif |
---|
588 | |
---|
589 | %description -n i686-pc-cygwin-gcc |
---|
590 | GNU cc compiler for i686-pc-cygwin. |
---|
591 | |
---|
592 | # ============================================================== |
---|
593 | # i686-pc-cygwin-gcc-libgcc |
---|
594 | # ============================================================== |
---|
595 | %package -n i686-pc-cygwin-gcc-libgcc |
---|
596 | Summary: libgcc for i686-pc-cygwin-gcc |
---|
597 | Group: Development/Tools |
---|
598 | Version: %{gcc_rpmvers} |
---|
599 | %{?_with_noarch_subpackages:BuildArch: noarch} |
---|
600 | License: GPL |
---|
601 | |
---|
602 | %description -n i686-pc-cygwin-gcc-libgcc |
---|
603 | libgcc i686-pc-cygwin-gcc. |
---|
604 | |
---|
605 | |
---|
606 | %files -n i686-pc-cygwin-gcc |
---|
607 | %defattr(-,root,root) |
---|
608 | |
---|
609 | %{_mandir}/man1/i686-pc-cygwin-gcc.1* |
---|
610 | %{_mandir}/man1/i686-pc-cygwin-cpp.1* |
---|
611 | %{_mandir}/man1/i686-pc-cygwin-gcov.1* |
---|
612 | |
---|
613 | %{_bindir}/i686-pc-cygwin-cpp%{_exeext} |
---|
614 | %{_bindir}/i686-pc-cygwin-gcc%{_exeext} |
---|
615 | %{_bindir}/i686-pc-cygwin-gcc-%{gcc_version}%{_exeext} |
---|
616 | %{_bindir}/i686-pc-cygwin-gcov%{_exeext} |
---|
617 | %{_bindir}/i686-pc-cygwin-gccbug |
---|
618 | |
---|
619 | %dir %{_libexecdir}/gcc |
---|
620 | %dir %{_libexecdir}/gcc/i686-pc-cygwin |
---|
621 | %dir %{_libexecdir}/gcc/i686-pc-cygwin/%{gcc_version} |
---|
622 | %{_libexecdir}/gcc/i686-pc-cygwin/%{gcc_version}/cc1%{_exeext} |
---|
623 | %{_libexecdir}/gcc/i686-pc-cygwin/%{gcc_version}/collect2%{_exeext} |
---|
624 | %if "%{gcc_version}" >= "4.5.0" |
---|
625 | %{?with_lto:%{_libexecdir}/gcc/i686-pc-cygwin/%{gcc_version}/lto%{_exeext}} |
---|
626 | %{_libexecdir}/gcc/i686-pc-cygwin/%{gcc_version}/lto-wrapper%{_exeext} |
---|
627 | %endif |
---|
628 | |
---|
629 | %files -n i686-pc-cygwin-gcc-libgcc -f build/files.gcc |
---|
630 | %defattr(-,root,root) |
---|
631 | %dir %{_gcclibdir}/gcc |
---|
632 | %dir %{_gcclibdir}/gcc/i686-pc-cygwin |
---|
633 | %dir %{_gcclibdir}/gcc/i686-pc-cygwin/%{gcc_version} |
---|
634 | %dir %{_gcclibdir}/gcc/i686-pc-cygwin/%{gcc_version}/include |
---|
635 | |
---|
636 | %if "%{gcc_version}" > "4.0.3" |
---|
637 | %dir %{_gcclibdir}/gcc/i686-pc-cygwin/%{gcc_version}/include/ssp |
---|
638 | %endif |
---|
639 | |
---|
640 | %if "%{gcc_version}" >= "4.3.0" |
---|
641 | %{_gcclibdir}/gcc/i686-pc-cygwin/%{gcc_version}/include-fixed |
---|
642 | %endif |
---|
643 | |
---|
644 | # ============================================================== |
---|
645 | # i686-pc-cygwin-gcc-c++ |
---|
646 | # ============================================================== |
---|
647 | %package -n i686-pc-cygwin-gcc-c++ |
---|
648 | Summary: GCC c++ compiler for i686-pc-cygwin |
---|
649 | Group: Development/Tools |
---|
650 | Version: %{gcc_rpmvers} |
---|
651 | License: GPL |
---|
652 | Requires: i686-pc-cygwin-gcc-libstdc++ = %{gcc_rpmvers}-%{release} |
---|
653 | |
---|
654 | %if "%{_build}" != "%{_host}" |
---|
655 | BuildRequires: i686-pc-cygwin-gcc-c++ = %{gcc_rpmvers} |
---|
656 | %endif |
---|
657 | |
---|
658 | Requires: i686-pc-cygwin-gcc = %{gcc_rpmvers}-%{release} |
---|
659 | |
---|
660 | %description -n i686-pc-cygwin-gcc-c++ |
---|
661 | GCC c++ compiler for i686-pc-cygwin. |
---|
662 | |
---|
663 | |
---|
664 | %package -n i686-pc-cygwin-gcc-libstdc++ |
---|
665 | Summary: libstdc++ for i686-pc-cygwin |
---|
666 | Group: Development/Tools |
---|
667 | Version: %{gcc_rpmvers} |
---|
668 | %{?_with_noarch_subpackages:BuildArch: noarch} |
---|
669 | License: GPL |
---|
670 | |
---|
671 | %description -n i686-pc-cygwin-gcc-libstdc++ |
---|
672 | %{summary} |
---|
673 | |
---|
674 | |
---|
675 | %files -n i686-pc-cygwin-gcc-c++ |
---|
676 | %defattr(-,root,root) |
---|
677 | |
---|
678 | %{_mandir}/man1/i686-pc-cygwin-g++.1* |
---|
679 | |
---|
680 | %{_bindir}/i686-pc-cygwin-c++%{_exeext} |
---|
681 | %{_bindir}/i686-pc-cygwin-g++%{_exeext} |
---|
682 | |
---|
683 | %dir %{_libexecdir}/gcc |
---|
684 | %dir %{_libexecdir}/gcc/i686-pc-cygwin |
---|
685 | %dir %{_libexecdir}/gcc/i686-pc-cygwin/%{gcc_version} |
---|
686 | %{_libexecdir}/gcc/i686-pc-cygwin/%{gcc_version}/cc1plus%{_exeext} |
---|
687 | |
---|
688 | |
---|
689 | %files -n i686-pc-cygwin-gcc-libstdc++ -f build/files.g++ |
---|
690 | %defattr(-,root,root) |
---|
691 | %dir %{_gcclibdir}/gcc |
---|
692 | %dir %{_gcclibdir}/gcc/i686-pc-cygwin |
---|
693 | %dir %{_gcclibdir}/gcc/i686-pc-cygwin/%{gcc_version} |
---|
694 | %dir %{_gcclibdir}/gcc/i686-pc-cygwin/%{gcc_version}/include |
---|
695 | %{_gcclibdir}/gcc/i686-pc-cygwin/%{gcc_version}/include/c++ |
---|
696 | |
---|
697 | |
---|
698 | |
---|