]>
Commit | Line | Data |
---|---|---|
fb214454 PS |
1 | # |
2 | # Conditional build: | |
7fc88b33 | 3 | %bcond_with bootstrap # bootstrap build (only C compiler) |
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 | |
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 | ||
7fc88b33 | 107 | %{__make} -j2 |
423846e1 PS |
108 | |
109 | cd .. | |
110 | ||
111 | cat <<EOF >cross-gcc | |
112 | #!/bin/sh | |
113 | p=`pwd`/BUILDDIR/gcc | |
114 | \${p}/xgcc -B\${p} \$@ | |
115 | EOF | |
116 | chmod 755 cross-gcc | |
117 | ||
118 | export CC=`pwd`/cross-gcc | |
119 | ||
120 | cd trunk/mingw-w64-crt | |
121 | ||
122 | ./configure \ | |
123 | --host=%{target} \ | |
124 | --prefix=%{_prefix} \ | |
125 | --with-sysroot=$build_sysroot \ | |
126 | ||
127 | %{__make} | |
128 | ||
129 | cd - | |
fb214454 PS |
130 | |
131 | %install | |
423846e1 | 132 | build_sysroot=`pwd`/winsup |
892ff872 | 133 | |
fb214454 | 134 | rm -rf $RPM_BUILD_ROOT |
7fc88b33 | 135 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir},%{arch}/lib,%{arch}/mingw/include} |
fb214454 PS |
136 | |
137 | cd BUILDDIR | |
138 | ||
7fc88b33 | 139 | %{__make} install \ |
fb214454 PS |
140 | DESTDIR=$RPM_BUILD_ROOT |
141 | ||
142 | install gcc/specs $RPM_BUILD_ROOT%{gcclib} | |
143 | ||
144 | cd .. | |
145 | ||
fb214454 PS |
146 | gccdir=$RPM_BUILD_ROOT%{gcclib} |
147 | mv $gccdir/include-fixed/{limits,syslimits}.h $gccdir/include | |
148 | rm -r $gccdir/include-fixed | |
149 | rm -r $gccdir/install-tools | |
150 | ||
423846e1 PS |
151 | |
152 | cp -ar $build_sysroot/mingw/include $RPM_BUILD_ROOT%{arch} | |
153 | ||
154 | make -C trunk/mingw-w64-crt install \ | |
155 | DESTDIR=$RPM_BUILD_ROOT | |
156 | ||
7fc88b33 PS |
157 | mv $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/lib/* \ |
158 | $RPM_BUILD_ROOT%{arch}/lib | |
423846e1 | 159 | |
fb214454 PS |
160 | %if 0%{!?debug:1} |
161 | %{target}-strip -g -R.note -R.comment $RPM_BUILD_ROOT%{gcclib}/libgcc.a | |
162 | %{target}-strip -g -R.note -R.comment $RPM_BUILD_ROOT%{gcclib}/libgcov.a | |
423846e1 | 163 | %{target}-strip -g -R.note -R.comment $RPM_BUILD_ROOT%{arch}/lib/*.{a,o} |
fb214454 PS |
164 | %endif |
165 | ||
fb214454 PS |
166 | %clean |
167 | rm -rf $RPM_BUILD_ROOT | |
168 | ||
169 | %files | |
170 | %defattr(644,root,root,755) | |
171 | %attr(755,root,root) %{_bindir}/%{target}-gcc* | |
172 | %attr(755,root,root) %{_bindir}/%{target}-cpp | |
173 | %attr(755,root,root) %{_bindir}/%{target}-gcov | |
fb214454 PS |
174 | %dir %{gccarch} |
175 | %dir %{gcclib} | |
2fa5f249 PS |
176 | %dir %{gcclib}/include |
177 | %{gcclib}/include/ammintrin.h | |
178 | %{gcclib}/include/bmmintrin.h | |
179 | %{gcclib}/include/cpuid.h | |
180 | %{gcclib}/include/emmintrin.h | |
181 | %{gcclib}/include/float.h | |
182 | %{gcclib}/include/iso646.h | |
183 | %{gcclib}/include/limits.h | |
184 | %{gcclib}/include/mm3dnow.h | |
185 | %{gcclib}/include/mm_malloc.h | |
186 | %{gcclib}/include/mmintrin-common.h | |
187 | %{gcclib}/include/mmintrin.h | |
188 | %{gcclib}/include/nmmintrin.h | |
189 | %{gcclib}/include/pmmintrin.h | |
190 | %{gcclib}/include/smmintrin.h | |
191 | %{gcclib}/include/stdarg.h | |
192 | %{gcclib}/include/stdbool.h | |
193 | %{gcclib}/include/stddef.h | |
194 | %{gcclib}/include/stdfix.h | |
195 | %{gcclib}/include/syslimits.h | |
196 | %{gcclib}/include/tgmath.h | |
197 | %{gcclib}/include/tmmintrin.h | |
198 | %{gcclib}/include/unwind.h | |
199 | %{gcclib}/include/varargs.h | |
200 | %{gcclib}/include/xmmintrin.h | |
fb214454 PS |
201 | %attr(755,root,root) %{gcclib}/cc1 |
202 | %attr(755,root,root) %{gcclib}/collect2 | |
203 | %{gcclib}/libgcc.a | |
204 | %{gcclib}/libgcov.a | |
205 | %{gcclib}/specs* | |
fb214454 PS |
206 | %{_mandir}/man1/%{target}-cpp.1* |
207 | %{_mandir}/man1/%{target}-gcc.1* | |
208 | %{_mandir}/man1/%{target}-gcov.1* | |
423846e1 PS |
209 | %{arch}/include |
210 | %{arch}/lib/*.a | |
7fc88b33 PS |
211 | %if %{without bootstrap} |
212 | %exclude %{arch}/include/c++ | |
213 | %exclude %{arch}/lib/libstdc++.a | |
214 | %exclude %{arch}/lib/libsupc++.a | |
215 | %endif | |
423846e1 | 216 | %{arch}/lib/*.o |
892ff872 PS |
217 | %dir %{arch}/mingw |
218 | %{arch}/mingw/include | |
fb214454 | 219 | |
7fc88b33 | 220 | %if %{without bootstrap} |
fb214454 PS |
221 | %files c++ |
222 | %defattr(644,root,root,755) | |
223 | %attr(755,root,root) %{_bindir}/%{target}-[cg]++ | |
fb214454 PS |
224 | %attr(755,root,root) %{gcclib}/cc1plus |
225 | %{arch}/lib/libstdc++.a | |
226 | %{arch}/lib/libstdc++.la | |
227 | %{arch}/lib/libsupc++.a | |
228 | %{arch}/lib/libsupc++.la | |
7fc88b33 | 229 | %{arch}/include/c++ |
fb214454 PS |
230 | %{_mandir}/man1/%{target}-g++.1* |
231 | %endif |