]> git.pld-linux.org Git - packages/gcc4.git/blob - gcc4.spec
- disable multilib
[packages/gcc4.git] / gcc4.spec
1 #
2 # Conditional build:
3 %bcond_with     profiling       # build with profiling
4 %bcond_without  bootstrap       # omit 3-stage bootstrap
5 %bcond_with     tests           # torture gcc
6
7 %if %{without bootstrap}
8 %undefine       with_profiling
9 %endif
10
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
15 %define sname   gcc
16 Name:           %{sname}4
17 Version:        4.1.1
18 Release:        1
19 Epoch:          5
20 License:        GPL v2+
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
35
36 # PRs
37 Patch10:        %{name}-pr7776.patch
38 Patch11:        %{name}-pr19606.patch
39 Patch12:        %{name}-pr24879.patch
40 Patch13:        %{name}-pr26435-pr20256.patch
41
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
49
50 Patch25:        %{name}-libjava-multilib.patch
51 Patch26:        %{name}-ppc64-m32-m64-multilib-only.patch
52 Patch27:        %{name}-enable-java-awt-qt.patch
53
54 # 128-bit long double support for glibc 2.4
55 Patch30:        %{name}-ldbl-default-libstdc++.patch
56 Patch31:        %{name}-ldbl-default.patch
57
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
64 BuildRequires:  bison
65 BuildRequires:  chrpath >= 0.10
66 %{?with_tests:BuildRequires:    dejagnu}
67 BuildRequires:  fileutils >= 4.0.41
68 BuildRequires:  flex
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)
82
83 %define         _slibdir        /%{_lib}
84
85 %description
86 A compiler aimed at integrating all the optimizations and features
87 necessary for a high-performance and stable development environment.
88
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.
92
93 %description -l es
94 Un compilador que intenta integrar todas las optimalizaciones y
95 características necesarias para un entorno de desarrollo eficaz y
96 estable.
97
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
101 adecuado.
102
103 %description -l pl
104 Kompilator, posiadaj±cy du¿e mo¿liwo¶ci optymalizacyjne niezbêdne do
105 wyprodukowania szybkiego i stabilnego kodu wynikowego.
106
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.
110
111 %description -l pt_BR
112 Este pacote adiciona infraestrutura básica e suporte a linguagem C ao
113 GNU Compiler Collection.
114
115 %package -n libgcc4
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
121 Group:          Libraries
122
123 %description -n libgcc4
124 Shared gcc library.
125
126 %description -n libgcc4 -l es
127 Biblioteca compartida de gcc.
128
129 %description -n libgcc4 -l pl
130 Biblioteka dynamiczna gcc.
131
132 %description -n libgcc4 -l pt_BR
133 Biblioteca runtime para o GCC.
134
135 %prep
136 %setup -q -n gcc-%{version}
137
138 %patch0 -p1
139 %patch1 -p1
140 %patch2 -p1
141 %patch3 -p1
142 %patch4 -p1
143 %patch5 -p1
144
145 # -fvisbility fixes...
146 %patch6 -p1
147 %patch7 -p1
148 %patch8 -p1
149
150 # PRs
151 %patch10 -p1
152 %patch11 -p0
153 %patch12 -p0
154 %patch13 -p1
155
156 %patch17 -p1
157 %patch18 -p1
158 %patch19 -p1
159 %patch20 -p1
160 %patch21 -p1
161 %patch22 -p1
162 %patch23 -p1
163
164 %patch25 -p1
165 %patch26 -p1
166 %patch27 -p1
167
168 %patch30 -p0
169 %patch31 -p0
170
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
174
175 mv ChangeLog ChangeLog.general
176
177 %build
178 cd gcc
179 %{__autoconf}
180 cd ..
181 cd libjava
182 %{__autoconf}
183 cd classpath
184 %{__autoconf}
185 cd ../..
186 cp -f /usr/share/automake/config.sub .
187
188 rm -rf builddir && install -d builddir && cd builddir
189
190 CFLAGS="%{rpmcflags}" \
191 CXXFLAGS="%{rpmcxxflags}" \
192 TEXCONFIG=false \
193 ../configure \
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} \
202         --enable-shared \
203         --enable-threads=posix \
204         --enable-languages="c" \
205         --enable-c99 \
206         --enable-long-long \
207         --enable-nls \
208         --disable-werror \
209         --with-gnu-as \
210         --with-gnu-ld \
211         --with-demangler-in-ld \
212         --with-system-zlib \
213         --with-slibdir=%{_slibdir} \
214 %ifnarch ia64
215         --without-system-libunwind \
216 %else
217         --with-system-libunwind \
218 %endif
219         --without-x \
220         --with-long-double-128 \
221 %ifarch ppc ppc64
222         --enable-secureplt \
223 %endif
224         --disable-multilib \
225         %{_target_platform}
226
227 cd ..
228
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}" \
236         mandir=%{_mandir} \
237         infodir=%{_infodir}
238
239 %{?with_tests:%{__make} -k -C builddir check 2>&1 ||:}
240
241 %install
242 rm -rf $RPM_BUILD_ROOT
243 install -d $RPM_BUILD_ROOT{/lib,%{_aclocaldir},%{_datadir},%{_infodir}}
244
245 cd builddir
246
247 %{__make} -j1 install \
248         mandir=%{_mandir} \
249         infodir=%{_infodir} \
250         DESTDIR=$RPM_BUILD_ROOT
251
252 install gcc/specs $RPM_BUILD_ROOT%{_libdir}/gcc/%{_target_platform}/%{version}
253
254 %ifarch sparc64
255 ln -sf  %{_bindir}/sparc64-pld-linux-gcc4 \
256         $RPM_BUILD_ROOT%{_bindir}/sparc-pld-linux-gcc4
257 %endif
258
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
262
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
266
267 cd ..
268
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/*/*/)
272 mkdir   $gccdir/tmp
273
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
282
283 %find_lang gcc
284 %find_lang cpplib
285 cat cpplib.lang >> gcc.lang
286
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
292
293 %clean
294 rm -rf $RPM_BUILD_ROOT
295
296 %post
297 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
298
299 %postun
300 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
301
302 %post   -p /sbin/ldconfig -n libgcc4
303 %postun -p /sbin/ldconfig -n libgcc4
304
305 %files
306 %defattr(644,root,root,755)
307 %doc ChangeLog.general MAINTAINERS NEWS
308 # bugs.html faq.html
309 %doc gcc/{ChangeLog,ONEWS,README.Portability}
310 %dir %{_libdir}/gcc
311 %dir %{_libdir}/gcc/*
312 %dir %{_libdir}/gcc/*/*
313 %dir %{_libdir}/gcc/*/*/include
314 %dir %{_libdir}/gcc/*/*/include/ssp
315
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
322
323 %{_mandir}/man1/cc4.1*
324 %{_mandir}/man1/cpp4.1*
325 %{_mandir}/man1/gcc4.1*
326 %{_mandir}/man1/gcov4.1*
327
328 %attr(755,root,root) /lib/cpp4
329
330 %attr(755,root,root) %{_slibdir}/lib*.so
331 %{_libdir}/libssp.a
332 %{_libdir}/libssp.la
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
343
344 %{_libdir}/gcc/*/*/include/*.h
345 %{_libdir}/gcc/*/*/include/ssp/*.h
346
347 %files -n libgcc4
348 %defattr(644,root,root,755)
349 %attr(755,root,root) %{_slibdir}/lib*.so.*
This page took 0.519466 seconds and 3 git commands to generate.