]> git.pld-linux.org Git - packages/crossmingw32-gcc.git/blob - crossmingw32-gcc.spec
9c43342813ead0091652afef1db3b88e4d91a4b3
[packages/crossmingw32-gcc.git] / crossmingw32-gcc.spec
1 #
2 # TODO:
3 # - restore languages other than c, c++
4 # - openmp
5 #
6 # Conditional build:
7 %bcond_with     bootstrap       # bootstrap build (using binary w32api/mingwrt)
8 #
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
16 Version:        4.5.1
17 Release:        1
18 Epoch:          1
19 License:        GPL v3+
20 Group:          Development/Languages
21 Source0:        ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{version}/gcc-%{version}.tar.bz2
22 # Source0-md5:  48231a8e33ed6e058a341c53b819de1a
23 %define         apiver  3.15
24 Source1:        http://downloads.sourceforge.net/mingw/w32api-%{apiver}-1-mingw32-dev.tar.lzma
25 # Source1-md5:  efcbcadd0299a6413d95b9ce919ede9f
26 %define         runver  3.18
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
36 BuildRequires:  bison
37 BuildRequires:  crossmingw32-binutils >= 2.15.91.0.2-2
38 BuildRequires:  flex
39 BuildRequires:  libmpc-devel
40 %if %{without bootstrap}
41 BuildRequires:  crossmingw32-runtime >= 3.5
42 BuildRequires:  crossmingw32-w32api >= 3.1
43 %endif
44 BuildRequires:  mpfr-devel
45 BuildRequires:  texinfo >= 4.2
46 %if %{with booststrap}
47 BuildRequires:  tar >= 1:1.22
48 BuildRequires:  xz
49 %endif
50 Requires:       crossmingw32-binutils >= 2.15.91.0.2-2
51 Requires:       gcc-dirs
52 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53
54 %define         target          i386-mingw32
55 %define         arch            %{_prefix}/%{target}
56 %define         gccarchdir      %{_libdir}/gcc/%{target}
57 %define         gcclibdir       %{gccarchdir}/%{version}
58 %define         _dlldir         /usr/share/wine/windows/system
59
60 %define         _noautostrip    .*/lib.*\\.a
61
62 %define         _enable_debug_packages 0
63
64 %description
65 crossmingw32 is a complete cross-compiling development system for
66 building stand-alone Microsoft Windows applications under Linux using
67 the MinGW32 build libraries. This includes a binutils, gcc with g++
68 and objc, and libstdc++, all cross targeted to i386-mingw32, along
69 with supporting Win32 libraries in 'coff' format from free sources.
70
71 This package contains cross targeted gcc.
72
73 %description -l de.UTF-8
74 Dieses Paket enthält einen Cross-gcc, der es erlaubt, auf einem
75 anderem Rechner Code für Win32 zu generieren.
76
77 %description -l pl.UTF-8
78 crossmingw32 jest kompletnym systemem do kompilacji skrośnej,
79 pozwalającym budować aplikacje MS Windows pod Linuksem używając
80 bibliotek MinGW32. System składa się z binutils, gcc z g++ i objc,
81 libstdc++ - wszystkie generujące kod dla platformy i386-mingw32, oraz
82 z bibliotek w formacie COFF.
83
84 Ten pakiet zawiera gcc generujące skrośnie kod dla Win32.
85
86 %package -n crossmingw32-libgcc-dll
87 Summary:        libgcc DLL library for Windows
88 Summary(pl.UTF-8):      Biblioteka DLL libgcc dla Windows
89 Group:          Applications/Emulators
90 Requires:       wine
91
92 %description -n crossmingw32-libgcc-dll
93 libgcc DLL library for Windows.
94
95 %description -n crossmingw32-libgcc-dll -l pl.UTF-8
96 Biblioteka DLL libgcc dla Windows.
97
98 %package c++
99 Summary:        MinGW32 binary utility development utilities - g++
100 Summary(pl.UTF-8):      Zestaw narzędzi MinGW32 - g++
101 Group:          Development/Languages
102 Requires:       %{name} = %{epoch}:%{version}-%{release}
103
104 %description c++
105 crossmingw32 is a complete cross-compiling development system for
106 building stand-alone Microsoft Windows applications under Linux using
107 the MinGW32 build libraries. This includes a binutils, gcc with g++
108 and objc, and libstdc++, all cross targeted to i386-mingw32, along
109 with supporting Win32 libraries in 'coff' format from free sources.
110
111 This package contains cross targeted g++ and (static) libstdc++.
112
113 %description c++ -l pl.UTF-8
114 crossmingw32 jest kompletnym systemem do kompilacji skrośnej,
115 pozwalającym budować aplikacje MS Windows pod Linuksem używając
116 bibliotek MinGW32. System składa się z binutils, gcc z g++ i objc,
117 libstdc++ - wszystkie generujące kod dla platformy i386-mingw32, oraz
118 z bibliotek w formacie COFF.
119
120 Ten pakiet zawiera g++ generujące kod pod Win32 oraz bibliotekę
121 libstdc++.
122
123 %package -n crossmingw32-libstdc++-static
124 Summary:        Static standard C++ library - cross MinGW32 version
125 Summary(pl.UTF-8):      Statyczna biblioteka standardowa C++ - wersja skrośna MinGW32
126 Group:          Development/Libraries
127 Requires:       %{name}-c++ = %{epoch}:%{version}-%{release}
128
129 %description -n crossmingw32-libstdc++-static
130 Static standard C++ library - cross MinGW32 version.
131
132 %description -n crossmingw32-libstdc++-static -l pl.UTF-8
133 Statyczna biblioteka standardowa C++ - wersja skrośna MinGW32.
134
135 %package -n crossmingw32-libstdc++-dll
136 Summary:        libstdc++ DLL library for Windows
137 Summary(pl.UTF-8):      Biblioteka DLL libstdc++ dla Windows
138 Group:          Applications/Emulators
139 Requires:       crossmingw32-libgcc-dll = %{epoch}:%{version}-%{release}
140 Requires:       wine
141
142 %description -n crossmingw32-libstdc++-dll
143 libstdc++ DLL library for Windows.
144
145 %description -n crossmingw32-libstdc++-dll -l pl.UTF-8
146 Biblioteka DLL libstdc++ dla Windows.
147
148 # does this even work?
149 %package objc
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}
154
155 %description objc
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.
161
162 This package contains cross targeted objc compiler.
163
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.
170
171 Ten pakiet zawiera kompilator objc generujący kod pod Win32.
172
173 # does this even work?
174 %package fortran
175 Summary:        MinGW32 binary utility development utilities - Fortran
176 Summary(pl.UTF-8):      Zestaw narzędzi MinGW32 - Fortran
177 Group:          Development/Languages
178 Requires:       %{name} = %{epoch}:%{version}-%{release}
179 Obsoletes:      crossmingw32-gcc-g77
180
181 %description fortran
182 crossmingw32 is a complete cross-compiling development system for
183 building stand-alone Microsoft Windows applications under Linux using
184 the MinGW32 build libraries. This includes a binutils, gcc with g++
185 and objc, and libstdc++, all cross targeted to i386-mingw32, along
186 with supporting Win32 libraries in 'coff' format from free sources.
187
188 This package contains cross targeted Fortran compiler.
189
190 %description fortran -l pl.UTF-8
191 crossmingw32 jest kompletnym systemem do kompilacji skrośnej,
192 pozwalającym budować aplikacje MS Windows pod Linuksem używając
193 bibliotek MinGW32. System składa się z binutils, gcc z g++ i objc,
194 libstdc++ - wszystkie generujące kod dla platformy i386-mingw32, oraz
195 z bibliotek w formacie COFF.
196
197 Ten pakiet zawiera kompilator Fortranu generujący kod pod Win32.
198
199 # does this even work?
200 %package java
201 Summary:        MinGW32 binary utility development utilities - Java
202 Summary(pl.UTF-8):      Zestaw narzędzi MinGW32 - Java
203 Group:          Development/Languages
204 Requires:       %{name} = %{epoch}:%{version}-%{release}
205
206 %description java
207 crossmingw32 is a complete cross-compiling development system for
208 building stand-alone Microsoft Windows applications under Linux using
209 the MinGW32 build libraries. This includes a binutils, gcc with g++
210 and objc, and libstdc++, all cross targeted to i386-mingw32, along
211 with supporting Win32 libraries in 'coff' format from free sources.
212
213 This package contains cross targeted Java compiler.
214
215 %description java -l pl.UTF-8
216 crossmingw32 jest kompletnym systemem do kompilacji skrośnej,
217 pozwalającym budować aplikacje MS Windows pod Linuksem używając
218 bibliotek MinGW32. System składa się z binutils, gcc z g++ i objc,
219 libstdc++ - wszystkie generujące kod dla platformy i386-mingw32, oraz
220 z bibliotek w formacie COFF.
221
222 Ten pakiet zawiera kompilator Javy generujący kod pod Win32.
223
224 %prep
225 %setup -q -n gcc-%{version}
226 %patch100 -p0
227 %patch0 -p1
228 %patch2 -p1
229
230 %if %{with bootstrap}
231 # note: "winsup" dirs below are special, handled by gcc's configure
232 install -d winsup/{mingw,w32api}
233 tar xf %{SOURCE1} -C winsup/w32api
234 tar xf %{SOURCE2} -C winsup/mingw
235 %endif
236
237 # override snapshot version.
238 echo %{version} > gcc/BASE-VER
239 echo "release" > gcc/DEV-PHASE
240
241 %build
242 rm -rf builddir && install -d builddir && cd builddir
243 %if %{with bootstrap}
244 install -d %{target}/winsup
245 # sysroot/%{target}/lib
246 ln -sf ../../../winsup/mingw/lib %{target}/winsup/mingw
247 ln -sf ../../../winsup/w32api %{target}/winsup/w32api
248 WINSUPDIR=$(cd ..; pwd)/winsup
249 %endif
250
251 CC="%{__cc}" \
252 CFLAGS="%{rpmcflags}" \
253 CXXFLAGS="%{rpmcxxflags}" \
254 TEXCONFIG=false \
255 ../configure \
256         --prefix=%{arch} \
257         --libdir=%{_libdir} \
258         --libexecdir=%{_libdir} \
259         --infodir=%{_infodir} \
260         --mandir=%{_mandir} \
261         %{!?with_bootstrap:--with-headers=%{arch}/include} \
262         --with-libs=%{!?with_bootstrap:%{arch}/lib}%{?with_bootstrap:${WINSUPDIR}/mingw/lib} \
263         --with-build-time-tools=%{arch}/bin \
264         --with-dwarf2 \
265         --with-gnu-as \
266         --with-gnu-ld \
267         --with-mangler-in-ld \
268         --with-long-double-128 \
269         --enable-threads \
270         --enable-languages="c,c++" \
271         --enable-c99 \
272         --enable-long-long \
273         --enable-fully-dynamic-string \
274         --enable-libstdcxx-allocator=new \
275         --enable-version-specific-runtime-libs \
276         --enable-shared \
277         --disable-nls \
278         --disable-symvers \
279         --disable-sjlj-exceptions \
280         --disable-win32-registry \
281         --disable-multilib \
282         --disable-libssp \
283         --target=%{target}
284 # ,fortran,java,objc
285
286 cd ..
287 %{__make} -C builddir all-host
288 patch -p1 <%{PATCH1}
289 %{__make} -C builddir
290
291 %install
292 rm -rf $RPM_BUILD_ROOT
293 install -d $RPM_BUILD_ROOT%{_bindir}
294
295 %{__make} -C builddir install \
296         DESTDIR=$RPM_BUILD_ROOT
297
298 # host (ELF) library
299 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a
300
301 # cross library - strange path
302 install -d $RPM_BUILD_ROOT%{arch}/lib
303 mv -f $RPM_BUILD_ROOT%{arch}/%{target}/lib/libiberty.a $RPM_BUILD_ROOT%{arch}/lib
304
305 mv $RPM_BUILD_ROOT%{gcclibdir}/include-fixed/{limits,syslimits}.h $RPM_BUILD_ROOT%{gcclibdir}/include
306 %{__rm} -r $RPM_BUILD_ROOT%{gcclibdir}/include-fixed
307 %{__rm} -r $RPM_BUILD_ROOT%{gcclibdir}/install-tools
308
309 # restore hardlinks
310 ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-gcc $RPM_BUILD_ROOT%{_bindir}/%{target}-gcc
311 ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-g++ $RPM_BUILD_ROOT%{_bindir}/%{target}-g++
312 ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-cpp $RPM_BUILD_ROOT%{_bindir}/%{target}-cpp
313 ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-gcov $RPM_BUILD_ROOT%{_bindir}/%{target}-gcov
314
315 # DLLs
316 install -d $RPM_BUILD_ROOT%{_dlldir}
317 mv -f $RPM_BUILD_ROOT%{arch}/bin/libstdc++-6.dll $RPM_BUILD_ROOT%{_dlldir}
318 install builddir/i386-mingw32/libgcc/shlib/libgcc_s_dw2-1.dll $RPM_BUILD_ROOT%{_dlldir}
319
320 %if 0%{!?debug:1}
321 %{target}-strip --strip-unneeded -R.comment -R.note $RPM_BUILD_ROOT%{_dlldir}/*.dll
322 %{target}-strip -g -R.comment -R.note $RPM_BUILD_ROOT%{gcclibdir}/lib*.a \
323         $RPM_BUILD_ROOT%{arch}/lib/lib*.a
324 %endif
325
326 # already in native gcc
327 %{__rm} -r $RPM_BUILD_ROOT%{_infodir}
328 # common FSF man pages
329 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man7/{fsf-funding,gfdl,gpl}.7
330
331 %clean
332 rm -rf $RPM_BUILD_ROOT
333
334 %files
335 %defattr(644,root,root,755)
336 %attr(755,root,root) %{_bindir}/%{target}-gcc
337 %attr(755,root,root) %{_bindir}/%{target}-cpp
338 %attr(755,root,root) %{_bindir}/%{target}-gcov
339 %attr(755,root,root) %{arch}/bin/%{target}-gcc
340 %attr(755,root,root) %{arch}/bin/%{target}-gcc-%{version}
341 %attr(755,root,root) %{arch}/bin/%{target}-gccbug
342 %attr(755,root,root) %{arch}/bin/%{target}-cpp
343 %attr(755,root,root) %{arch}/bin/%{target}-gcov
344 %{arch}/lib/libiberty.a
345 %dir %{gccarchdir}
346 %dir %{gcclibdir}
347 %attr(755,root,root) %{gcclibdir}/cc1
348 %attr(755,root,root) %{gcclibdir}/collect2
349 %attr(755,root,root) %{gcclibdir}/lto-wrapper
350 %{gcclibdir}/libgcc.a
351 %{gcclibdir}/libgcc_eh.a
352 %{gcclibdir}/libgcc_s.a
353 %{gcclibdir}/libgcov.a
354 %dir %{gcclibdir}/include
355 %{gcclibdir}/include/*.h
356 %{_mandir}/man1/%{target}-cpp.1*
357 %{_mandir}/man1/%{target}-gcc.1*
358 %{_mandir}/man1/%{target}-gcov.1*
359
360 %files -n crossmingw32-libgcc-dll
361 %defattr(644,root,root,755)
362 %{_dlldir}/libgcc_s_dw2-1.dll
363
364 %files c++
365 %defattr(644,root,root,755)
366 %attr(755,root,root) %{_bindir}/%{target}-g++
367 %attr(755,root,root) %{arch}/bin/%{target}-c++
368 %attr(755,root,root) %{arch}/bin/%{target}-g++
369 %attr(755,root,root) %{gcclibdir}/cc1plus
370 %{gcclibdir}/libstdc++.dll.a
371 %{gcclibdir}/libstdc++.la
372 %{gcclibdir}/libsupc++.la
373 %{gcclibdir}/libsupc++.a
374 %{gcclibdir}/crtbegin.o
375 %{gcclibdir}/crtend.o
376 %{gcclibdir}/crtfastmath.o
377 %{gcclibdir}/include/c++
378 %{_mandir}/man1/%{target}-g++.1*
379
380 %files -n crossmingw32-libstdc++-static
381 %defattr(644,root,root,755)
382 %{gcclibdir}/libstdc++.a
383
384 %files -n crossmingw32-libstdc++-dll
385 %defattr(644,root,root,755)
386 %{_dlldir}/libstdc++-6.dll
387
388 # no obj-c, fortran, java for the moment
389 %if 0
390 %files objc
391 %defattr(644,root,root,755)
392 %attr(755,root,root) %{gcclib}/cc1obj
393 %{arch}/lib/libobjc.a
394 %{arch}/lib/libobjc.la
395
396 %files fortran
397 %defattr(644,root,root,755)
398 %attr(755,root,root) %{_bindir}/%{target}-gfortran
399 %attr(755,root,root) %{arch}/bin/gfortran
400 %attr(755,root,root) %{gcclib}/f951
401 %{arch}/lib/libgfortran.a
402 %{arch}/lib/libgfortran.la
403 %{arch}/lib/libgfortranbegin.a
404 %{arch}/lib/libgfortranbegin.la
405 %{_mandir}/man1/%{target}-gfortran.1*
406
407 %files java
408 %defattr(644,root,root,755)
409 %attr(755,root,root) %{_bindir}/%{target}-gcj
410 %attr(755,root,root) %{_bindir}/%{target}-gcjh
411 %attr(755,root,root) %{_bindir}/%{target}-gjnih
412 %attr(755,root,root) %{_bindir}/%{target}-grepjar
413 %attr(755,root,root) %{_bindir}/%{target}-fastjar
414 %attr(755,root,root) %{_bindir}/%{target}-jcf-dump
415 %attr(755,root,root) %{_bindir}/%{target}-jv-scan
416 #%attr(755,root,root) %{arch}/bin/grepjar
417 #%attr(755,root,root) %{arch}/bin/jar
418 %attr(755,root,root) %{gcclib}/jc1
419 %attr(755,root,root) %{gcclib}/jvgenmain
420 %{_mandir}/man1/%{target}-gcj.1*
421 %{_mandir}/man1/%{target}-gcjh.1*
422 %{_mandir}/man1/%{target}-gjnih.1*
423 %{_mandir}/man1/%{target}-grepjar.1*
424 %{_mandir}/man1/%{target}-fastjar.1*
425 %{_mandir}/man1/%{target}-jcf-dump.1*
426 %{_mandir}/man1/%{target}-jv-scan.1*
427 %endif
This page took 0.062849 seconds and 3 git commands to generate.