]>
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 | |
620b7a54 PS |
12 | %define _major_ver 4.4 |
13 | %define _minor_ver 0 | |
14 | Version: %{_major_ver}.%{_minor_ver} | |
5ec0ebfe | 15 | %define _snap 20090206 |
620b7a54 | 16 | Release: 0.%{_snap}.1 |
fb214454 PS |
17 | Epoch: 1 |
18 | License: GPL v3+ | |
19 | Group: Development/Languages | |
620b7a54 PS |
20 | #Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{version}/gcc-%{version}.tar.bz2 |
21 | Source0: ftp://gcc.gnu.org/pub/gcc/snapshots/LATEST-%{_major_ver}/gcc-%{_major_ver}-%{_snap}.tar.bz2 | |
22 | Source1: http://dl.sourceforge.net/mingw-w64/mingw-w64-snapshot-20081115.tar.bz2 | |
23 | # Source1-md5: b472282419e6aea64e14763e30d5bb63 | |
24 | Patch100: gcc-branch.diff.bz2 | |
fb214454 PS |
25 | Patch0: %{name}-no_include64.patch |
26 | BuildRequires: autoconf | |
27 | BuildRequires: automake | |
28 | BuildRequires: bison | |
29 | BuildRequires: crossmingw64-binutils | |
620b7a54 | 30 | %{!?with_bootstrap:BuildRequires: crossmingw64-gcc} |
fb214454 PS |
31 | BuildRequires: flex |
32 | BuildRequires: mpfr-devel | |
33 | BuildRequires: texinfo >= 4.2 | |
34 | Requires: crossmingw64-binutils | |
fb214454 PS |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
36 | ||
37 | %define target x86_64-mingw32 | |
38 | %define arch %{_prefix}/%{target} | |
39 | %define gccarch %{_libdir}/gcc/%{target} | |
40 | %define gcclib %{gccarch}/%{version} | |
41 | ||
42 | %define _noautostrip .*/lib.*\\.a | |
43 | ||
44 | %description | |
45 | crossmingw64 is a complete cross-compiling development system for | |
46 | building stand-alone Microsoft Windows applications under Linux using | |
47 | the Mingw64 build libraries. This includes a binutils, gcc with g++ | |
48 | and libstdc++, all cross targeted to x86_64-mingw32. | |
49 | ||
50 | This package contains cross targeted gcc. | |
51 | ||
52 | %package c++ | |
53 | Summary: Mingw64 binary utility development utilities - g++ | |
54 | Summary(pl.UTF-8): Zestaw narzędzi mingw64 - g++ | |
55 | Group: Development/Languages | |
56 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
57 | ||
58 | %description c++ | |
59 | crossmingw64 is a complete cross-compiling development system for | |
60 | building stand-alone Microsoft Windows applications under Linux using | |
61 | the Mingw64 build libraries. This includes a binutils, gcc with g++ | |
62 | and libstdc++, all cross targeted to x86_64-mingw32. | |
63 | ||
64 | This package contains cross targeted g++ and (static) libstdc++. | |
65 | ||
66 | %prep | |
620b7a54 PS |
67 | #setup -q -n gcc-%{version} -a 1 |
68 | %setup -q -n gcc-%{_major_ver}-%{_snap} -a 1 | |
69 | #patch100 -p0 | |
fb214454 | 70 | %patch0 -p1 |
423846e1 PS |
71 | mkdir -p winsup/mingw |
72 | cp -ar trunk/mingw-w64-headers/include winsup/mingw | |
fb214454 PS |
73 | |
74 | %build | |
423846e1 | 75 | build_sysroot=`pwd`/winsup |
fb214454 PS |
76 | |
77 | rm -rf BUILDDIR && install -d BUILDDIR && cd BUILDDIR | |
78 | ||
79 | CFLAGS="%{rpmcflags}" \ | |
80 | CXXFLAGS="%{rpmcflags}" \ | |
81 | LDFLAGS="%{rpmldflags}" \ | |
82 | TEXCONFIG=false \ | |
83 | ../configure \ | |
84 | --prefix=%{_prefix} \ | |
85 | --infodir=%{_infodir} \ | |
86 | --mandir=%{_mandir} \ | |
fb214454 PS |
87 | --libdir=%{_libdir} \ |
88 | --libexecdir=%{_libexecdir} \ | |
89 | --includedir=%{arch}/include \ | |
620b7a54 PS |
90 | --with-gnu-as \ |
91 | --with-gnu-ld \ | |
fb214454 | 92 | --with-sysroot=%{arch} \ |
620b7a54 PS |
93 | %{?with_bootstrap:--with-build-sysroot=$build_sysroot} \ |
94 | --%{?with_bootstrap:dis}%{!?with_bootstrap:en}able-shared \ | |
fb214454 | 95 | --enable-threads=win32 \ |
6252559d | 96 | --enable-sjlj-exceptions \ |
fb214454 PS |
97 | --enable-languages="c%{!?with_bootstrap:,c++}" \ |
98 | --enable-c99 \ | |
99 | --enable-long-long \ | |
620b7a54 | 100 | --enable-decimal-float=yes \ |
fb214454 PS |
101 | --enable-cmath \ |
102 | --disable-nls \ | |
5ec0ebfe | 103 | --disable-win32-registry \ |
fb214454 PS |
104 | --with-gnu-as \ |
105 | --with-gnu-ld \ | |
106 | --with-mangler-in-ld \ | |
107 | --with-gxx-include-dir=%{arch}/include/c++/%{version} \ | |
108 | --disable-libstdcxx-pch \ | |
5ec0ebfe | 109 | --disable-symvers \ |
fb214454 PS |
110 | --enable-__cxa_atexit \ |
111 | --disable-libmudflap \ | |
112 | --disable-libssp \ | |
2fa5f249 PS |
113 | --with-pkgversion="PLD-Linux" \ |
114 | --with-bugurl="http://bugs.pld-linux.org" \ | |
3b61ff9a PS |
115 | --build=%{_target_platform} \ |
116 | --host=%{_target_platform} \ | |
fb214454 PS |
117 | --target=%{target} |
118 | ||
8754b0d8 | 119 | %{__make} |
423846e1 PS |
120 | |
121 | cd .. | |
122 | ||
123 | cat <<EOF >cross-gcc | |
124 | #!/bin/sh | |
125 | p=`pwd`/BUILDDIR/gcc | |
126 | \${p}/xgcc -B\${p} \$@ | |
127 | EOF | |
128 | chmod 755 cross-gcc | |
129 | ||
620b7a54 | 130 | export CC=%{?with_bootstrap:`pwd`/cross-gcc}%{!?with_bootstrap:%{_bindir}/%{target}-gcc} |
423846e1 PS |
131 | |
132 | cd trunk/mingw-w64-crt | |
133 | ||
134 | ./configure \ | |
135 | --host=%{target} \ | |
136 | --prefix=%{_prefix} \ | |
620b7a54 | 137 | --with-sysroot=%{?with_bootstrap:$build_sysroot}%{!?with_bootstrap:%{arch}} |
423846e1 PS |
138 | |
139 | %{__make} | |
140 | ||
141 | cd - | |
fb214454 PS |
142 | |
143 | %install | |
423846e1 | 144 | build_sysroot=`pwd`/winsup |
892ff872 | 145 | |
fb214454 | 146 | rm -rf $RPM_BUILD_ROOT |
7fc88b33 | 147 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir},%{arch}/lib,%{arch}/mingw/include} |
fb214454 PS |
148 | |
149 | cd BUILDDIR | |
150 | ||
7fc88b33 | 151 | %{__make} install \ |
fb214454 PS |
152 | DESTDIR=$RPM_BUILD_ROOT |
153 | ||
154 | install gcc/specs $RPM_BUILD_ROOT%{gcclib} | |
155 | ||
156 | cd .. | |
157 | ||
fb214454 PS |
158 | gccdir=$RPM_BUILD_ROOT%{gcclib} |
159 | mv $gccdir/include-fixed/{limits,syslimits}.h $gccdir/include | |
160 | rm -r $gccdir/include-fixed | |
161 | rm -r $gccdir/install-tools | |
162 | ||
423846e1 PS |
163 | |
164 | cp -ar $build_sysroot/mingw/include $RPM_BUILD_ROOT%{arch} | |
165 | ||
166 | make -C trunk/mingw-w64-crt install \ | |
167 | DESTDIR=$RPM_BUILD_ROOT | |
168 | ||
763b9ff5 PS |
169 | find $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/lib -type f \ |
170 | -exec mv "{}" "$RPM_BUILD_ROOT%{arch}/lib" ";" | |
423846e1 | 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 | |
620b7a54 | 191 | %{gcclib}/include/avxintrin.h |
2fa5f249 PS |
192 | %{gcclib}/include/bmmintrin.h |
193 | %{gcclib}/include/cpuid.h | |
620b7a54 | 194 | %{gcclib}/include/cross-stdarg.h |
2fa5f249 PS |
195 | %{gcclib}/include/emmintrin.h |
196 | %{gcclib}/include/float.h | |
620b7a54 | 197 | %{gcclib}/include/immintrin.h |
2fa5f249 PS |
198 | %{gcclib}/include/iso646.h |
199 | %{gcclib}/include/limits.h | |
200 | %{gcclib}/include/mm3dnow.h | |
201 | %{gcclib}/include/mm_malloc.h | |
202 | %{gcclib}/include/mmintrin-common.h | |
203 | %{gcclib}/include/mmintrin.h | |
204 | %{gcclib}/include/nmmintrin.h | |
205 | %{gcclib}/include/pmmintrin.h | |
206 | %{gcclib}/include/smmintrin.h | |
207 | %{gcclib}/include/stdarg.h | |
208 | %{gcclib}/include/stdbool.h | |
209 | %{gcclib}/include/stddef.h | |
210 | %{gcclib}/include/stdfix.h | |
211 | %{gcclib}/include/syslimits.h | |
212 | %{gcclib}/include/tgmath.h | |
213 | %{gcclib}/include/tmmintrin.h | |
214 | %{gcclib}/include/unwind.h | |
215 | %{gcclib}/include/varargs.h | |
620b7a54 PS |
216 | %{gcclib}/include/wmmintrin.h |
217 | %{gcclib}/include/x86intrin.h | |
2fa5f249 | 218 | %{gcclib}/include/xmmintrin.h |
fb214454 PS |
219 | %attr(755,root,root) %{gcclib}/cc1 |
220 | %attr(755,root,root) %{gcclib}/collect2 | |
620b7a54 | 221 | %{gcclib}/*.o |
fb214454 | 222 | %{gcclib}/libgcc.a |
620b7a54 | 223 | %if %{without bootstrap} |
5ec0ebfe | 224 | %{_bindir}/libgcc_s_sjlj-1.dll |
620b7a54 PS |
225 | %{gcclib}/libgcc_eh.a |
226 | %endif | |
fb214454 PS |
227 | %{gcclib}/libgcov.a |
228 | %{gcclib}/specs* | |
fb214454 PS |
229 | %{_mandir}/man1/%{target}-cpp.1* |
230 | %{_mandir}/man1/%{target}-gcc.1* | |
231 | %{_mandir}/man1/%{target}-gcov.1* | |
423846e1 PS |
232 | %{arch}/include |
233 | %{arch}/lib/*.a | |
7fc88b33 PS |
234 | %if %{without bootstrap} |
235 | %exclude %{arch}/include/c++ | |
236 | %exclude %{arch}/lib/libstdc++.a | |
237 | %exclude %{arch}/lib/libsupc++.a | |
238 | %endif | |
423846e1 | 239 | %{arch}/lib/*.o |
892ff872 PS |
240 | %dir %{arch}/mingw |
241 | %{arch}/mingw/include | |
fb214454 | 242 | |
7fc88b33 | 243 | %if %{without bootstrap} |
fb214454 PS |
244 | %files c++ |
245 | %defattr(644,root,root,755) | |
246 | %attr(755,root,root) %{_bindir}/%{target}-[cg]++ | |
fb214454 PS |
247 | %attr(755,root,root) %{gcclib}/cc1plus |
248 | %{arch}/lib/libstdc++.a | |
249 | %{arch}/lib/libstdc++.la | |
250 | %{arch}/lib/libsupc++.a | |
251 | %{arch}/lib/libsupc++.la | |
7fc88b33 | 252 | %{arch}/include/c++ |
fb214454 PS |
253 | %{_mandir}/man1/%{target}-g++.1* |
254 | %endif |