]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_with bootstrap # bootstrap build (only C compiler with static runtime) | |
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.6.2 | |
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: 028115c4fbfb6cfd75d6369f4a90d87e | |
19 | # svn co https://mingw-w64.svn.sourceforge.net/svnroot/mingw-w64/stable/v2.x/mingw-w64 mingw64-crt | |
20 | %define _rev 4742 | |
21 | Source1: mingw64-crt.tar.xz | |
22 | # Source1-md5: b659532733e015e3618dd9806bcd608c | |
23 | Patch0: gcc-branch.diff | |
24 | Patch1: gcc-mingw-dirs.patch | |
25 | BuildRequires: autoconf | |
26 | BuildRequires: automake | |
27 | BuildRequires: bison | |
28 | BuildRequires: crossmingw64-binutils >= 2.22.51.0.1 | |
29 | %{!?with_bootstrap:BuildRequires: crossmingw64-gcc} | |
30 | BuildRequires: crossmingw64-headers | |
31 | BuildRequires: flex | |
32 | BuildRequires: gmp-devel >= 4.1 | |
33 | BuildRequires: libmpc-devel | |
34 | BuildRequires: mpfr-devel >= 2.3.0 | |
35 | BuildRequires: subversion >= 1.7 | |
36 | BuildRequires: texinfo >= 4.2 | |
37 | Requires: crossmingw64-binutils | |
38 | Requires: crossmingw64-headers | |
39 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
40 | ||
41 | %define target x86_64-w64-mingw32 | |
42 | %define arch %{_prefix}/%{target} | |
43 | %define gccarch %{_libdir}/gcc/%{target} | |
44 | %define gcclib %{gccarch}/%{version} | |
45 | ||
46 | %define _noautostrip .*/lib.*\\.a | |
47 | ||
48 | # workaround bootstrap bug: http://gcc.gnu.org/bugzilla/PR25672 | |
49 | %define filterout -march=i486 -march=i686 -mtune=pentium4 | |
50 | ||
51 | %description | |
52 | crossmingw64 is a complete cross-compiling development system for | |
53 | building stand-alone Microsoft Windows applications under Linux using | |
54 | the Mingw64 build libraries. This includes a binutils, gcc with g++ | |
55 | and libstdc++, all cross targeted to x86_64-pc-mingw32. | |
56 | ||
57 | This package contains cross targeted gcc. | |
58 | ||
59 | %package c++ | |
60 | Summary: Mingw64 binary utility development utilities - g++ | |
61 | Summary(pl.UTF-8): Zestaw narzędzi mingw64 - g++ | |
62 | Group: Development/Languages | |
63 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
64 | ||
65 | %description c++ | |
66 | crossmingw64 is a complete cross-compiling development system for | |
67 | building stand-alone Microsoft Windows applications under Linux using | |
68 | the Mingw64 build libraries. This includes a binutils, gcc with g++ | |
69 | and libstdc++, all cross targeted to x86_64-pc-mingw32. | |
70 | ||
71 | This package contains cross targeted g++ and libstdc++. | |
72 | ||
73 | %prep | |
74 | %setup -q -n gcc-%{version} -a 1 | |
75 | %patch0 -p0 | |
76 | %patch1 -p1 | |
77 | ||
78 | # override snapshot version. | |
79 | echo %{version} > gcc/BASE-VER | |
80 | echo "release" > gcc/DEV-PHASE | |
81 | ||
82 | if [ "`svnversion -n mingw64-crt`" != "%{_rev}" ]; then | |
83 | exit 1 | |
84 | fi | |
85 | ||
86 | %build | |
87 | rm -rf BUILDDIR && install -d BUILDDIR/%{target} && cd BUILDDIR | |
88 | ||
89 | # setup system headers for local build. | |
90 | cp -ar %{arch}/include %{target}/include | |
91 | ||
92 | CFLAGS="%{rpmcflags}" \ | |
93 | CXXFLAGS="%{rpmcflags}" \ | |
94 | LDFLAGS="%{rpmldflags}" \ | |
95 | TEXCONFIG=false \ | |
96 | ../configure \ | |
97 | --enable-checking=release \ | |
98 | --prefix=%{_prefix} \ | |
99 | --infodir=%{_infodir} \ | |
100 | --mandir=%{_mandir} \ | |
101 | --libdir=%{_libdir} \ | |
102 | --libexecdir=%{_libexecdir} \ | |
103 | --includedir=%{arch}/include \ | |
104 | --with-gnu-as \ | |
105 | --with-gnu-ld \ | |
106 | --with-sysroot=%{arch} \ | |
107 | --%{?with_bootstrap:dis}%{!?with_bootstrap:en}able-shared \ | |
108 | --disable-win32-registry \ | |
109 | --enable-threads=win32 \ | |
110 | --enable-tls \ | |
111 | --enable-sjlj-exceptions \ | |
112 | --enable-languages="c%{!?with_bootstrap:,c++}" \ | |
113 | --disable-multilib \ | |
114 | --disable-nls \ | |
115 | --disable-libmudflap \ | |
116 | --disable-libquadmath \ | |
117 | --disable-libssp \ | |
118 | --disable-plugin \ | |
119 | --disable-lto \ | |
120 | --enable-c99 \ | |
121 | --enable-long-long \ | |
122 | --enable-decimal-float=yes \ | |
123 | --enable-cmath \ | |
124 | --with-mangler-in-ld \ | |
125 | --with-gxx-include-dir=%{arch}/include/c++/%{version} \ | |
126 | --enable-fully-dynamic-string \ | |
127 | --enable-libstdcxx-allocator=new \ | |
128 | --disable-libstdcxx-pch \ | |
129 | --enable-__cxa_atexit \ | |
130 | --with-pkgversion="PLD-Linux" \ | |
131 | --with-bugurl="http://bugs.pld-linux.org" \ | |
132 | --build=%{_target_platform} \ | |
133 | --host=%{_target_platform} \ | |
134 | --target=%{target} | |
135 | ||
136 | %{__make} -j4 | |
137 | cd .. | |
138 | ||
139 | cd mingw64-crt | |
140 | CC="$PWD/../BUILDDIR/gcc/gcc-cross -B$PWD/../BUILDDIR/gcc/" \ | |
141 | ./configure \ | |
142 | --host=%{target} \ | |
143 | --prefix=%{_prefix} \ | |
144 | --disable-lib32 --enable-lib64 | |
145 | ||
146 | %{__make} | |
147 | cd .. | |
148 | ||
149 | %install | |
150 | rm -rf $RPM_BUILD_ROOT | |
151 | install -d $RPM_BUILD_ROOT | |
152 | ||
153 | cd BUILDDIR | |
154 | %{__make} install \ | |
155 | DESTDIR=$RPM_BUILD_ROOT | |
156 | ||
157 | install gcc/specs $RPM_BUILD_ROOT%{gcclib} | |
158 | ||
159 | cd .. | |
160 | ||
161 | gccdir=$RPM_BUILD_ROOT%{gcclib} | |
162 | mv $gccdir/include-fixed/{limits,syslimits}.h $gccdir/include | |
163 | rm -r $gccdir/include-fixed | |
164 | rm -r $gccdir/install-tools | |
165 | ||
166 | %{__make} -C mingw64-crt install \ | |
167 | DESTDIR=$RPM_BUILD_ROOT | |
168 | ||
169 | %if 0%{!?debug:1} | |
170 | %{target}-strip -g -R.note -R.comment $RPM_BUILD_ROOT%{gcclib}/libgcc.a | |
171 | %{target}-strip -g -R.note -R.comment $RPM_BUILD_ROOT%{gcclib}/libgcov.a | |
172 | find $RPM_BUILD_ROOT%{arch}/lib -type f -name '*.a' -o -name '*.o' \ | |
173 | -exec %{target}-strip -g -R.note -R.comment "{}" ";" | |
174 | %endif | |
175 | ||
176 | %clean | |
177 | rm -rf $RPM_BUILD_ROOT | |
178 | ||
179 | %files | |
180 | %defattr(644,root,root,755) | |
181 | %attr(755,root,root) %{_bindir}/%{target}-gcc* | |
182 | %attr(755,root,root) %{_bindir}/%{target}-cpp | |
183 | %attr(755,root,root) %{_bindir}/%{target}-gcov | |
184 | %dir %{gccarch} | |
185 | %dir %{gcclib} | |
186 | %dir %{gcclib}/include | |
187 | %{gcclib}/include/abmintrin.h | |
188 | %{gcclib}/include/ammintrin.h | |
189 | %{gcclib}/include/avxintrin.h | |
190 | %{gcclib}/include/bmiintrin.h | |
191 | %{gcclib}/include/bmmintrin.h | |
192 | %{gcclib}/include/cpuid.h | |
193 | %{gcclib}/include/cross-stdarg.h | |
194 | %{gcclib}/include/emmintrin.h | |
195 | %{gcclib}/include/float.h | |
196 | %{gcclib}/include/fma4intrin.h | |
197 | %{gcclib}/include/ia32intrin.h | |
198 | %{gcclib}/include/immintrin.h | |
199 | %{gcclib}/include/iso646.h | |
200 | %{gcclib}/include/limits.h | |
201 | %{gcclib}/include/lwpintrin.h | |
202 | %{gcclib}/include/mm3dnow.h | |
203 | %{gcclib}/include/mm_malloc.h | |
204 | %{gcclib}/include/mmintrin.h | |
205 | %{gcclib}/include/nmmintrin.h | |
206 | %{gcclib}/include/pmmintrin.h | |
207 | %{gcclib}/include/popcntintrin.h | |
208 | %{gcclib}/include/smmintrin.h | |
209 | %{gcclib}/include/tbmintrin.h | |
210 | %{gcclib}/include/stdarg.h | |
211 | %{gcclib}/include/stdbool.h | |
212 | %{gcclib}/include/stddef.h | |
213 | %{gcclib}/include/stdfix.h | |
214 | %{gcclib}/include/stdint-gcc.h | |
215 | %{gcclib}/include/stdint.h | |
216 | %{gcclib}/include/syslimits.h | |
217 | %{gcclib}/include/tgmath.h | |
218 | %{gcclib}/include/tmmintrin.h | |
219 | %{gcclib}/include/unwind.h | |
220 | %{gcclib}/include/varargs.h | |
221 | %{gcclib}/include/wmmintrin.h | |
222 | %{gcclib}/include/x86intrin.h | |
223 | %{gcclib}/include/xmmintrin.h | |
224 | %{gcclib}/include/xopintrin.h | |
225 | %attr(755,root,root) %{gcclib}/cc1 | |
226 | %attr(755,root,root) %{gcclib}/collect2 | |
227 | %attr(755,root,root) %{gcclib}/lto-wrapper | |
228 | %{gcclib}/*.o | |
229 | %{gcclib}/libgcc.a | |
230 | %if %{without bootstrap} | |
231 | %{arch}/lib/libgcc_s_sjlj-1.dll | |
232 | %{gcclib}/libgcc_eh.a | |
233 | %endif | |
234 | %{gcclib}/libgcov.a | |
235 | %{gcclib}/specs* | |
236 | %{_mandir}/man1/%{target}-cpp.1* | |
237 | %{_mandir}/man1/%{target}-gcc.1* | |
238 | %{_mandir}/man1/%{target}-gcov.1* | |
239 | %{arch}/lib/*.a | |
240 | %if %{without bootstrap} | |
241 | %exclude %{arch}/include/c++ | |
242 | %exclude %{arch}/lib/libstdc++.a | |
243 | %exclude %{arch}/lib/libsupc++.a | |
244 | %endif | |
245 | %{arch}/lib/*.o | |
246 | ||
247 | %if %{without bootstrap} | |
248 | %files c++ | |
249 | %defattr(644,root,root,755) | |
250 | %attr(755,root,root) %{_bindir}/%{target}-[cg]++ | |
251 | %attr(755,root,root) %{gcclib}/cc1plus | |
252 | %{arch}/lib/libstdc++-6.dll | |
253 | %{arch}/lib/libstdc++.a | |
254 | %{arch}/lib/libstdc++.la | |
255 | %{arch}/lib/libsupc++.a | |
256 | %{arch}/lib/libsupc++.la | |
257 | %{arch}/include/c++ | |
258 | %{_mandir}/man1/%{target}-g++.1* | |
259 | %endif |