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