]> git.pld-linux.org Git - packages/crossmingw32-gcc.git/blob - crossmingw32-gcc.spec
- changed passed --prefix, fixes objc build
[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         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
60
61 %define         _noautostrip    .*/lib.*\\.a
62
63 %define         _enable_debug_packages 0
64
65 %description
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.
71
72 This package contains cross targeted gcc.
73
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.
77
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.
84
85 Ten pakiet zawiera gcc generujące skrośnie kod dla Win32.
86
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
91 Requires:       wine
92
93 %description -n crossmingw32-libgcc-dll
94 libgcc DLL library for Windows.
95
96 %description -n crossmingw32-libgcc-dll -l pl.UTF-8
97 Biblioteka DLL libgcc dla Windows.
98
99 %package c++
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}
104
105 %description c++
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.
111
112 This package contains cross targeted g++ and (static) libstdc++.
113
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.
120
121 Ten pakiet zawiera g++ generujące kod pod Win32 oraz bibliotekę
122 libstdc++.
123
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}
129
130 %description -n crossmingw32-libstdc++-static
131 Static standard C++ library - cross MinGW32 version.
132
133 %description -n crossmingw32-libstdc++-static -l pl.UTF-8
134 Statyczna biblioteka standardowa C++ - wersja skrośna MinGW32.
135
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}
141 Requires:       wine
142
143 %description -n crossmingw32-libstdc++-dll
144 libstdc++ DLL library for Windows.
145
146 %description -n crossmingw32-libstdc++-dll -l pl.UTF-8
147 Biblioteka DLL libstdc++ dla Windows.
148
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 %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}
178
179 %description -n crossmingw32-libobjc-static
180 Static Objective C library - cross MinGW32 version.
181
182 %description -n crossmingw32-libobjc-static -l pl.UTF-8
183 Statyczna biblioteka Objective C - wersja skrośna MinGW32.
184
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}
190 Requires:       wine
191
192 %description -n crossmingw32-libobjc-dll
193 libobjc DLL library for Windows.
194
195 %description -n crossmingw32-libobjc-dll -l pl.UTF-8
196 Biblioteka DLL libobjc dla Windows.
197
198 # does this even work?
199 %package fortran
200 Summary:        MinGW32 binary utility development utilities - Fortran
201 Summary(pl.UTF-8):      Zestaw narzędzi MinGW32 - Fortran
202 Group:          Development/Languages
203 Requires:       %{name} = %{epoch}:%{version}-%{release}
204 Obsoletes:      crossmingw32-gcc-g77
205
206 %description fortran
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 Fortran compiler.
214
215 %description fortran -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 Fortranu generujący kod pod Win32.
223
224 # does this even work?
225 %package java
226 Summary:        MinGW32 binary utility development utilities - Java
227 Summary(pl.UTF-8):      Zestaw narzędzi MinGW32 - Java
228 Group:          Development/Languages
229 Requires:       %{name} = %{epoch}:%{version}-%{release}
230
231 %description java
232 crossmingw32 is a complete cross-compiling development system for
233 building stand-alone Microsoft Windows applications under Linux using
234 the MinGW32 build libraries. This includes a binutils, gcc with g++
235 and objc, and libstdc++, all cross targeted to i386-mingw32, along
236 with supporting Win32 libraries in 'coff' format from free sources.
237
238 This package contains cross targeted Java compiler.
239
240 %description java -l pl.UTF-8
241 crossmingw32 jest kompletnym systemem do kompilacji skrośnej,
242 pozwalającym budować aplikacje MS Windows pod Linuksem używając
243 bibliotek MinGW32. System składa się z binutils, gcc z g++ i objc,
244 libstdc++ - wszystkie generujące kod dla platformy i386-mingw32, oraz
245 z bibliotek w formacie COFF.
246
247 Ten pakiet zawiera kompilator Javy generujący kod pod Win32.
248
249 %prep
250 %setup -q -n gcc-%{version}
251 %patch100 -p0
252 %patch0 -p1
253 %patch2 -p1
254
255 %if %{with bootstrap}
256 # note: "winsup" dirs below are special, handled by gcc's configure
257 install -d winsup/{mingw,w32api}
258 tar xf %{SOURCE1} -C winsup/w32api
259 tar xf %{SOURCE2} -C winsup/mingw
260 %endif
261
262 # override snapshot version.
263 echo %{version} > gcc/BASE-VER
264 echo "release" > gcc/DEV-PHASE
265
266 %build
267 rm -rf builddir && install -d builddir && cd builddir
268 %if %{with bootstrap}
269 install -d %{target}/winsup
270 # sysroot/%{target}/lib
271 ln -sf ../../../winsup/mingw/lib %{target}/winsup/mingw
272 ln -sf ../../../winsup/w32api %{target}/winsup/w32api
273 WINSUPDIR=$(cd ..; pwd)/winsup
274 %endif
275
276 CC="%{__cc}" \
277 CFLAGS="%{rpmcflags}" \
278 CXXFLAGS="%{rpmcxxflags}" \
279 TEXCONFIG=false \
280 ../configure \
281         --prefix=%{sysprefix} \
282         --bindir=%{arch}/bin \
283         --libdir=%{_libdir} \
284         --includedir=%{arch}/include \
285         --libexecdir=%{_libdir} \
286         --infodir=%{_infodir} \
287         --mandir=%{_mandir} \
288         %{!?with_bootstrap:--with-headers=%{arch}/include} \
289         --with-libs=%{!?with_bootstrap:%{arch}/lib}%{?with_bootstrap:${WINSUPDIR}/mingw/lib} \
290         --with-build-time-tools=%{arch}/bin \
291         --with-dwarf2 \
292         --with-gnu-as \
293         --with-gnu-ld \
294         --with-mangler-in-ld \
295         --with-long-double-128 \
296         --enable-threads \
297         --enable-languages="c,c++,objc" \
298         --enable-c99 \
299         --enable-long-long \
300         --enable-fully-dynamic-string \
301         --enable-libstdcxx-allocator=new \
302         --enable-version-specific-runtime-libs \
303         --enable-shared \
304         --disable-nls \
305         --disable-symvers \
306         --disable-sjlj-exceptions \
307         --disable-win32-registry \
308         --disable-multilib \
309         --disable-libssp \
310         --target=%{target}
311 # ,fortran,java
312
313 cd ..
314 %{__make} -C builddir all-host
315 patch -p1 <%{PATCH1}
316 %{__make} -C builddir
317
318 %install
319 rm -rf $RPM_BUILD_ROOT
320 install -d $RPM_BUILD_ROOT%{_bindir}
321
322 %{__make} -C builddir install \
323         DESTDIR=$RPM_BUILD_ROOT
324
325 # host (ELF) library
326 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a
327
328 mv $RPM_BUILD_ROOT%{gcclibdir}/include-fixed/{limits,syslimits}.h $RPM_BUILD_ROOT%{gcclibdir}/include
329 %{__rm} -r $RPM_BUILD_ROOT%{gcclibdir}/include-fixed
330 %{__rm} -r $RPM_BUILD_ROOT%{gcclibdir}/install-tools
331
332 # restore hardlinks
333 ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-gcc $RPM_BUILD_ROOT%{_bindir}/%{target}-gcc
334 ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-g++ $RPM_BUILD_ROOT%{_bindir}/%{target}-g++
335 ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-cpp $RPM_BUILD_ROOT%{_bindir}/%{target}-cpp
336 ln -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-gcov $RPM_BUILD_ROOT%{_bindir}/%{target}-gcov
337
338 # DLLs
339 install -d $RPM_BUILD_ROOT%{_dlldir}
340 mv -f $RPM_BUILD_ROOT%{arch}/bin/*.dll $RPM_BUILD_ROOT%{_dlldir}
341 if [ ! -f $RPM_BUILD_ROOT%{_dlldir}/libgcc_s_dw2-1.dll ]; then
342         echo "libgcc DLL not installed?"
343         install builddir/i386-mingw32/libgcc/shlib/libgcc_s_dw2-1.dll $RPM_BUILD_ROOT%{_dlldir}
344 fi
345
346 %if 0%{!?debug:1}
347 %{target}-strip --strip-unneeded -R.comment -R.note $RPM_BUILD_ROOT%{_dlldir}/*.dll
348 %{target}-strip -g -R.comment -R.note $RPM_BUILD_ROOT%{gcclibdir}/lib*.a \
349         $RPM_BUILD_ROOT%{arch}/lib/lib*.a
350 %endif
351
352 # already in native gcc
353 %{__rm} -r $RPM_BUILD_ROOT%{_infodir}
354 # common FSF man pages
355 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man7/{fsf-funding,gfdl,gpl}.7
356
357 %clean
358 rm -rf $RPM_BUILD_ROOT
359
360 %files
361 %defattr(644,root,root,755)
362 %attr(755,root,root) %{_bindir}/%{target}-gcc
363 %attr(755,root,root) %{_bindir}/%{target}-cpp
364 %attr(755,root,root) %{_bindir}/%{target}-gcov
365 %attr(755,root,root) %{arch}/bin/%{target}-gcc
366 %attr(755,root,root) %{arch}/bin/%{target}-gcc-%{version}
367 %attr(755,root,root) %{arch}/bin/%{target}-gccbug
368 %attr(755,root,root) %{arch}/bin/%{target}-cpp
369 %attr(755,root,root) %{arch}/bin/%{target}-gcov
370 %attr(755,root,root) %{arch}/bin/gcc
371 %{arch}/lib/libiberty.a
372 %dir %{gccarchdir}
373 %dir %{gcclibdir}
374 %attr(755,root,root) %{gcclibdir}/cc1
375 %attr(755,root,root) %{gcclibdir}/collect2
376 %attr(755,root,root) %{gcclibdir}/lto-wrapper
377 %{gcclibdir}/libgcc.a
378 %{gcclibdir}/libgcc_eh.a
379 %{gcclibdir}/libgcc_s.a
380 %{gcclibdir}/libgcov.a
381 %dir %{gcclibdir}/include
382 %{gcclibdir}/include/*.h
383 %{_mandir}/man1/%{target}-cpp.1*
384 %{_mandir}/man1/%{target}-gcc.1*
385 %{_mandir}/man1/%{target}-gcov.1*
386
387 %files -n crossmingw32-libgcc-dll
388 %defattr(644,root,root,755)
389 %{_dlldir}/libgcc_s_dw2-1.dll
390
391 %files c++
392 %defattr(644,root,root,755)
393 %attr(755,root,root) %{_bindir}/%{target}-g++
394 %attr(755,root,root) %{arch}/bin/%{target}-c++
395 %attr(755,root,root) %{arch}/bin/%{target}-g++
396 %attr(755,root,root) %{arch}/bin/c++
397 %attr(755,root,root) %{arch}/bin/g++
398 %attr(755,root,root) %{gcclibdir}/cc1plus
399 %{gcclibdir}/libstdc++.dll.a
400 %{gcclibdir}/libstdc++.la
401 %{gcclibdir}/libsupc++.la
402 %{gcclibdir}/libsupc++.a
403 %{gcclibdir}/crtbegin.o
404 %{gcclibdir}/crtend.o
405 %{gcclibdir}/crtfastmath.o
406 %{gcclibdir}/include/c++
407 %{_mandir}/man1/%{target}-g++.1*
408
409 %files -n crossmingw32-libstdc++-static
410 %defattr(644,root,root,755)
411 %{gcclibdir}/libstdc++.a
412
413 %files -n crossmingw32-libstdc++-dll
414 %defattr(644,root,root,755)
415 %{_dlldir}/libstdc++-6.dll
416
417 # no obj-c, fortran, java for the moment
418 %files objc
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
424
425 %files -n crossmingw32-libobjc-static
426 %defattr(644,root,root,755)
427 %{gcclibdir}/libobjc.a
428
429 %files -n crossmingw32-libobjc-dll
430 %defattr(644,root,root,755)
431 %{_dlldir}/libobjc-2.dll
432
433 %if 0
434 %files fortran
435 %defattr(644,root,root,755)
436 %attr(755,root,root) %{_bindir}/%{target}-gfortran
437 %attr(755,root,root) %{arch}/bin/gfortran
438 %attr(755,root,root) %{gcclib}/f951
439 %{arch}/lib/libgfortran.a
440 %{arch}/lib/libgfortran.la
441 %{arch}/lib/libgfortranbegin.a
442 %{arch}/lib/libgfortranbegin.la
443 %{_mandir}/man1/%{target}-gfortran.1*
444
445 %files java
446 %defattr(644,root,root,755)
447 %attr(755,root,root) %{_bindir}/%{target}-gcj
448 %attr(755,root,root) %{_bindir}/%{target}-gcjh
449 %attr(755,root,root) %{_bindir}/%{target}-gjnih
450 %attr(755,root,root) %{_bindir}/%{target}-grepjar
451 %attr(755,root,root) %{_bindir}/%{target}-fastjar
452 %attr(755,root,root) %{_bindir}/%{target}-jcf-dump
453 %attr(755,root,root) %{_bindir}/%{target}-jv-scan
454 #%attr(755,root,root) %{arch}/bin/grepjar
455 #%attr(755,root,root) %{arch}/bin/jar
456 %attr(755,root,root) %{gcclib}/jc1
457 %attr(755,root,root) %{gcclib}/jvgenmain
458 %{_mandir}/man1/%{target}-gcj.1*
459 %{_mandir}/man1/%{target}-gcjh.1*
460 %{_mandir}/man1/%{target}-gjnih.1*
461 %{_mandir}/man1/%{target}-grepjar.1*
462 %{_mandir}/man1/%{target}-fastjar.1*
463 %{_mandir}/man1/%{target}-jcf-dump.1*
464 %{_mandir}/man1/%{target}-jv-scan.1*
465 %endif
This page took 0.061511 seconds and 4 git commands to generate.