]>
Commit | Line | Data |
---|---|---|
a3bdc2a1 | 1 | # |
83afd976 ŁK |
2 | # TODO: |
3 | # - restore languages other than c, c++ | |
4 | # - openmp | |
5 | # | |
a3bdc2a1 | 6 | # Conditional build: |
a09cdaa3 | 7 | %bcond_with bootstrap # bootstrap build (using binary w32api/mingw) |
a3bdc2a1 | 8 | # |
9dd4c848 | 9 | Summary: Cross Mingw32 GNU binary utility development utilities - gcc |
34f34e0d ER |
10 | Summary(es.UTF-8): Utilitarios para desarrollo de binarios de la GNU - Mingw32 gcc |
11 | Summary(fr.UTF-8): Utilitaires de développement binaire de GNU - Mingw32 gcc | |
12 | Summary(pl.UTF-8): Skrośne narzędzia programistyczne GNU dla Mingw32 - gcc | |
13 | Summary(pt_BR.UTF-8): Utilitários para desenvolvimento de binários da GNU - Mingw32 gcc | |
14 | Summary(tr.UTF-8): GNU geliştirme araçları - Mingw32 gcc | |
b336056d | 15 | Name: crossmingw32-gcc |
83afd976 ŁK |
16 | Version: 4.5.1 |
17 | Release: 1 | |
d3f237e2 | 18 | Epoch: 1 |
d81c803d | 19 | License: GPL v2+ |
d3f237e2 | 20 | Group: Development/Languages |
dee9b92f | 21 | Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{version}/gcc-%{version}.tar.bz2 |
83afd976 | 22 | # Source0-md5: 48231a8e33ed6e058a341c53b819de1a |
d81c803d | 23 | %define apiver 3.10 |
dee9b92f | 24 | Source1: http://dl.sourceforge.net/mingw/w32api-%{apiver}.tar.gz |
d81c803d JB |
25 | # Source1-md5: 7067a6b3ac9d94bb753f9f6f37e2033c |
26 | %define runver 3.13 | |
dee9b92f | 27 | Source2: http://dl.sourceforge.net/mingw/mingw-runtime-%{runver}.tar.gz |
d81c803d | 28 | # Source2-md5: 22179021f41d5eee76447b78fb94a3fb |
83afd976 ŁK |
29 | # svn diff -x --ignore-eol-style svn://gcc.gnu.org/svn/gcc/tags/gcc_4_5_1_release svn://gcc.gnu.org/svn/gcc/branches/gcc-4_5-branch > gcc-branch.diff |
30 | Patch100: gcc-branch.diff | |
31 | Patch0: %{name}-buildsystem1.patch | |
32 | Patch1: %{name}-buildsystem2.patch | |
33 | Patch2: %{name}-lfs.patch | |
d12aabe0 | 34 | BuildRequires: autoconf |
59d75dd2 | 35 | BuildRequires: automake |
d12aabe0 | 36 | BuildRequires: bison |
43a95438 | 37 | BuildRequires: crossmingw32-binutils >= 2.15.91.0.2-2 |
b336056d | 38 | BuildRequires: flex |
83afd976 | 39 | BuildRequires: libmpc-devel |
5b936a1d | 40 | %if %{without bootstrap} |
43a95438 JK |
41 | BuildRequires: crossmingw32-runtime >= 3.5 |
42 | BuildRequires: crossmingw32-w32api >= 3.1 | |
b399bc1a | 43 | %endif |
f24c8266 | 44 | BuildRequires: mpfr-devel |
d81c803d | 45 | BuildRequires: texinfo >= 4.2 |
43a95438 | 46 | Requires: crossmingw32-binutils >= 2.15.91.0.2-2 |
6ab368b0 | 47 | Requires: gcc-dirs |
b336056d JB |
48 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
49 | ||
d3f237e2 | 50 | %define target i386-mingw32 |
d3f237e2 | 51 | %define arch %{_prefix}/%{target} |
a0d467f7 | 52 | %define gccarch %{_libdir}/gcc/%{target} |
dee9b92f PS |
53 | %define gcclib %{gccarch}/%{version} |
54 | ||
5b936a1d | 55 | %define _noautostrip .*/lib.*\\.a |
b336056d | 56 | |
66f480ce JP |
57 | %define _enable_debug_packages 0 |
58 | ||
b336056d JB |
59 | %description |
60 | crossmingw32 is a complete cross-compiling development system for | |
61 | building stand-alone Microsoft Windows applications under Linux using | |
62 | the Mingw32 build libraries. This includes a binutils, gcc with g++ | |
63 | and objc, and libstdc++, all cross targeted to i386-mingw32, along | |
64 | with supporting Win32 libraries in 'coff' format from free sources. | |
65 | ||
d3f237e2 | 66 | This package contains cross targeted gcc. |
b336056d | 67 | |
4a6c89d0 | 68 | %description -l de.UTF-8 |
69 | Dieses Paket enthält einen Cross-gcc, der es erlaubt, auf einem | |
70 | anderem Rechner Code für Win32 zu generieren. | |
9dd4c848 | 71 | |
4a6c89d0 | 72 | %description -l pl.UTF-8 |
73 | crossmingw32 jest kompletnym systemem do kompilacji skrośnej, | |
74 | pozwalającym budować aplikacje MS Windows pod Linuksem używając | |
75 | bibliotek Mingw32. System składa się z binutils, gcc z g++ i objc, | |
76 | libstdc++ - wszystkie generujące kod dla platformy i386-mingw32, oraz | |
2e5b9011 | 77 | z bibliotek w formacie COFF. |
d790a8ba | 78 | |
4a6c89d0 | 79 | Ten pakiet zawiera gcc generujące skrośnie kod dla Win32. |
d790a8ba | 80 | |
d3f237e2 | 81 | %package c++ |
2e5b9011 | 82 | Summary: Mingw32 binary utility development utilities - g++ |
34f34e0d | 83 | Summary(pl.UTF-8): Zestaw narzędzi mingw32 - g++ |
d3f237e2 | 84 | Group: Development/Languages |
cae974d4 | 85 | Requires: %{name} = %{epoch}:%{version}-%{release} |
b336056d | 86 | |
d3f237e2 JB |
87 | %description c++ |
88 | crossmingw32 is a complete cross-compiling development system for | |
89 | building stand-alone Microsoft Windows applications under Linux using | |
90 | the Mingw32 build libraries. This includes a binutils, gcc with g++ | |
91 | and objc, and libstdc++, all cross targeted to i386-mingw32, along | |
92 | with supporting Win32 libraries in 'coff' format from free sources. | |
93 | ||
94 | This package contains cross targeted g++ and (static) libstdc++. | |
95 | ||
4a6c89d0 | 96 | %description c++ -l pl.UTF-8 |
97 | crossmingw32 jest kompletnym systemem do kompilacji skrośnej, | |
98 | pozwalającym budować aplikacje MS Windows pod Linuksem używając | |
99 | bibliotek mingw32. System składa się z binutils, gcc z g++ i objc, | |
100 | libstdc++ - wszystkie generujące kod dla platformy i386-mingw32, oraz | |
2e5b9011 | 101 | z bibliotek w formacie COFF. |
d790a8ba | 102 | |
4a6c89d0 | 103 | Ten pakiet zawiera g++ generujące kod pod Win32 oraz bibliotekę |
d790a8ba JB |
104 | libstdc++. |
105 | ||
83afd976 ŁK |
106 | # no obj-c, fortran, java for the moment |
107 | %if 0 | |
d3f237e2 JB |
108 | # does this even work? |
109 | %package objc | |
2e5b9011 | 110 | Summary: Mingw32 binary utility development utilities - objc |
34f34e0d | 111 | Summary(pl.UTF-8): Zestaw narzędzi mingw32 - objc |
d3f237e2 | 112 | Group: Development/Languages |
cae974d4 | 113 | Requires: %{name} = %{epoch}:%{version}-%{release} |
d3f237e2 JB |
114 | |
115 | %description objc | |
116 | crossmingw32 is a complete cross-compiling development system for | |
117 | building stand-alone Microsoft Windows applications under Linux using | |
118 | the Mingw32 build libraries. This includes a binutils, gcc with g++ | |
119 | and objc, and libstdc++, all cross targeted to i386-mingw32, along | |
120 | with supporting Win32 libraries in 'coff' format from free sources. | |
121 | ||
37948e2b | 122 | This package contains cross targeted objc compiler. |
d3f237e2 | 123 | |
4a6c89d0 | 124 | %description objc -l pl.UTF-8 |
125 | crossmingw32 jest kompletnym systemem do kompilacji skrośnej, | |
126 | pozwalającym budować aplikacje MS Windows pod Linuksem używając | |
127 | bibliotek mingw32. System składa się z binutils, gcc z g++ i objc, | |
128 | libstdc++ - wszystkie generujące kod dla platformy i386-mingw32, oraz | |
2e5b9011 | 129 | z bibliotek w formacie COFF. |
d790a8ba | 130 | |
4a6c89d0 | 131 | Ten pakiet zawiera kompilator objc generujący kod pod Win32. |
d790a8ba | 132 | |
d3f237e2 | 133 | # does this even work? |
52a544a1 | 134 | %package fortran |
37948e2b | 135 | Summary: Mingw32 binary utility development utilities - Fortran |
34f34e0d | 136 | Summary(pl.UTF-8): Zestaw narzędzi mingw32 - Fortran |
d3f237e2 | 137 | Group: Development/Languages |
cae974d4 | 138 | Requires: %{name} = %{epoch}:%{version}-%{release} |
37948e2b | 139 | Obsoletes: crossmingw32-gcc-g77 |
d3f237e2 | 140 | |
52a544a1 | 141 | %description fortran |
d3f237e2 JB |
142 | crossmingw32 is a complete cross-compiling development system for |
143 | building stand-alone Microsoft Windows applications under Linux using | |
144 | the Mingw32 build libraries. This includes a binutils, gcc with g++ | |
145 | and objc, and libstdc++, all cross targeted to i386-mingw32, along | |
146 | with supporting Win32 libraries in 'coff' format from free sources. | |
147 | ||
37948e2b | 148 | This package contains cross targeted Fortran compiler. |
d3f237e2 | 149 | |
4a6c89d0 | 150 | %description fortran -l pl.UTF-8 |
151 | crossmingw32 jest kompletnym systemem do kompilacji skrośnej, | |
152 | pozwalającym budować aplikacje MS Windows pod Linuksem używając | |
153 | bibliotek mingw32. System składa się z binutils, gcc z g++ i objc, | |
154 | libstdc++ - wszystkie generujące kod dla platformy i386-mingw32, oraz | |
2e5b9011 | 155 | z bibliotek w formacie COFF. |
d790a8ba | 156 | |
4a6c89d0 | 157 | Ten pakiet zawiera kompilator Fortranu generujący kod pod Win32. |
d790a8ba | 158 | |
d3f237e2 JB |
159 | # does this even work? |
160 | %package java | |
37948e2b | 161 | Summary: Mingw32 binary utility development utilities - Java |
34f34e0d | 162 | Summary(pl.UTF-8): Zestaw narzędzi mingw32 - Java |
d3f237e2 | 163 | Group: Development/Languages |
cae974d4 | 164 | Requires: %{name} = %{epoch}:%{version}-%{release} |
d3f237e2 JB |
165 | |
166 | %description java | |
167 | crossmingw32 is a complete cross-compiling development system for | |
168 | building stand-alone Microsoft Windows applications under Linux using | |
169 | the Mingw32 build libraries. This includes a binutils, gcc with g++ | |
170 | and objc, and libstdc++, all cross targeted to i386-mingw32, along | |
171 | with supporting Win32 libraries in 'coff' format from free sources. | |
172 | ||
37948e2b | 173 | This package contains cross targeted Java compiler. |
d3f237e2 | 174 | |
4a6c89d0 | 175 | %description java -l pl.UTF-8 |
2e5b9011 | 176 | |
4a6c89d0 | 177 | crossmingw32 jest kompletnym systemem do kompilacji skrośnej, |
178 | pozwalającym budować aplikacje MS Windows pod Linuksem używając | |
179 | bibliotek mingw32. System składa się z binutils, gcc z g++ i objc, | |
180 | libstdc++ - wszystkie generujące kod dla platformy i386-mingw32, oraz | |
2e5b9011 | 181 | z bibliotek w formacie COFF. |
d790a8ba | 182 | |
4a6c89d0 | 183 | Ten pakiet zawiera kompilator Javy generujący kod pod Win32. |
83afd976 | 184 | %endif |
d790a8ba | 185 | |
d3f237e2 | 186 | %prep |
dee9b92f | 187 | %setup -q -n gcc-%{version} |
83afd976 ŁK |
188 | %patch100 -p0 |
189 | %patch0 -p1 | |
190 | %patch2 -p1 | |
191 | ||
b399bc1a AF |
192 | %if %{with bootstrap} |
193 | mkdir winsup | |
194 | tar xzf %{SOURCE1} -C winsup | |
195 | tar xzf %{SOURCE2} -C winsup | |
196 | %endif | |
83afd976 ŁK |
197 | |
198 | # override snapshot version. | |
199 | echo %{version} > gcc/BASE-VER | |
200 | echo "release" > gcc/DEV-PHASE | |
b336056d JB |
201 | |
202 | %build | |
b399bc1a AF |
203 | %if %{with bootstrap} |
204 | for tool in as ar dlltool ld nm ranlib strip ; do | |
205 | ln -sf %{arch}/bin/$tool winsup/bin/$tool | |
206 | done | |
b399bc1a AF |
207 | %endif |
208 | ||
83afd976 | 209 | rm -rf builddir && install -d builddir && cd builddir |
b336056d | 210 | |
83afd976 | 211 | CC="%{__cc}" \ |
b4c37c30 | 212 | CFLAGS="%{rpmcflags}" \ |
83afd976 | 213 | CXXFLAGS="%{rpmcxxflags}" \ |
b4c37c30 | 214 | TEXCONFIG=false \ |
b336056d | 215 | ../configure \ |
83afd976 | 216 | --prefix=%{arch} \ |
b336056d JB |
217 | --infodir=%{_infodir} \ |
218 | --mandir=%{_mandir} \ | |
83afd976 ŁK |
219 | --with-headers=%{arch}/include \ |
220 | --with-libs=%{arch}/lib \ | |
221 | --with-build-time-tools=%{arch}/bin \ | |
222 | --with-dwarf2 \ | |
223 | --with-gnu-as \ | |
224 | --with-gnu-ld \ | |
225 | --with-mangler-in-ld \ | |
226 | --with-long-double-128 \ | |
0dcd3a97 | 227 | --enable-threads \ |
83afd976 | 228 | --enable-languages="c,c++" \ |
0dcd3a97 PS |
229 | --enable-c99 \ |
230 | --enable-long-long \ | |
83afd976 ŁK |
231 | --enable-fully-dynamic-string \ |
232 | --enable-libstdcxx-allocator=new \ | |
233 | --enable-version-specific-runtime-libs \ | |
234 | --enable-shared \ | |
0dcd3a97 | 235 | --disable-nls \ |
83afd976 ŁK |
236 | --disable-symvers \ |
237 | --disable-sjlj-exceptions \ | |
238 | --disable-win32-registry \ | |
239 | --disable-multilib \ | |
240 | --disable-libssp \ | |
b336056d JB |
241 | --target=%{target} |
242 | ||
83afd976 ŁK |
243 | cd .. |
244 | %{__make} -C builddir all-host | |
245 | patch -p1 <%{PATCH1} | |
246 | %{__make} -C builddir | |
b336056d JB |
247 | |
248 | %install | |
b336056d | 249 | rm -rf $RPM_BUILD_ROOT |
dee9b92f | 250 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}} |
b336056d | 251 | |
83afd976 | 252 | %{__make} -C builddir install \ |
d12aabe0 | 253 | DESTDIR=$RPM_BUILD_ROOT |
b336056d | 254 | |
d12aabe0 | 255 | %if 0%{!?debug:1} |
dee9b92f | 256 | %{target}-strip -g -R.note -R.comment $RPM_BUILD_ROOT%{arch}/lib/lib*.a |
d12aabe0 JB |
257 | %endif |
258 | ||
259 | # restore hardlinks | |
83afd976 ŁK |
260 | ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-gcc $RPM_BUILD_ROOT%{_bindir}/%{target}-gcc |
261 | ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-g++ $RPM_BUILD_ROOT%{_bindir}/%{target}-g++ | |
262 | ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-cpp $RPM_BUILD_ROOT%{_bindir}/%{target}-cpp | |
263 | ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-gcov $RPM_BUILD_ROOT%{_bindir}/%{target}-gcov | |
264 | ||
265 | install -d $RPM_BUILD_ROOT%{_libdir} | |
266 | install -d $RPM_BUILD_ROOT%{_libdir}/gcc | |
d12aabe0 | 267 | |
83afd976 ŁK |
268 | cp -r $RPM_BUILD_ROOT%{arch}/libexec/gcc/%{target} $RPM_BUILD_ROOT%{_libdir}/gcc |
269 | cp -r $RPM_BUILD_ROOT%{arch}/lib/gcc/%{target} $RPM_BUILD_ROOT%{_libdir}/gcc | |
270 | rm -rf $RPM_BUILD_ROOT%{_libdir}/gcc/%{target}/%{version}/install-tools | |
271 | rm -rf $RPM_BUILD_ROOT%{arch}/libexec | |
272 | rm -rf $RPM_BUILD_ROOT%{arch}/lib/gcc | |
b336056d | 273 | |
83afd976 ŁK |
274 | mv -f $RPM_BUILD_ROOT%{_libdir}/gcc/%{target}/%{version}/cc1 $RPM_BUILD_ROOT%{arch}/bin/cc1 |
275 | mv -f $RPM_BUILD_ROOT%{_libdir}/gcc/%{target}/%{version}/cc1plus $RPM_BUILD_ROOT%{arch}/bin/cc1plus | |
276 | mv -f $RPM_BUILD_ROOT%{_libdir}/gcc/%{target}/%{version}/collect2 $RPM_BUILD_ROOT%{arch}/bin/collect2 | |
277 | ||
278 | install builddir/i386-mingw32/libgcc/shlib/libgcc_s_dw2-1.dll $RPM_BUILD_ROOT%{arch}/bin | |
b336056d | 279 | %clean |
b336056d JB |
280 | rm -rf $RPM_BUILD_ROOT |
281 | ||
282 | %files | |
283 | %defattr(644,root,root,755) | |
83afd976 | 284 | %attr(755,root,root) %{_bindir}/%{target}-gcc |
b4c37c30 | 285 | %attr(755,root,root) %{_bindir}/%{target}-cpp |
286 | %attr(755,root,root) %{_bindir}/%{target}-gcov | |
83afd976 ŁK |
287 | %attr(755,root,root) %{arch}/bin/%{target}-gcc* |
288 | %attr(755,root,root) %{arch}/bin/%{target}-cpp | |
289 | %attr(755,root,root) %{arch}/bin/%{target}-gcov | |
290 | %attr(755,root,root) %{arch}/bin/cc1 | |
291 | %attr(755,root,root) %{arch}/bin/collect2 | |
292 | %{arch}/bin/*.dll | |
293 | ||
294 | %{_libdir}/gcc/%{target} | |
295 | %{arch}/%{_lib}/libiberty.a | |
b4c37c30 | 296 | |
539d7886 | 297 | %{_mandir}/man1/%{target}-cpp.1* |
d3f237e2 | 298 | %{_mandir}/man1/%{target}-gcc.1* |
539d7886 | 299 | %{_mandir}/man1/%{target}-gcov.1* |
d3f237e2 JB |
300 | |
301 | %files c++ | |
302 | %defattr(644,root,root,755) | |
83afd976 ŁK |
303 | %attr(755,root,root) %{_bindir}/%{target}-g++ |
304 | %attr(755,root,root) %{arch}/bin/%{target}-c++ | |
305 | %attr(755,root,root) %{arch}/bin/%{target}-g++ | |
306 | %attr(755,root,root) %{arch}/bin/cc1plus | |
307 | ||
d3f237e2 JB |
308 | %{_mandir}/man1/%{target}-g++.1* |
309 | ||
83afd976 ŁK |
310 | # no obj-c, fortran, java for the moment |
311 | %if 0 | |
d3f237e2 JB |
312 | %files objc |
313 | %defattr(644,root,root,755) | |
314 | %attr(755,root,root) %{gcclib}/cc1obj | |
95f44aa0 | 315 | %{arch}/lib/libobjc.a |
316 | %{arch}/lib/libobjc.la | |
d3f237e2 | 317 | |
52a544a1 | 318 | %files fortran |
d3f237e2 | 319 | %defattr(644,root,root,755) |
52a544a1 | 320 | %attr(755,root,root) %{_bindir}/%{target}-gfortran |
321 | %attr(755,root,root) %{arch}/bin/gfortran | |
322 | %attr(755,root,root) %{gcclib}/f951 | |
323 | %{arch}/lib/libgfortran.a | |
324 | %{arch}/lib/libgfortran.la | |
325 | %{arch}/lib/libgfortranbegin.a | |
326 | %{arch}/lib/libgfortranbegin.la | |
327 | %{_mandir}/man1/%{target}-gfortran.1* | |
d3f237e2 | 328 | |
d3f237e2 JB |
329 | %files java |
330 | %defattr(644,root,root,755) | |
331 | %attr(755,root,root) %{_bindir}/%{target}-gcj | |
b4c37c30 | 332 | %attr(755,root,root) %{_bindir}/%{target}-gcjh |
152664fa | 333 | %attr(755,root,root) %{_bindir}/%{target}-gjnih |
a0d467f7 | 334 | %attr(755,root,root) %{_bindir}/%{target}-grepjar |
52a544a1 | 335 | %attr(755,root,root) %{_bindir}/%{target}-fastjar |
7fc2a2bb JB |
336 | %attr(755,root,root) %{_bindir}/%{target}-jcf-dump |
337 | %attr(755,root,root) %{_bindir}/%{target}-jv-scan | |
a0d467f7 | 338 | #%attr(755,root,root) %{arch}/bin/grepjar |
339 | #%attr(755,root,root) %{arch}/bin/jar | |
d3f237e2 JB |
340 | %attr(755,root,root) %{gcclib}/jc1 |
341 | %attr(755,root,root) %{gcclib}/jvgenmain | |
d12aabe0 | 342 | %{_mandir}/man1/%{target}-gcj.1* |
539d7886 | 343 | %{_mandir}/man1/%{target}-gcjh.1* |
152664fa | 344 | %{_mandir}/man1/%{target}-gjnih.1* |
7fc2a2bb | 345 | %{_mandir}/man1/%{target}-grepjar.1* |
52a544a1 | 346 | %{_mandir}/man1/%{target}-fastjar.1* |
539d7886 JB |
347 | %{_mandir}/man1/%{target}-jcf-dump.1* |
348 | %{_mandir}/man1/%{target}-jv-scan.1* | |
83afd976 | 349 | %endif |