]> git.pld-linux.org Git - packages/crossmingw64-gcc.git/blob - crossmingw64-gcc.spec
- BR: subversion for 'svnversion' in %%prep.
[packages/crossmingw64-gcc.git] / crossmingw64-gcc.spec
1 # TODO: host _bindir is not the place for Win64 .dll!
2 #
3 # Conditional build:
4 %bcond_with     bootstrap       # bootstrap build (only C compiler with static runtime)
5 #
6 Summary:        Cross Mingw64 GNU binary utility development utilities - gcc
7 Summary(es.UTF-8):      Utilitarios para desarrollo de binarios de la GNU - Mingw64 gcc
8 Summary(fr.UTF-8):      Utilitaires de développement binaire de GNU - Mingw64 gcc
9 Summary(pl.UTF-8):      Skrośne narzędzia programistyczne GNU dla Mingw64 - gcc
10 Summary(pt_BR.UTF-8):   Utilitários para desenvolvimento de binários da GNU - Mingw64 gcc
11 Summary(tr.UTF-8):      GNU geliştirme araçları - Mingw64 gcc
12 Name:           crossmingw64-gcc
13 Version:        4.5.1
14 Release:        1
15 Epoch:          1
16 License:        GPL v3+
17 Group:          Development/Languages
18 Source0:        ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{version}/gcc-%{version}.tar.bz2
19 # Source0-md5:  48231a8e33ed6e058a341c53b819de1a
20 # svn co https://mingw-w64.svn.sourceforge.net/svnroot/mingw-w64/branches/releases/v1.0/mingw-w64-crt mingw64-crt
21 %define         _rev    3654
22 Source1:        mingw64-crt.tar.bz2
23 # Source1-md5:  fd2acf22ae08c8929e384bd74c0cfa55
24 Patch0:         gcc-branch.diff
25 Patch1:         gcc-mingw-dirs.patch
26 BuildRequires:  autoconf
27 BuildRequires:  automake
28 BuildRequires:  bison
29 BuildRequires:  crossmingw64-binutils
30 %{!?with_bootstrap:BuildRequires:       crossmingw64-gcc}
31 BuildRequires:  crossmingw64-headers
32 BuildRequires:  flex
33 BuildRequires:  gmp-devel >= 4.1
34 BuildRequires:  libmpc-devel
35 BuildRequires:  mpfr-devel >= 2.3.0
36 BuildRequires:  subversion
37 BuildRequires:  texinfo >= 4.2
38 Requires:       crossmingw64-binutils
39 Requires:       crossmingw64-headers
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %define         target          x86_64-pc-mingw32
43 %define         arch            %{_prefix}/%{target}
44 %define         gccarch         %{_libdir}/gcc/%{target}
45 %define         gcclib          %{gccarch}/%{version}
46
47 %define         _noautostrip    .*/lib.*\\.a
48
49 # workaround bootstrap bug: http://gcc.gnu.org/bugzilla/PR25672
50 %define         filterout       -march=i486 -march=i686 -mtune=pentium4
51
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++
56 and libstdc++, all cross targeted to x86_64-pc-mingw32.
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++
70 and libstdc++, all cross targeted to x86_64-pc-mingw32.
71
72 This package contains cross targeted g++ and libstdc++.
73
74 %prep
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
86
87 %build
88 rm -rf BUILDDIR && install -d BUILDDIR/%{target} && cd BUILDDIR
89
90 # setup system headers for local build.
91 cp -ar %{arch}/include %{target}/include
92
93 CFLAGS="%{rpmcflags}" \
94 CXXFLAGS="%{rpmcflags}" \
95 LDFLAGS="%{rpmldflags}" \
96 TEXCONFIG=false \
97 ../configure \
98         --enable-checking=release \
99         --prefix=%{_prefix} \
100         --infodir=%{_infodir} \
101         --mandir=%{_mandir} \
102         --libdir=%{_libdir} \
103         --libexecdir=%{_libexecdir} \
104         --includedir=%{arch}/include \
105         --with-gnu-as \
106         --with-gnu-ld \
107         --with-sysroot=%{arch} \
108         --%{?with_bootstrap:dis}%{!?with_bootstrap:en}able-shared \
109         --disable-win32-registry \
110         --enable-threads=win32 \
111         --enable-tls \
112         --enable-sjlj-exceptions \
113         --enable-languages="c%{!?with_bootstrap:,c++}" \
114         --disable-multilib \
115         --disable-nls \
116         --disable-libmudflap \
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 if [ ! -f "$RPM_BUILD_ROOT%{_bindir}/libgcc_s_sjlj-1.dll" ]; then
160         echo "libgcc_s_sjlj-1.dll install still broken?"
161         install %{target}/libgcc/shlib/libgcc_s_sjlj-1.dll $RPM_BUILD_ROOT%{_bindir}
162 fi
163
164 cd ..
165
166 gccdir=$RPM_BUILD_ROOT%{gcclib}
167 mv $gccdir/include-fixed/{limits,syslimits}.h $gccdir/include
168 rm -r $gccdir/include-fixed
169 rm -r $gccdir/install-tools
170
171 %{__make} -C mingw64-crt install \
172         DESTDIR=$RPM_BUILD_ROOT
173
174 %if 0%{!?debug:1}
175 %{target}-strip -g -R.note -R.comment $RPM_BUILD_ROOT%{gcclib}/libgcc.a
176 %{target}-strip -g -R.note -R.comment $RPM_BUILD_ROOT%{gcclib}/libgcov.a
177 find $RPM_BUILD_ROOT%{arch}/lib -type f -name '*.a' -o -name '*.o' \
178         -exec %{target}-strip -g -R.note -R.comment "{}" ";"
179 %endif
180
181 %clean
182 rm -rf $RPM_BUILD_ROOT
183
184 %files
185 %defattr(644,root,root,755)
186 %attr(755,root,root) %{_bindir}/%{target}-gcc*
187 %attr(755,root,root) %{_bindir}/%{target}-cpp
188 %attr(755,root,root) %{_bindir}/%{target}-gcov
189 %dir %{gccarch}
190 %dir %{gcclib}
191 %dir %{gcclib}/include
192 %{gcclib}/include/abmintrin.h
193 %{gcclib}/include/ammintrin.h
194 %{gcclib}/include/avxintrin.h
195 %{gcclib}/include/bmmintrin.h
196 %{gcclib}/include/cpuid.h
197 %{gcclib}/include/cross-stdarg.h
198 %{gcclib}/include/emmintrin.h
199 %{gcclib}/include/float.h
200 %{gcclib}/include/fma4intrin.h
201 %{gcclib}/include/ia32intrin.h
202 %{gcclib}/include/immintrin.h
203 %{gcclib}/include/iso646.h
204 %{gcclib}/include/limits.h
205 %{gcclib}/include/lwpintrin.h
206 %{gcclib}/include/mm3dnow.h
207 %{gcclib}/include/mm_malloc.h
208 %{gcclib}/include/mmintrin.h
209 %{gcclib}/include/nmmintrin.h
210 %{gcclib}/include/pmmintrin.h
211 %{gcclib}/include/popcntintrin.h
212 %{gcclib}/include/smmintrin.h
213 %{gcclib}/include/stdarg.h
214 %{gcclib}/include/stdbool.h
215 %{gcclib}/include/stddef.h
216 %{gcclib}/include/stdfix.h
217 %{gcclib}/include/stdint-gcc.h
218 %{gcclib}/include/stdint.h
219 %{gcclib}/include/syslimits.h
220 %{gcclib}/include/tgmath.h
221 %{gcclib}/include/tmmintrin.h
222 %{gcclib}/include/unwind.h
223 %{gcclib}/include/varargs.h
224 %{gcclib}/include/wmmintrin.h
225 %{gcclib}/include/x86intrin.h
226 %{gcclib}/include/xmmintrin.h
227 %{gcclib}/include/xopintrin.h
228 %attr(755,root,root) %{gcclib}/cc1
229 %attr(755,root,root) %{gcclib}/collect2
230 %attr(755,root,root) %{gcclib}/lto-wrapper
231 %{gcclib}/*.o
232 %{gcclib}/libgcc.a
233 %if %{without bootstrap}
234 %{_bindir}/libgcc_s_sjlj-1.dll
235 %{gcclib}/libgcc_eh.a
236 %endif
237 %{gcclib}/libgcov.a
238 %{gcclib}/specs*
239 %{_mandir}/man1/%{target}-cpp.1*
240 %{_mandir}/man1/%{target}-gcc.1*
241 %{_mandir}/man1/%{target}-gcov.1*
242 %{arch}/lib/*.a
243 %if %{without bootstrap}
244 %exclude %{arch}/include/c++
245 %exclude %{arch}/lib/libstdc++.a
246 %exclude %{arch}/lib/libsupc++.a
247 %endif
248 %{arch}/lib/*.o
249
250 %if %{without bootstrap}
251 %files c++
252 %defattr(644,root,root,755)
253 %attr(755,root,root) %{_bindir}/%{target}-[cg]++
254 %attr(755,root,root) %{gcclib}/cc1plus
255 %{_bindir}/libstdc++-6.dll
256 %{arch}/lib/libstdc++.a
257 %{arch}/lib/libstdc++.la
258 %{arch}/lib/libsupc++.a
259 %{arch}/lib/libsupc++.la
260 %{arch}/include/c++
261 %{_mandir}/man1/%{target}-g++.1*
262 %endif
This page took 0.074023 seconds and 4 git commands to generate.