]> git.pld-linux.org Git - packages/crossmingw64-gcc.git/blob - crossmingw64-gcc.spec
e812a3076f1bda558da256a681feaa50f8f88bcb
[packages/crossmingw64-gcc.git] / crossmingw64-gcc.spec
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 %define         _major_ver      4.4
13 %define         _minor_ver      0
14 Version:        %{_major_ver}.%{_minor_ver}
15 %define         _snap   20090206
16 Release:        0.%{_snap}.1
17 Epoch:          1
18 License:        GPL v3+
19 Group:          Development/Languages
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
25 Patch0:         %{name}-no_include64.patch
26 BuildRequires:  autoconf
27 BuildRequires:  automake
28 BuildRequires:  bison
29 BuildRequires:  crossmingw64-binutils
30 %{!?with_bootstrap:BuildRequires:       crossmingw64-gcc}
31 BuildRequires:  flex
32 BuildRequires:  mpfr-devel
33 BuildRequires:  texinfo >= 4.2
34 Requires:       crossmingw64-binutils
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
67 #setup -q -n gcc-%{version} -a 1
68 %setup -q -n gcc-%{_major_ver}-%{_snap} -a 1
69 #patch100 -p0
70 %patch0 -p1
71 mkdir -p winsup/mingw
72 cp -ar trunk/mingw-w64-headers/include winsup/mingw
73
74 %build
75 build_sysroot=`pwd`/winsup
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} \
87         --libdir=%{_libdir} \
88         --libexecdir=%{_libexecdir} \
89         --includedir=%{arch}/include \
90         --with-gnu-as \
91         --with-gnu-ld \
92         --with-sysroot=%{arch} \
93         %{?with_bootstrap:--with-build-sysroot=$build_sysroot} \
94         --%{?with_bootstrap:dis}%{!?with_bootstrap:en}able-shared \
95         --enable-threads=win32 \
96         --enable-sjlj-exceptions \
97         --enable-languages="c%{!?with_bootstrap:,c++}" \
98         --enable-c99 \
99         --enable-long-long \
100         --enable-decimal-float=yes \
101         --enable-cmath \
102         --disable-nls \
103         --disable-win32-registry \
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 \
109         --disable-symvers \
110         --enable-__cxa_atexit \
111         --disable-libmudflap \
112         --disable-libssp \
113         --with-pkgversion="PLD-Linux" \
114         --with-bugurl="http://bugs.pld-linux.org" \
115         --build=%{_target_platform} \
116         --host=%{_target_platform} \
117         --target=%{target}
118
119 %{__make}
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
130 export CC=%{?with_bootstrap:`pwd`/cross-gcc}%{!?with_bootstrap:%{_bindir}/%{target}-gcc}
131
132 cd trunk/mingw-w64-crt
133
134 ./configure \
135         --host=%{target} \
136         --prefix=%{_prefix} \
137         --with-sysroot=%{?with_bootstrap:$build_sysroot}%{!?with_bootstrap:%{arch}}
138
139 %{__make}
140
141 cd -
142
143 %install
144 build_sysroot=`pwd`/winsup
145
146 rm -rf $RPM_BUILD_ROOT
147 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir},%{arch}/lib,%{arch}/mingw/include}
148
149 cd BUILDDIR
150
151 %{__make} install \
152         DESTDIR=$RPM_BUILD_ROOT
153
154 install gcc/specs $RPM_BUILD_ROOT%{gcclib}
155
156 cd ..
157
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
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
169 find $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/lib -type f \
170         -exec mv "{}" "$RPM_BUILD_ROOT%{arch}/lib" ";"
171
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
175 find $RPM_BUILD_ROOT%{arch}/lib -type f -name '*.a' -o -name '*.o' \
176         -exec %{target}-strip -g -R.note -R.comment "{}" ";"
177 %endif
178
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
187 %dir %{gccarch}
188 %dir %{gcclib}
189 %dir %{gcclib}/include
190 %{gcclib}/include/ammintrin.h
191 %{gcclib}/include/avxintrin.h
192 %{gcclib}/include/bmmintrin.h
193 %{gcclib}/include/cpuid.h
194 %{gcclib}/include/cross-stdarg.h
195 %{gcclib}/include/emmintrin.h
196 %{gcclib}/include/float.h
197 %{gcclib}/include/immintrin.h
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
216 %{gcclib}/include/wmmintrin.h
217 %{gcclib}/include/x86intrin.h
218 %{gcclib}/include/xmmintrin.h
219 %attr(755,root,root) %{gcclib}/cc1
220 %attr(755,root,root) %{gcclib}/collect2
221 %{gcclib}/*.o
222 %{gcclib}/libgcc.a
223 %if %{without bootstrap}
224 %{_bindir}/libgcc_s_sjlj-1.dll
225 %{gcclib}/libgcc_eh.a
226 %endif
227 %{gcclib}/libgcov.a
228 %{gcclib}/specs*
229 %{_mandir}/man1/%{target}-cpp.1*
230 %{_mandir}/man1/%{target}-gcc.1*
231 %{_mandir}/man1/%{target}-gcov.1*
232 %{arch}/include
233 %{arch}/lib/*.a
234 %if %{without bootstrap}
235 %exclude %{arch}/include/c++
236 %exclude %{arch}/lib/libstdc++.a
237 %exclude %{arch}/lib/libsupc++.a
238 %endif
239 %{arch}/lib/*.o
240 %dir %{arch}/mingw
241 %{arch}/mingw/include
242
243 %if %{without bootstrap}
244 %files c++
245 %defattr(644,root,root,755)
246 %attr(755,root,root) %{_bindir}/%{target}-[cg]++
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
252 %{arch}/include/c++
253 %{_mandir}/man1/%{target}-g++.1*
254 %endif
This page took 0.111456 seconds and 2 git commands to generate.