3 %bcond_with profiling # build with profiling
4 %bcond_without bootstrap # omit 3-stage bootstrap
5 %bcond_with tests # torture gcc
7 %if %{without bootstrap}
8 %undefine with_profiling
11 Summary: GNU Compiler Collection: the C compiler and shared files
12 Summary(es): Colección de compiladores GNU: el compilador C y ficheros compartidos
13 Summary(pl): Kolekcja kompilatorów GNU: kompilator C i pliki wspó³dzielone
14 Summary(pt_BR): Coleção dos compiladores GNU: o compilador C e arquivos compartilhados
21 Group: Development/Languages
22 Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{version}/%{sname}-%{version}.tar.bz2
23 # Source0-md5: ad9f97a4d04982ccf4fd67cb464879f3
24 Source1: %{name}-optimize-la.pl
25 Patch0: %{name}-info.patch
26 Patch1: %{name}-nolocalefiles.patch
27 Patch2: %{name}-nodebug.patch
28 Patch3: %{name}-ada-link.patch
29 Patch4: %{name}-sparc64-ada_fix.patch
30 Patch5: %{name}-alpha-ada_fix.patch
31 # -fvisibility fixes...
32 Patch6: %{name}-pr19664_gnu_internal.patch
33 Patch7: %{name}-pr19664_libstdc++.patch
34 Patch8: %{name}-pr20218.patch
37 Patch10: %{name}-pr7776.patch
38 Patch11: %{name}-pr19606.patch
39 Patch12: %{name}-pr24879.patch
40 Patch13: %{name}-pr26435-pr20256.patch
42 Patch17: %{name}-pr19505.patch
43 Patch18: %{name}-pr24419.patch
44 Patch19: %{name}-pr24669.patch
45 Patch20: %{name}-pr17390.patch
46 Patch21: %{name}-pr13676.patch
47 Patch22: %{name}-pr25626.patch
48 Patch23: %{name}-libstdcxx-bitset.patch
50 Patch25: %{name}-libjava-multilib.patch
51 Patch26: %{name}-ppc64-m32-m64-multilib-only.patch
52 Patch27: %{name}-enable-java-awt-qt.patch
54 # 128-bit long double support for glibc 2.4
55 Patch30: %{name}-ldbl-default-libstdc++.patch
56 Patch31: %{name}-ldbl-default.patch
58 URL: http://gcc.gnu.org/
59 BuildRequires: autoconf
60 %{?with_tests:BuildRequires: autogen}
61 BuildRequires: automake
62 # binutils 2.16.91 or newer are required for compiling medium model now
63 BuildRequires: binutils >= 2:2.16.91.0.1
65 BuildRequires: chrpath >= 0.10
66 %{?with_tests:BuildRequires: dejagnu}
67 BuildRequires: fileutils >= 4.0.41
69 BuildRequires: gettext-devel
70 BuildRequires: glibc-devel >= 6:2.3
71 BuildRequires: perl-base
72 BuildRequires: rpmbuild(macros) >= 1.211
73 BuildRequires: texinfo >= 4.1
74 BuildRequires: zlib-devel
75 # AS_NEEDED directive for dynamic linker
76 # http://sources.redhat.com/ml/glibc-cvs/2005-q1/msg00614.html
77 # http://sources.redhat.com/ml/binutils/2005-01/msg00288.html
78 Requires: binutils >= 2:2.16.90.0.1-0.3
79 Requires: libgcc4 = %{epoch}:%{version}-%{release}
80 Provides: cpp4 = %{epoch}:%{version}-%{release}
81 BuildRoot: %{tmpdir}/%{sname}-%{version}-root-%(id -u -n)
83 %define _slibdir /%{_lib}
86 A compiler aimed at integrating all the optimizations and features
87 necessary for a high-performance and stable development environment.
89 This package contains the C compiler and some files shared by various
90 parts of the GNU Compiler Collection. In order to use another GCC
91 compiler you will need to install the appropriate subpackage.
94 Un compilador que intenta integrar todas las optimalizaciones y
95 características necesarias para un entorno de desarrollo eficaz y
98 Este paquete contiene el compilador de C y unos ficheros compartidos
99 por varias partes de la colección de compiladores GNU (GCC). Para usar
100 otro compilador de GCC será necesario que instale el subpaquete
104 Kompilator, posiadaj±cy du¿e mo¿liwo¶ci optymalizacyjne niezbêdne do
105 wyprodukowania szybkiego i stabilnego kodu wynikowego.
107 Ten pakiet zawiera kompilator C i pliki wspó³dzielone przez ró¿ne
108 czê¶ci kolekcji kompilatorów GNU (GCC). ¯eby u¿ywaæ innego kompilatora
109 z GCC, trzeba zainstalowaæ odpowiedni podpakiet.
111 %description -l pt_BR
112 Este pacote adiciona infraestrutura básica e suporte a linguagem C ao
113 GNU Compiler Collection.
116 Summary: Shared gcc library
117 Summary(es): Biblioteca compartida de gcc
118 Summary(pl): Biblioteka gcc
119 Summary(pt_BR): Biblioteca runtime para o GCC
120 License: GPL with unlimited link permission
123 %description -n libgcc4
126 %description -n libgcc4 -l es
127 Biblioteca compartida de gcc.
129 %description -n libgcc4 -l pl
130 Biblioteka dynamiczna gcc.
132 %description -n libgcc4 -l pt_BR
133 Biblioteca runtime para o GCC.
136 %setup -q -n gcc-%{version}
145 # -fvisbility fixes...
171 # because we distribute modified version of gcc...
172 sed -i 's:#define VERSUFFIX.*:#define VERSUFFIX " (PLD-Linux)":' gcc/version.c
173 perl -pi -e 's@(bug_report_url.*<URL:).*";@$1http://bugs.pld-linux.org/>";@' gcc/version.c
175 mv ChangeLog ChangeLog.general
186 cp -f /usr/share/automake/config.sub .
188 rm -rf builddir && install -d builddir && cd builddir
190 CFLAGS="%{rpmcflags}" \
191 CXXFLAGS="%{rpmcxxflags}" \
194 --program-suffix="4" \
195 --prefix=%{_prefix} \
196 --with-local-prefix=%{_prefix}/local \
197 --libdir=%{_libdir} \
198 --libexecdir=%{_libdir} \
199 --infodir=%{_infodir} \
200 --mandir=%{_mandir} \
201 --x-libraries=%{_libdir} \
203 --enable-threads=posix \
204 --enable-languages="c" \
211 --with-demangler-in-ld \
213 --with-slibdir=%{_slibdir} \
215 --without-system-libunwind \
217 --with-system-libunwind \
220 --with-long-double-128 \
229 %{__make} -C builddir \
230 %{?with_bootstrap:%{?with_profiling:profiled}bootstrap} \
231 GCJFLAGS="%{rpmcflags}" \
232 BOOT_CFLAGS="%{rpmcflags}" \
233 STAGE1_CFLAGS="%{rpmcflags} -O0" \
234 GNATLIBCFLAGS="%{rpmcflags}" \
235 LDFLAGS_FOR_TARGET="%{rpmldflags}" \
239 %{?with_tests:%{__make} -k -C builddir check 2>&1 ||:}
242 rm -rf $RPM_BUILD_ROOT
243 install -d $RPM_BUILD_ROOT{/lib,%{_aclocaldir},%{_datadir},%{_infodir}}
247 %{__make} -j1 install \
249 infodir=%{_infodir} \
250 DESTDIR=$RPM_BUILD_ROOT
252 install gcc/specs $RPM_BUILD_ROOT%{_libdir}/gcc/%{_target_platform}/%{version}
255 ln -sf %{_bindir}/sparc64-pld-linux-gcc4 \
256 $RPM_BUILD_ROOT%{_bindir}/sparc-pld-linux-gcc4
259 ln -sf %{_bindir}/cpp4 $RPM_BUILD_ROOT/lib/cpp4
260 ln -sf gcc4 $RPM_BUILD_ROOT%{_bindir}/cc4
261 echo ".so gcc4.1" > $RPM_BUILD_ROOT%{_mandir}/man1/cc4.1
263 libssp=$(cd $RPM_BUILD_ROOT%{_libdir}; echo libssp.so.*.*.*)
264 mv $RPM_BUILD_ROOT{%{_libdir}/$libssp,%{_slibdir}}
265 ln -sf %{_slibdir}/$libssp $RPM_BUILD_ROOT%{_libdir}/libssp.so
269 # include/ contains install-tools/include/* and headers that were fixed up
270 # by fixincludes, we don't want former
271 gccdir=$(echo $RPM_BUILD_ROOT%{_libdir}/gcc/*/*/)
274 # we have to save these however
275 mv $gccdir/include/syslimits.h $gccdir/tmp
276 mv $gccdir/include/ssp $gccdir/tmp
277 rm -rf $gccdir/include
278 mv $gccdir/tmp $gccdir/include
279 cp $gccdir/install-tools/include/*.h $gccdir/include
280 # but we don't want anything more from install-tools
281 rm -rf $gccdir/install-tools
285 cat cpplib.lang >> gcc.lang
287 # cvs snap doesn't contain (release does) below files,
288 # so let's create dummy entries to satisfy %%files.
289 [ ! -f NEWS ] && touch NEWS
290 [ ! -f libgfortran/AUTHORS ] && touch libgfortran/AUTHORS
291 [ ! -f libgfortran/README ] && touch libgfortran/README
294 rm -rf $RPM_BUILD_ROOT
297 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
300 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
302 %post -p /sbin/ldconfig -n libgcc4
303 %postun -p /sbin/ldconfig -n libgcc4
306 %defattr(644,root,root,755)
307 %doc ChangeLog.general MAINTAINERS NEWS
309 %doc gcc/{ChangeLog,ONEWS,README.Portability}
311 %dir %{_libdir}/gcc/*
312 %dir %{_libdir}/gcc/*/*
313 %dir %{_libdir}/gcc/*/*/include
314 %dir %{_libdir}/gcc/*/*/include/ssp
316 %attr(755,root,root) %{_bindir}/*-gcc*
317 %attr(755,root,root) %{_bindir}/gcc4
318 %attr(755,root,root) %{_bindir}/gccbug4
319 %attr(755,root,root) %{_bindir}/gcov4
320 %attr(755,root,root) %{_bindir}/cc4
321 %attr(755,root,root) %{_bindir}/cpp4
323 %{_mandir}/man1/cc4.1*
324 %{_mandir}/man1/cpp4.1*
325 %{_mandir}/man1/gcc4.1*
326 %{_mandir}/man1/gcov4.1*
328 %attr(755,root,root) /lib/cpp4
330 %attr(755,root,root) %{_slibdir}/lib*.so
333 %attr(755,root,root) %{_libdir}/libssp.so
334 %{_libdir}/libssp_nonshared.a
335 %{_libdir}/libssp_nonshared.la
336 %{_libdir}/gcc/*/*/libgcov.a
337 %{_libdir}/gcc/*/*/libgcc.a
338 %{_libdir}/gcc/*/*/libgcc_eh.a
339 %{_libdir}/gcc/*/*/specs
340 %{_libdir}/gcc/*/*/crt*.o
341 %attr(755,root,root) %{_libdir}/gcc/*/*/cc1
342 %attr(755,root,root) %{_libdir}/gcc/*/*/collect2
344 %{_libdir}/gcc/*/*/include/*.h
345 %{_libdir}/gcc/*/*/include/ssp/*.h
348 %defattr(644,root,root,755)
349 %attr(755,root,root) %{_slibdir}/lib*.so.*