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