]>
Commit | Line | Data |
---|---|---|
fb214454 PS |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with bootstrap # bootstrap build (only pure C compiler w/o startfiles) | |
4 | # | |
5 | Summary: Cross Mingw64 GNU binary utility development utilities - gcc | |
6 | Summary(es.UTF-8): Utilitarios para desarrollo de binarios de la GNU - Mingw64 gcc | |
7 | Summary(fr.UTF-8): Utilitaires de développement binaire de GNU - Mingw64 gcc | |
8 | Summary(pl.UTF-8): Skrośne narzędzia programistyczne GNU dla Mingw64 - gcc | |
9 | Summary(pt_BR.UTF-8): Utilitários para desenvolvimento de binários da GNU - Mingw64 gcc | |
10 | Summary(tr.UTF-8): GNU geliştirme araçları - Mingw64 gcc | |
11 | Name: crossmingw64-gcc | |
12 | Version: 4.3.1 | |
13 | Release: 0.1 | |
14 | Epoch: 1 | |
15 | License: GPL v3+ | |
16 | Group: Development/Languages | |
17 | Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{version}/gcc-%{version}.tar.bz2 | |
18 | # Source0-md5: 4afa0290cc3a41ac8822666f1110de98 | |
19 | Source1: http://dl.sourceforge.net/mingw-w64/mingw-w64-snapshot-20080424.tar.bz2 | |
20 | # Source1-md5: e2eea49233efd0be3a40fc774abeb1a2 | |
21 | Patch0: %{name}-no_include64.patch | |
22 | BuildRequires: autoconf | |
23 | BuildRequires: automake | |
24 | BuildRequires: bison | |
25 | BuildRequires: crossmingw64-binutils | |
26 | BuildRequires: flex | |
27 | BuildRequires: mpfr-devel | |
28 | BuildRequires: texinfo >= 4.2 | |
29 | Requires: crossmingw64-binutils | |
fb214454 PS |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
31 | ||
32 | %define target x86_64-mingw32 | |
33 | %define arch %{_prefix}/%{target} | |
34 | %define gccarch %{_libdir}/gcc/%{target} | |
35 | %define gcclib %{gccarch}/%{version} | |
36 | ||
37 | %define _noautostrip .*/lib.*\\.a | |
38 | ||
39 | %description | |
40 | crossmingw64 is a complete cross-compiling development system for | |
41 | building stand-alone Microsoft Windows applications under Linux using | |
42 | the Mingw64 build libraries. This includes a binutils, gcc with g++ | |
43 | and libstdc++, all cross targeted to x86_64-mingw32. | |
44 | ||
45 | This package contains cross targeted gcc. | |
46 | ||
47 | %package c++ | |
48 | Summary: Mingw64 binary utility development utilities - g++ | |
49 | Summary(pl.UTF-8): Zestaw narzędzi mingw64 - g++ | |
50 | Group: Development/Languages | |
51 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
52 | ||
53 | %description c++ | |
54 | crossmingw64 is a complete cross-compiling development system for | |
55 | building stand-alone Microsoft Windows applications under Linux using | |
56 | the Mingw64 build libraries. This includes a binutils, gcc with g++ | |
57 | and libstdc++, all cross targeted to x86_64-mingw32. | |
58 | ||
59 | This package contains cross targeted g++ and (static) libstdc++. | |
60 | ||
61 | %prep | |
423846e1 | 62 | %setup -q -n gcc-%{version} -a 1 |
fb214454 | 63 | %patch0 -p1 |
423846e1 PS |
64 | mkdir -p winsup/mingw |
65 | cp -ar trunk/mingw-w64-headers/include winsup/mingw | |
fb214454 PS |
66 | |
67 | %build | |
423846e1 | 68 | build_sysroot=`pwd`/winsup |
fb214454 PS |
69 | |
70 | rm -rf BUILDDIR && install -d BUILDDIR && cd BUILDDIR | |
71 | ||
72 | CFLAGS="%{rpmcflags}" \ | |
73 | CXXFLAGS="%{rpmcflags}" \ | |
74 | LDFLAGS="%{rpmldflags}" \ | |
75 | TEXCONFIG=false \ | |
76 | ../configure \ | |
77 | --prefix=%{_prefix} \ | |
78 | --infodir=%{_infodir} \ | |
79 | --mandir=%{_mandir} \ | |
fb214454 PS |
80 | --libdir=%{_libdir} \ |
81 | --libexecdir=%{_libexecdir} \ | |
82 | --includedir=%{arch}/include \ | |
83 | --with-sysroot=%{arch} \ | |
84 | --with-build-sysroot=$build_sysroot \ | |
85 | --disable-shared \ | |
86 | --enable-threads=win32 \ | |
2fa5f249 | 87 | --disable-sjlj-exceptions \ |
fb214454 PS |
88 | --enable-languages="c%{!?with_bootstrap:,c++}" \ |
89 | --enable-c99 \ | |
90 | --enable-long-long \ | |
91 | --enable-cmath \ | |
92 | --disable-nls \ | |
93 | --with-gnu-as \ | |
94 | --with-gnu-ld \ | |
95 | --with-mangler-in-ld \ | |
96 | --with-gxx-include-dir=%{arch}/include/c++/%{version} \ | |
97 | --disable-libstdcxx-pch \ | |
98 | --enable-__cxa_atexit \ | |
99 | --disable-libmudflap \ | |
100 | --disable-libssp \ | |
2fa5f249 PS |
101 | --with-pkgversion="PLD-Linux" \ |
102 | --with-bugurl="http://bugs.pld-linux.org" \ | |
423846e1 PS |
103 | --build=%{_target_platform} \ |
104 | --host=%{_target_platform} \ | |
fb214454 PS |
105 | --target=%{target} |
106 | ||
423846e1 PS |
107 | %{__make} all-gcc -j2 |
108 | %{__make} all-target-libgcc | |
109 | ||
110 | cd .. | |
111 | ||
112 | cat <<EOF >cross-gcc | |
113 | #!/bin/sh | |
114 | p=`pwd`/BUILDDIR/gcc | |
115 | \${p}/xgcc -B\${p} \$@ | |
116 | EOF | |
117 | chmod 755 cross-gcc | |
118 | ||
119 | export CC=`pwd`/cross-gcc | |
120 | ||
121 | cd trunk/mingw-w64-crt | |
122 | ||
123 | ./configure \ | |
124 | --host=%{target} \ | |
125 | --prefix=%{_prefix} \ | |
126 | --with-sysroot=$build_sysroot \ | |
127 | ||
128 | %{__make} | |
129 | ||
130 | cd - | |
fb214454 PS |
131 | |
132 | %install | |
423846e1 | 133 | build_sysroot=`pwd`/winsup |
892ff872 | 134 | |
fb214454 | 135 | rm -rf $RPM_BUILD_ROOT |
423846e1 | 136 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir},%{arch}/mingw/include} |
fb214454 PS |
137 | |
138 | cd BUILDDIR | |
139 | ||
892ff872 | 140 | %{__make} install-gcc install-target-libgcc \ |
fb214454 PS |
141 | DESTDIR=$RPM_BUILD_ROOT |
142 | ||
143 | install gcc/specs $RPM_BUILD_ROOT%{gcclib} | |
144 | ||
145 | cd .. | |
146 | ||
fb214454 PS |
147 | gccdir=$RPM_BUILD_ROOT%{gcclib} |
148 | mv $gccdir/include-fixed/{limits,syslimits}.h $gccdir/include | |
149 | rm -r $gccdir/include-fixed | |
150 | rm -r $gccdir/install-tools | |
151 | ||
423846e1 PS |
152 | |
153 | cp -ar $build_sysroot/mingw/include $RPM_BUILD_ROOT%{arch} | |
154 | ||
155 | make -C trunk/mingw-w64-crt install \ | |
156 | DESTDIR=$RPM_BUILD_ROOT | |
157 | ||
158 | mv $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/lib \ | |
159 | $RPM_BUILD_ROOT%{arch} | |
160 | ||
fb214454 PS |
161 | %if 0%{!?debug:1} |
162 | %{target}-strip -g -R.note -R.comment $RPM_BUILD_ROOT%{gcclib}/libgcc.a | |
163 | %{target}-strip -g -R.note -R.comment $RPM_BUILD_ROOT%{gcclib}/libgcov.a | |
423846e1 | 164 | %{target}-strip -g -R.note -R.comment $RPM_BUILD_ROOT%{arch}/lib/*.{a,o} |
fb214454 PS |
165 | %endif |
166 | ||
fb214454 PS |
167 | %clean |
168 | rm -rf $RPM_BUILD_ROOT | |
169 | ||
170 | %files | |
171 | %defattr(644,root,root,755) | |
172 | %attr(755,root,root) %{_bindir}/%{target}-gcc* | |
173 | %attr(755,root,root) %{_bindir}/%{target}-cpp | |
174 | %attr(755,root,root) %{_bindir}/%{target}-gcov | |
fb214454 PS |
175 | %dir %{gccarch} |
176 | %dir %{gcclib} | |
2fa5f249 PS |
177 | %dir %{gcclib}/include |
178 | %{gcclib}/include/ammintrin.h | |
179 | %{gcclib}/include/bmmintrin.h | |
180 | %{gcclib}/include/cpuid.h | |
181 | %{gcclib}/include/emmintrin.h | |
182 | %{gcclib}/include/float.h | |
183 | %{gcclib}/include/iso646.h | |
184 | %{gcclib}/include/limits.h | |
185 | %{gcclib}/include/mm3dnow.h | |
186 | %{gcclib}/include/mm_malloc.h | |
187 | %{gcclib}/include/mmintrin-common.h | |
188 | %{gcclib}/include/mmintrin.h | |
189 | %{gcclib}/include/nmmintrin.h | |
190 | %{gcclib}/include/pmmintrin.h | |
191 | %{gcclib}/include/smmintrin.h | |
192 | %{gcclib}/include/stdarg.h | |
193 | %{gcclib}/include/stdbool.h | |
194 | %{gcclib}/include/stddef.h | |
195 | %{gcclib}/include/stdfix.h | |
196 | %{gcclib}/include/syslimits.h | |
197 | %{gcclib}/include/tgmath.h | |
198 | %{gcclib}/include/tmmintrin.h | |
199 | %{gcclib}/include/unwind.h | |
200 | %{gcclib}/include/varargs.h | |
201 | %{gcclib}/include/xmmintrin.h | |
fb214454 PS |
202 | %attr(755,root,root) %{gcclib}/cc1 |
203 | %attr(755,root,root) %{gcclib}/collect2 | |
204 | %{gcclib}/libgcc.a | |
205 | %{gcclib}/libgcov.a | |
206 | %{gcclib}/specs* | |
fb214454 PS |
207 | %{_mandir}/man1/%{target}-cpp.1* |
208 | %{_mandir}/man1/%{target}-gcc.1* | |
209 | %{_mandir}/man1/%{target}-gcov.1* | |
423846e1 PS |
210 | %{arch}/include |
211 | %{arch}/lib/*.a | |
212 | %{arch}/lib/*.o | |
892ff872 PS |
213 | %dir %{arch}/mingw |
214 | %{arch}/mingw/include | |
fb214454 PS |
215 | |
216 | %if 0 | |
217 | %files c++ | |
218 | %defattr(644,root,root,755) | |
219 | %attr(755,root,root) %{_bindir}/%{target}-[cg]++ | |
220 | %attr(755,root,root) %{arch}/bin/[cg]++ | |
221 | %attr(755,root,root) %{gcclib}/cc1plus | |
222 | %{arch}/lib/libstdc++.a | |
223 | %{arch}/lib/libstdc++.la | |
224 | %{arch}/lib/libsupc++.a | |
225 | %{arch}/lib/libsupc++.la | |
226 | %{arch}/include/g++ | |
227 | %{_mandir}/man1/%{target}-g++.1* | |
228 | %endif |