7 %bcond_with bootstrap # bootstrap build (using binary w32api/mingwrt)
9 Summary: Cross MinGW32 GNU binary utility development utilities - gcc
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
15 Name: crossmingw32-gcc
20 Group: Development/Languages
21 Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{version}/gcc-%{version}.tar.bz2
22 # Source0-md5: 48231a8e33ed6e058a341c53b819de1a
24 Source1: http://downloads.sourceforge.net/mingw/w32api-%{apiver}-1-mingw32-dev.tar.lzma
25 # Source1-md5: efcbcadd0299a6413d95b9ce919ede9f
27 Source2: http://downloads.sourceforge.net/mingw/mingwrt-%{runver}-mingw32-dev.tar.gz
28 # Source2-md5: e49803d8c14b1ffa6e24e5b5fee31a3d
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
34 BuildRequires: autoconf
35 BuildRequires: automake
37 BuildRequires: crossmingw32-binutils >= 2.15.91.0.2-2
39 BuildRequires: libmpc-devel
40 %if %{without bootstrap}
41 BuildRequires: crossmingw32-runtime >= 3.5
42 BuildRequires: crossmingw32-w32api >= 3.1
44 BuildRequires: mpfr-devel
45 BuildRequires: texinfo >= 4.2
46 %if %{with booststrap}
47 BuildRequires: tar >= 1:1.22
50 Requires: crossmingw32-binutils >= 2.15.91.0.2-2
52 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54 %define target i386-mingw32
55 %define sysprefix /usr
56 %define arch %{sysprefix}/%{target}
57 %define gccarchdir %{_libdir}/gcc/%{target}
58 %define gcclibdir %{gccarchdir}/%{version}
59 %define _dlldir /usr/share/wine/windows/system
61 %define _noautostrip .*/lib.*\\.a
63 %define _enable_debug_packages 0
66 crossmingw32 is a complete cross-compiling development system for
67 building stand-alone Microsoft Windows applications under Linux using
68 the MinGW32 build libraries. This includes a binutils, gcc with g++
69 and objc, and libstdc++, all cross targeted to i386-mingw32, along
70 with supporting Win32 libraries in 'coff' format from free sources.
72 This package contains cross targeted gcc.
74 %description -l de.UTF-8
75 Dieses Paket enthält einen Cross-gcc, der es erlaubt, auf einem
76 anderem Rechner Code für Win32 zu generieren.
78 %description -l pl.UTF-8
79 crossmingw32 jest kompletnym systemem do kompilacji skrośnej,
80 pozwalającym budować aplikacje MS Windows pod Linuksem używając
81 bibliotek MinGW32. System składa się z binutils, gcc z g++ i objc,
82 libstdc++ - wszystkie generujące kod dla platformy i386-mingw32, oraz
83 z bibliotek w formacie COFF.
85 Ten pakiet zawiera gcc generujące skrośnie kod dla Win32.
87 %package -n crossmingw32-libgcc-dll
88 Summary: libgcc DLL library for Windows
89 Summary(pl.UTF-8): Biblioteka DLL libgcc dla Windows
90 Group: Applications/Emulators
93 %description -n crossmingw32-libgcc-dll
94 libgcc DLL library for Windows.
96 %description -n crossmingw32-libgcc-dll -l pl.UTF-8
97 Biblioteka DLL libgcc dla Windows.
100 Summary: MinGW32 binary utility development utilities - g++
101 Summary(pl.UTF-8): Zestaw narzędzi MinGW32 - g++
102 Group: Development/Languages
103 Requires: %{name} = %{epoch}:%{version}-%{release}
106 crossmingw32 is a complete cross-compiling development system for
107 building stand-alone Microsoft Windows applications under Linux using
108 the MinGW32 build libraries. This includes a binutils, gcc with g++
109 and objc, and libstdc++, all cross targeted to i386-mingw32, along
110 with supporting Win32 libraries in 'coff' format from free sources.
112 This package contains cross targeted g++ and (static) libstdc++.
114 %description c++ -l pl.UTF-8
115 crossmingw32 jest kompletnym systemem do kompilacji skrośnej,
116 pozwalającym budować aplikacje MS Windows pod Linuksem używając
117 bibliotek MinGW32. System składa się z binutils, gcc z g++ i objc,
118 libstdc++ - wszystkie generujące kod dla platformy i386-mingw32, oraz
119 z bibliotek w formacie COFF.
121 Ten pakiet zawiera g++ generujące kod pod Win32 oraz bibliotekę
124 %package -n crossmingw32-libstdc++-static
125 Summary: Static standard C++ library - cross MinGW32 version
126 Summary(pl.UTF-8): Statyczna biblioteka standardowa C++ - wersja skrośna MinGW32
127 Group: Development/Libraries
128 Requires: %{name}-c++ = %{epoch}:%{version}-%{release}
130 %description -n crossmingw32-libstdc++-static
131 Static standard C++ library - cross MinGW32 version.
133 %description -n crossmingw32-libstdc++-static -l pl.UTF-8
134 Statyczna biblioteka standardowa C++ - wersja skrośna MinGW32.
136 %package -n crossmingw32-libstdc++-dll
137 Summary: libstdc++ DLL library for Windows
138 Summary(pl.UTF-8): Biblioteka DLL libstdc++ dla Windows
139 Group: Applications/Emulators
140 Requires: crossmingw32-libgcc-dll = %{epoch}:%{version}-%{release}
143 %description -n crossmingw32-libstdc++-dll
144 libstdc++ DLL library for Windows.
146 %description -n crossmingw32-libstdc++-dll -l pl.UTF-8
147 Biblioteka DLL libstdc++ dla Windows.
150 Summary: MinGW32 binary utility development utilities - objc
151 Summary(pl.UTF-8): Zestaw narzędzi MinGW32 - objc
152 Group: Development/Languages
153 Requires: %{name} = %{epoch}:%{version}-%{release}
156 crossmingw32 is a complete cross-compiling development system for
157 building stand-alone Microsoft Windows applications under Linux using
158 the MinGW32 build libraries. This includes a binutils, gcc with g++
159 and objc, and libstdc++, all cross targeted to i386-mingw32, along
160 with supporting Win32 libraries in 'coff' format from free sources.
162 This package contains cross targeted objc compiler.
164 %description objc -l pl.UTF-8
165 crossmingw32 jest kompletnym systemem do kompilacji skrośnej,
166 pozwalającym budować aplikacje MS Windows pod Linuksem używając
167 bibliotek MinGW32. System składa się z binutils, gcc z g++ i objc,
168 libstdc++ - wszystkie generujące kod dla platformy i386-mingw32, oraz
169 z bibliotek w formacie COFF.
171 Ten pakiet zawiera kompilator objc generujący kod pod Win32.
173 %package -n crossmingw32-libobjc-static
174 Summary: Static Objective C library - cross MinGW32 version
175 Summary(pl.UTF-8): Statyczna biblioteka Objective C - wersja skrośna MinGW32
176 Group: Development/Libraries
177 Requires: %{name}-objc = %{epoch}:%{version}-%{release}
179 %description -n crossmingw32-libobjc-static
180 Static Objective C library - cross MinGW32 version.
182 %description -n crossmingw32-libobjc-static -l pl.UTF-8
183 Statyczna biblioteka Objective C - wersja skrośna MinGW32.
185 %package -n crossmingw32-libobjc-dll
186 Summary: libobjc DLL library for Windows
187 Summary(pl.UTF-8): Biblioteka DLL libobjc dla Windows
188 Group: Applications/Emulators
189 Requires: crossmingw32-libgcc-dll = %{epoch}:%{version}-%{release}
192 %description -n crossmingw32-libobjc-dll
193 libobjc DLL library for Windows.
195 %description -n crossmingw32-libobjc-dll -l pl.UTF-8
196 Biblioteka DLL libobjc dla Windows.
199 Summary: MinGW32 binary utility development utilities - Fortran
200 Summary(pl.UTF-8): Zestaw narzędzi MinGW32 - Fortran
201 Group: Development/Languages
202 Requires: %{name} = %{epoch}:%{version}-%{release}
203 Obsoletes: crossmingw32-gcc-g77
206 crossmingw32 is a complete cross-compiling development system for
207 building stand-alone Microsoft Windows applications under Linux using
208 the MinGW32 build libraries. This includes a binutils, gcc with g++
209 and objc, and libstdc++, all cross targeted to i386-mingw32, along
210 with supporting Win32 libraries in 'coff' format from free sources.
212 This package contains cross targeted Fortran compiler.
214 %description fortran -l pl.UTF-8
215 crossmingw32 jest kompletnym systemem do kompilacji skrośnej,
216 pozwalającym budować aplikacje MS Windows pod Linuksem używając
217 bibliotek MinGW32. System składa się z binutils, gcc z g++ i objc,
218 libstdc++ - wszystkie generujące kod dla platformy i386-mingw32, oraz
219 z bibliotek w formacie COFF.
221 Ten pakiet zawiera kompilator Fortranu generujący kod pod Win32.
224 Summary: MinGW32 binary utility development utilities - Java
225 Summary(pl.UTF-8): Zestaw narzędzi MinGW32 - Java
226 Group: Development/Languages
227 Requires: %{name} = %{epoch}:%{version}-%{release}
230 crossmingw32 is a complete cross-compiling development system for
231 building stand-alone Microsoft Windows applications under Linux using
232 the MinGW32 build libraries. This includes a binutils, gcc with g++
233 and objc, and libstdc++, all cross targeted to i386-mingw32, along
234 with supporting Win32 libraries in 'coff' format from free sources.
236 This package contains cross targeted Java compiler.
238 %description java -l pl.UTF-8
239 crossmingw32 jest kompletnym systemem do kompilacji skrośnej,
240 pozwalającym budować aplikacje MS Windows pod Linuksem używając
241 bibliotek MinGW32. System składa się z binutils, gcc z g++ i objc,
242 libstdc++ - wszystkie generujące kod dla platformy i386-mingw32, oraz
243 z bibliotek w formacie COFF.
245 Ten pakiet zawiera kompilator Javy generujący kod pod Win32.
248 %setup -q -n gcc-%{version}
253 %if %{with bootstrap}
254 # note: "winsup" dirs below are special, handled by gcc's configure
255 install -d winsup/{mingw,w32api}
256 tar xf %{SOURCE1} -C winsup/w32api
257 tar xf %{SOURCE2} -C winsup/mingw
260 # override snapshot version.
261 echo %{version} > gcc/BASE-VER
262 echo "release" > gcc/DEV-PHASE
265 rm -rf builddir && install -d builddir && cd builddir
266 %if %{with bootstrap}
267 install -d %{target}/winsup
268 ln -sf ../../../winsup/mingw/lib %{target}/winsup/mingw
269 ln -sf ../../../winsup/w32api %{target}/winsup/w32api
270 WINSUPDIR=$(cd ..; pwd)/winsup
274 CFLAGS="%{rpmcflags}" \
275 CXXFLAGS="%{rpmcxxflags}" \
278 --prefix=%{sysprefix} \
279 --bindir=%{arch}/bin \
280 --libdir=%{_libdir} \
281 --includedir=%{arch}/include \
282 --libexecdir=%{_libdir} \
283 --infodir=%{_infodir} \
284 --mandir=%{_mandir} \
285 %{!?with_bootstrap:--with-headers=%{arch}/include} \
286 --with-libs=%{!?with_bootstrap:%{arch}/lib}%{?with_bootstrap:${WINSUPDIR}/mingw/lib} \
287 --with-build-time-tools=%{arch}/bin \
291 --with-mangler-in-ld \
292 --with-long-double-128 \
294 --enable-languages="c,c++,java,objc" \
297 --enable-fully-dynamic-string \
298 --enable-libstdcxx-allocator=new \
299 --enable-version-specific-runtime-libs \
303 --disable-sjlj-exceptions \
304 --disable-win32-registry \
311 %{__make} -C builddir all-host
313 %{__make} -C builddir
316 rm -rf $RPM_BUILD_ROOT
317 install -d $RPM_BUILD_ROOT%{_bindir}
319 %{__make} -C builddir install \
320 DESTDIR=$RPM_BUILD_ROOT
323 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a
325 mv $RPM_BUILD_ROOT%{gcclibdir}/include-fixed/{limits,syslimits}.h $RPM_BUILD_ROOT%{gcclibdir}/include
326 %{__rm} -r $RPM_BUILD_ROOT%{gcclibdir}/include-fixed
327 %{__rm} -r $RPM_BUILD_ROOT%{gcclibdir}/install-tools
329 # make links in host bindir
330 ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-gcc $RPM_BUILD_ROOT%{_bindir}/%{target}-gcc
331 ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-g++ $RPM_BUILD_ROOT%{_bindir}/%{target}-g++
332 ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-cpp $RPM_BUILD_ROOT%{_bindir}/%{target}-cpp
333 ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-gcov $RPM_BUILD_ROOT%{_bindir}/%{target}-gcov
334 ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-gcj $RPM_BUILD_ROOT%{_bindir}/%{target}-gcj
335 ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-jcf-dump $RPM_BUILD_ROOT%{_bindir}/%{target}-jcf-dump
338 install -d $RPM_BUILD_ROOT%{_dlldir}
339 mv -f $RPM_BUILD_ROOT%{arch}/bin/*.dll $RPM_BUILD_ROOT%{_dlldir}
340 if [ ! -f $RPM_BUILD_ROOT%{_dlldir}/libgcc_s_dw2-1.dll ]; then
341 echo "libgcc DLL not installed?"
342 install builddir/i386-mingw32/libgcc/shlib/libgcc_s_dw2-1.dll $RPM_BUILD_ROOT%{_dlldir}
346 %{target}-strip --strip-unneeded -R.comment -R.note $RPM_BUILD_ROOT%{_dlldir}/*.dll
347 %{target}-strip -g -R.comment -R.note $RPM_BUILD_ROOT%{gcclibdir}/lib*.a \
348 $RPM_BUILD_ROOT%{arch}/lib/lib*.a
351 # already in native gcc
352 %{__rm} -r $RPM_BUILD_ROOT%{_infodir}
353 # common FSF man pages
354 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man7/{fsf-funding,gfdl,gpl}.7
355 # programs not packaged
356 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/%{target}-{aot-compile,gc-analyze,gcj-dbtool,gij,grmic,jv-convert,rebuild-gcj-db}.1
359 rm -rf $RPM_BUILD_ROOT
362 %defattr(644,root,root,755)
363 %attr(755,root,root) %{_bindir}/%{target}-gcc
364 %attr(755,root,root) %{_bindir}/%{target}-cpp
365 %attr(755,root,root) %{_bindir}/%{target}-gcov
366 %attr(755,root,root) %{arch}/bin/%{target}-gcc
367 %attr(755,root,root) %{arch}/bin/%{target}-gcc-%{version}
368 %attr(755,root,root) %{arch}/bin/%{target}-gccbug
369 %attr(755,root,root) %{arch}/bin/%{target}-cpp
370 %attr(755,root,root) %{arch}/bin/%{target}-gcov
371 %attr(755,root,root) %{arch}/bin/gcc
372 %{arch}/lib/libiberty.a
375 %attr(755,root,root) %{gcclibdir}/cc1
376 %attr(755,root,root) %{gcclibdir}/collect2
377 %attr(755,root,root) %{gcclibdir}/lto-wrapper
378 %{gcclibdir}/libgcc.a
379 %{gcclibdir}/libgcc_eh.a
380 %{gcclibdir}/libgcc_s.a
381 %{gcclibdir}/libgcov.a
382 %dir %{gcclibdir}/include
383 %{gcclibdir}/include/*.h
384 %{_mandir}/man1/%{target}-cpp.1*
385 %{_mandir}/man1/%{target}-gcc.1*
386 %{_mandir}/man1/%{target}-gcov.1*
388 %files -n crossmingw32-libgcc-dll
389 %defattr(644,root,root,755)
390 %{_dlldir}/libgcc_s_dw2-1.dll
393 %defattr(644,root,root,755)
394 %attr(755,root,root) %{_bindir}/%{target}-g++
395 %attr(755,root,root) %{arch}/bin/%{target}-c++
396 %attr(755,root,root) %{arch}/bin/%{target}-g++
397 %attr(755,root,root) %{arch}/bin/c++
398 %attr(755,root,root) %{arch}/bin/g++
399 %attr(755,root,root) %{gcclibdir}/cc1plus
400 %{gcclibdir}/libstdc++.dll.a
401 %{gcclibdir}/libstdc++.la
402 %{gcclibdir}/libsupc++.la
403 %{gcclibdir}/libsupc++.a
404 %{gcclibdir}/crtbegin.o
405 %{gcclibdir}/crtend.o
406 %{gcclibdir}/crtfastmath.o
407 %{gcclibdir}/include/c++
408 %{_mandir}/man1/%{target}-g++.1*
410 %files -n crossmingw32-libstdc++-static
411 %defattr(644,root,root,755)
412 %{gcclibdir}/libstdc++.a
414 %files -n crossmingw32-libstdc++-dll
415 %defattr(644,root,root,755)
416 %{_dlldir}/libstdc++-6.dll
419 %defattr(644,root,root,755)
420 %attr(755,root,root) %{gcclibdir}/cc1obj
421 %{gcclibdir}/libobjc.dll.a
422 %{gcclibdir}/libobjc.la
423 %{gcclibdir}/include/objc
425 %files -n crossmingw32-libobjc-static
426 %defattr(644,root,root,755)
427 %{gcclibdir}/libobjc.a
429 %files -n crossmingw32-libobjc-dll
430 %defattr(644,root,root,755)
431 %{_dlldir}/libobjc-2.dll
433 # no fortran for the moment
436 %defattr(644,root,root,755)
437 %attr(755,root,root) %{_bindir}/%{target}-gfortran
438 %attr(755,root,root) %{arch}/bin/gfortran
439 %attr(755,root,root) %{gcclibdir}/f951
440 %{arch}/lib/libgfortran.a
441 %{arch}/lib/libgfortran.la
442 %{arch}/lib/libgfortranbegin.a
443 %{arch}/lib/libgfortranbegin.la
444 %{_mandir}/man1/%{target}-gfortran.1*
448 %defattr(644,root,root,755)
449 %attr(755,root,root) %{_bindir}/%{target}-gcj
450 %attr(755,root,root) %{_bindir}/%{target}-jcf-dump
451 %attr(755,root,root) %{arch}/bin/%{target}-gcj
452 %attr(755,root,root) %{arch}/bin/%{target}-jcf-dump
453 %attr(755,root,root) %{gcclibdir}/jc1
454 %attr(755,root,root) %{gcclibdir}/jvgenmain
455 %{_mandir}/man1/%{target}-gcj.1*
456 %{_mandir}/man1/%{target}-jcf-dump.1*