]> git.pld-linux.org Git - packages/crossmingw32-gcc.git/blob - crossmingw32-gcc.spec
- rel 4
[packages/crossmingw32-gcc.git] / crossmingw32-gcc.spec
1 #
2 # Conditional build:
3 %bcond_with     bootstrap
4 #
5
6 %define         DASHED_SNAP     %{nil}
7 %define         SNAP            %(echo %{DASHED_SNAP} | sed -e "s#-##g")
8 %define         GCC_VERSION     3.4.3
9 %define         apiver          3.2
10 %define         apisrc          w32api-%{apiver}
11 %define         runver          3.7
12 %define         runsrc          mingw-runtime-%{runver}
13 Summary:        Cross Mingw32 GNU binary utility development utilities - gcc
14 Summary(es):    Utilitarios para desarrollo de binarios de la GNU - Mingw32 gcc
15 Summary(fr):    Utilitaires de développement binaire de GNU - Mingw32 gcc
16 Summary(pl):    Skro¶ne narzêdzia programistyczne GNU dla Mingw32 - gcc
17 Summary(pt_BR): Utilitários para desenvolvimento de binários da GNU - Mingw32 gcc
18 Summary(tr):    GNU geliþtirme araçlarý - Mingw32 gcc
19 Name:           crossmingw32-gcc
20 Version:        %{GCC_VERSION}
21 Release:        4
22 Epoch:          1
23 License:        GPL
24 Group:          Development/Languages
25 Source0:        ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{GCC_VERSION}/gcc-%{GCC_VERSION}.tar.bz2
26 # Source0-md5:  e744b30c834360fccac41eb7269a3011
27 Source1:        http://dl.sourceforge.net/mingw/%{apisrc}.tar.gz
28 # Source1-md5:  ea357143f74f05a0ddccc0d2bebe9b03
29 Source2:        http://dl.sourceforge.net/mingw/%{runsrc}.tar.gz
30 # Source2-md5:  33db567db9a2034a44bf216762049df4
31 Patch0:         gcc-nodebug.patch
32 Patch1:         %{name}-noioctl.patch
33 BuildRequires:  autoconf
34 BuildRequires:  automake
35 BuildRequires:  bison
36 BuildRequires:  crossmingw32-binutils >= 2.15.91.0.2-2
37 BuildRequires:  flex
38 %if %{without bootstrap}
39 BuildRequires:  crossmingw32-runtime >= 3.5
40 BuildRequires:  crossmingw32-w32api >= 3.1
41 %endif
42 Requires:       crossmingw32-binutils >= 2.15.91.0.2-2
43 Requires:       gcc-dirs
44 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45
46 %define         no_install_post_strip   1
47
48 %define         target          i386-mingw32
49 %define         target_platform i386-pc-mingw32
50 %define         arch            %{_prefix}/%{target}
51 %define         gccarch         %{_libdir}/gcc/%{target}
52 %define         gcclib          %{_libdir}/gcc/%{target}/%{version}
53
54 %description
55 crossmingw32 is a complete cross-compiling development system for
56 building stand-alone Microsoft Windows applications under Linux using
57 the Mingw32 build libraries. This includes a binutils, gcc with g++
58 and objc, and libstdc++, all cross targeted to i386-mingw32, along
59 with supporting Win32 libraries in 'coff' format from free sources.
60
61 This package contains cross targeted gcc.
62
63 %description -l de
64 Dieses Paket enthält einen Cross-gcc, der es erlaubt, auf einem
65 anderem Rechner Code für Win32 zu generieren.
66
67 %description -l pl
68 crossmingw32 jest kompletnym systemem do kompilacji skro¶nej,
69 pozwalaj±cym budowaæ aplikacje MS Windows pod Linuksem u¿ywaj±c
70 bibliotek Mingw32. System sk³ada siê z binutils, gcc z g++ i objc,
71 libstdc++ - wszystkie generuj±ce kod dla platformy i386-mingw32, oraz
72 z bibliotek w formacie COFF.
73
74 Ten pakiet zawiera gcc generuj±ce skro¶nie kod dla Win32.
75
76 %package c++
77 Summary:        Mingw32 binary utility development utilities - g++
78 Summary(pl):    Zestaw narzêdzi mingw32 - g++
79 Group:          Development/Languages
80 Requires:       %{name} = %{epoch}:%{version}-%{release}
81
82 %description c++
83 crossmingw32 is a complete cross-compiling development system for
84 building stand-alone Microsoft Windows applications under Linux using
85 the Mingw32 build libraries. This includes a binutils, gcc with g++
86 and objc, and libstdc++, all cross targeted to i386-mingw32, along
87 with supporting Win32 libraries in 'coff' format from free sources.
88
89 This package contains cross targeted g++ and (static) libstdc++.
90
91 %description c++ -l pl
92 crossmingw32 jest kompletnym systemem do kompilacji skro¶nej,
93 pozwalaj±cym budowaæ aplikacje MS Windows pod Linuksem u¿ywaj±c
94 bibliotek mingw32. System sk³ada siê z binutils, gcc z g++ i objc,
95 libstdc++ - wszystkie generuj±ce kod dla platformy i386-mingw32, oraz
96 z bibliotek w formacie COFF.
97
98 Ten pakiet zawiera g++ generuj±ce kod pod Win32 oraz bibliotekê
99 libstdc++.
100
101 # does this even work?
102 %package objc
103 Summary:        Mingw32 binary utility development utilities - objc
104 Summary(pl):    Zestaw narzêdzi mingw32 - objc
105 Group:          Development/Languages
106 Requires:       %{name} = %{epoch}:%{version}-%{release}
107
108 %description objc
109 crossmingw32 is a complete cross-compiling development system for
110 building stand-alone Microsoft Windows applications under Linux using
111 the Mingw32 build libraries. This includes a binutils, gcc with g++
112 and objc, and libstdc++, all cross targeted to i386-mingw32, along
113 with supporting Win32 libraries in 'coff' format from free sources.
114
115 This package contains cross targeted objc.
116
117 %description objc -l pl
118 crossmingw32 jest kompletnym systemem do kompilacji skro¶nej,
119 pozwalaj±cym budowaæ aplikacje MS Windows pod Linuksem u¿ywaj±c
120 bibliotek mingw32. System sk³ada siê z binutils, gcc z g++ i objc,
121 libstdc++ - wszystkie generuj±ce kod dla platformy i386-mingw32, oraz
122 z bibliotek w formacie COFF.
123
124 Ten pakiet zawiera kompilator objc generuj±cy kod pod Win32.
125
126 # does this even work?
127 %package g77
128 Summary:        Mingw32 binary utility development utilities - g77
129 Summary(pl):    Zestaw narzêdzi mingw32 - g77
130 Group:          Development/Languages
131 Requires:       %{name} = %{epoch}:%{version}-%{release}
132
133 %description g77
134 crossmingw32 is a complete cross-compiling development system for
135 building stand-alone Microsoft Windows applications under Linux using
136 the Mingw32 build libraries. This includes a binutils, gcc with g++
137 and objc, and libstdc++, all cross targeted to i386-mingw32, along
138 with supporting Win32 libraries in 'coff' format from free sources.
139
140 This package contains cross targeted g77.
141
142 %description g77 -l pl
143 crossmingw32 jest kompletnym systemem do kompilacji skro¶nej,
144 pozwalaj±cym budowaæ aplikacje MS Windows pod Linuksem u¿ywaj±c
145 bibliotek mingw32. System sk³ada siê z binutils, gcc z g++ i objc,
146 libstdc++ - wszystkie generuj±ce kod dla platformy i386-mingw32, oraz
147 z bibliotek w formacie COFF.
148
149 Ten pakiet zawiera g77 generuj±cy kod pod Win32.
150
151 # does this even work?
152 %package java
153 Summary:        Mingw32 binary utility development utilities - java
154 Summary(pl):    Zestaw narzêdzi mingw32 - java
155 Group:          Development/Languages
156 Requires:       %{name} = %{epoch}:%{version}-%{release}
157
158 %description java
159 crossmingw32 is a complete cross-compiling development system for
160 building stand-alone Microsoft Windows applications under Linux using
161 the Mingw32 build libraries. This includes a binutils, gcc with g++
162 and objc, and libstdc++, all cross targeted to i386-mingw32, along
163 with supporting Win32 libraries in 'coff' format from free sources.
164
165 This package contains cross targeted java.
166
167 %description java -l pl
168
169 crossmingw32 jest kompletnym systemem do kompilacji skro¶nej,
170 pozwalaj±cym budowaæ aplikacje MS Windows pod Linuksem u¿ywaj±c
171 bibliotek mingw32. System sk³ada siê z binutils, gcc z g++ i objc,
172 libstdc++ - wszystkie generuj±ce kod dla platformy i386-mingw32, oraz
173 z bibliotek w formacie COFF.
174
175 Ten pakiet zawiera kompilator Javy generuj±cy kod pod Win32.
176
177 %prep
178 %setup -q -c
179 cd gcc-%{version}
180 %if %{with bootstrap}
181 mkdir winsup
182 tar xzf %{SOURCE1} -C winsup
183 tar xzf %{SOURCE2} -C winsup
184 %endif
185 %{!?debug:%patch0 -p1}
186 %patch1 -p1
187
188 %build
189 cd gcc-%{version}
190 %if %{with bootstrap}
191 for tool in as ar dlltool ld nm ranlib strip ; do
192         ln -sf %{arch}/bin/$tool winsup/bin/$tool
193 done
194 build_tooldir=`pwd`/winsup
195 %else
196 build_tooldir=%{arch}
197 %endif
198
199 cp /usr/share/automake/config.sub .
200 cp /usr/share/automake/config.sub boehm-gc
201
202 rm -rf obj-%{target_platform} && install -d obj-%{target_platform} && cd obj-%{target_platform}
203
204 # note: alpha's -mieee and sparc's -mtune=* are not valid for target's g++
205 CFLAGS="%{rpmcflags}" \
206 %ifarch alpha
207 CXXFLAGS="`echo '%{rpmcflags}' | sed -e 's/ \?-mieee\>//'`" \
208 %else
209 %ifarch sparc sparc64 sparcv9
210 CXXFLAGS="`echo '%{rpmcflags}' | sed -e 's/ \?-mtune[=0-9a-z]*//'`" \
211 %else
212 CXXFLAGS="%{rpmcflags}" \
213 %endif
214 %endif
215 LDFLAGS="%{rpmldflags}" \
216 TEXCONFIG=false \
217 ../configure \
218         --prefix=%{_prefix} \
219         --infodir=%{_infodir} \
220         --mandir=%{_mandir} \
221         --bindir=%{arch}/bin \
222         --libdir=%{_libdir} \
223         --libexecdir=%{_libexecdir} \
224         --includedir=%{arch}/include \
225         --enable-languages="c,c++,f77,java,objc" \
226         --with-gnu-as \
227         --with-gnu-ld \
228         --with-gxx-include-dir=%{arch}/include/g++ \
229         --enable-threads \
230         --build=%{_target_platform} \
231         --host=%{_target_platform} \
232         --target=%{target}
233
234 #touch ../gcc/c-gperf.h
235
236 %{__make} \
237         LDFLAGS_FOR_TARGET="%{rpmldflags}" \
238         TARGET_LIBGCC2_CFLAGS="-UCROSS_COMPILE" \
239         build_tooldir="$build_tooldir" \
240         FLAGS_FOR_TARGET="-B${build_tooldir}/bin -B${build_tooldir}/lib -isystem ${build_tooldir}/include -nostdinc" \
241         CFLAGS_FOR_TARGET="-nostdinc" \
242         NM_FOR_TARGET="%{target}-nm"
243
244 # build libobjc.dll for Objective C
245 # it must be called from obj-%{target_platform}/%{target}/libobjc, but
246 # GCC_FOR_TARGET must be passed
247 #
248 #make -C %{target}/libobjc \
249 #       LDFLAGS="%{rpmldflags}" \
250 #       TARGET_LIBGCC2_CFLAGS="-UCROSS_COMPILE" \
251 #       DLLTOOL="%{target}-dlltool --as=%{target}-as" libobjc.dll
252
253 # spec files for msvcrt*.dll configurations
254 cd gcc
255 for n in msvcrt msvcrt20 msvcrt40; do
256         sed "s/crtdll/$n/g" <specs | sed "s/crt1/crt2/g" >specs.$n
257 done
258
259 %install
260 rm -rf $RPM_BUILD_ROOT
261 cd gcc-%{version}
262
263 install -d $RPM_BUILD_ROOT%{_bindir}
264 install -d $RPM_BUILD_ROOT%{_datadir}
265 cd obj-%{target_platform}
266
267 %{__make} install \
268         DESTDIR=$RPM_BUILD_ROOT
269
270 cd gcc
271 install specs.msvcrt specs.msvcrt20 specs.msvcrt40 $RPM_BUILD_ROOT%{gcclib}
272 cd ../..
273
274 mv -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-* $RPM_BUILD_ROOT%{_bindir}
275
276 # already in arch/lib, shouldn't be here
277 rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty.a
278
279 %if 0%{!?debug:1}
280 # strip linux binaries
281 strip -R .comment -R .note \
282         `echo $RPM_BUILD_ROOT{%{_bindir}/*,%{arch}/bin/*} | grep -v gccbug` \
283         $RPM_BUILD_ROOT%{gcclib}/{cc1*,f771,jc1,jvgenmain}
284
285 # strip mingw32 libraries
286 %{target}-strip -g \
287         $RPM_BUILD_ROOT%{gcclib}/libgcc.a \
288         $RPM_BUILD_ROOT%{arch}/lib/lib*.a
289 %endif
290
291 # restore hardlinks
292 ln -f $RPM_BUILD_ROOT%{_bindir}/%{target}-{g++,c++}
293 ln -f $RPM_BUILD_ROOT%{arch}/bin/{g++,c++}
294
295 # the same... make hardlink
296 ln -f $RPM_BUILD_ROOT%{arch}/bin/gcc $RPM_BUILD_ROOT%{_bindir}/%{target}-gcc
297
298 %clean
299 rm -rf $RPM_BUILD_ROOT
300
301 %files
302 %defattr(644,root,root,755)
303 %attr(755,root,root) %{_bindir}/%{target}-gcc*
304 %attr(755,root,root) %{_bindir}/%{target}-cpp
305 %attr(755,root,root) %{_bindir}/%{target}-gcov
306 %attr(755,root,root) %{arch}/bin/gcc
307 %{arch}/lib/libiberty.a
308
309 %dir %{gccarch}
310 %dir %{gcclib}
311 %attr(755,root,root) %{gcclib}/cc1
312 %{gcclib}/libgcc.a
313 %{gcclib}/libgcov.a
314 %{gcclib}/specs*
315 %{gcclib}/include
316
317 %{_mandir}/man1/%{target}-cpp.1*
318 %{_mandir}/man1/%{target}-gcc.1*
319 %{_mandir}/man1/%{target}-gcov.1*
320
321 %files c++
322 %defattr(644,root,root,755)
323 %attr(755,root,root) %{_bindir}/%{target}-[cg]++
324 %attr(755,root,root) %{arch}/bin/[cg]++
325 %attr(755,root,root) %{gcclib}/cc1plus
326 %{arch}/lib/libstdc++.a
327 %{arch}/lib/libstdc++.la
328 %{arch}/lib/libsupc++.a
329 %{arch}/lib/libsupc++.la
330 %{arch}/include/g++
331 %{_mandir}/man1/%{target}-g++.1*
332
333 %files objc
334 %defattr(644,root,root,755)
335 %attr(755,root,root) %{gcclib}/cc1obj
336 %{arch}/lib/libobjc.a
337 %{arch}/lib/libobjc.la
338
339 %files g77
340 %defattr(644,root,root,755)
341 %attr(755,root,root) %{_bindir}/%{target}-g77
342 %attr(755,root,root) %{gcclib}/f771
343 %{arch}/lib/libfrtbegin.a
344 %{arch}/lib/libg2c.a
345 %{arch}/lib/libg2c.la
346 %{_mandir}/man1/%{target}-g77.1*
347
348 %files java
349 %defattr(644,root,root,755)
350 %attr(755,root,root) %{_bindir}/%{target}-gcj
351 %attr(755,root,root) %{_bindir}/%{target}-gcjh
352 %attr(755,root,root) %{_bindir}/%{target}-grepjar
353 %attr(755,root,root) %{_bindir}/%{target}-jar
354 %attr(755,root,root) %{_bindir}/%{target}-jcf-dump
355 %attr(755,root,root) %{_bindir}/%{target}-jv-scan
356 #%attr(755,root,root) %{arch}/bin/grepjar
357 #%attr(755,root,root) %{arch}/bin/jar
358 %attr(755,root,root) %{gcclib}/jc1
359 %attr(755,root,root) %{gcclib}/jvgenmain
360 %{_mandir}/man1/%{target}-gcj.1*
361 %{_mandir}/man1/%{target}-gcjh.1*
362 %{_mandir}/man1/%{target}-grepjar.1*
363 %{_mandir}/man1/%{target}-jar.1*
364 %{_mandir}/man1/%{target}-jcf-dump.1*
365 %{_mandir}/man1/%{target}-jv-scan.1*
This page took 0.052885 seconds and 3 git commands to generate.