]> git.pld-linux.org Git - packages/crossmingw32-gcc.git/blob - crossmingw32-gcc.spec
- allow override flags.
[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.3
8 %define         apiver          3.5
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:        4
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:  e744b30c834360fccac41eb7269a3011
26 Source1:        http://dl.sourceforge.net/mingw/%{apisrc}.tar.gz
27 # Source1-md5:  2529dffea94118865cdc06c1f7ead697
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         --enable-languages="c,c++,f77,java,objc" \
225         --with-gnu-as \
226         --with-gnu-ld \
227         --with-gxx-include-dir=%{arch}/include/g++ \
228         --enable-threads \
229         --build=%{_target_platform} \
230         --host=%{_target_platform} \
231         --target=%{target}
232
233 #touch ../gcc/c-gperf.h
234
235 %{__make} \
236         LDFLAGS_FOR_TARGET="%{rpmldflags}" \
237         TARGET_LIBGCC2_CFLAGS="-UCROSS_COMPILE" \
238         build_tooldir="$build_tooldir" \
239         FLAGS_FOR_TARGET="-B${build_tooldir}/bin -B${build_tooldir}/lib -isystem ${build_tooldir}/include -nostdinc" \
240         CFLAGS_FOR_TARGET="-nostdinc" \
241         NM_FOR_TARGET="%{target}-nm"
242
243 # build libobjc.dll for Objective C
244 # it must be called from obj-%{target_platform}/%{target}/libobjc, but
245 # GCC_FOR_TARGET must be passed
246 #
247 #make -C %{target}/libobjc \
248 #       LDFLAGS="%{rpmldflags}" \
249 #       TARGET_LIBGCC2_CFLAGS="-UCROSS_COMPILE" \
250 #       DLLTOOL="%{target}-dlltool --as=%{target}-as" libobjc.dll
251
252 # spec files for msvcrt*.dll configurations
253 cd gcc
254 for n in msvcrt msvcrt20 msvcrt40; do
255         sed "s/crtdll/$n/g" <specs | sed "s/crt1/crt2/g" >specs.$n
256 done
257
258 %install
259 rm -rf $RPM_BUILD_ROOT
260 cd gcc-%{version}
261
262 install -d $RPM_BUILD_ROOT%{_bindir}
263 install -d $RPM_BUILD_ROOT%{_datadir}
264 cd obj-%{target_platform}
265
266 %{__make} install \
267         DESTDIR=$RPM_BUILD_ROOT
268
269 cd gcc
270 install specs.msvcrt specs.msvcrt20 specs.msvcrt40 $RPM_BUILD_ROOT%{gcclib}
271 cd ../..
272
273 mv -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-* $RPM_BUILD_ROOT%{_bindir}
274
275 # already in arch/lib, shouldn't be here
276 rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty.a
277
278 %if 0%{!?debug:1}
279 # strip linux binaries
280 strip -R .comment -R .note \
281         `echo $RPM_BUILD_ROOT{%{_bindir}/*,%{arch}/bin/*} | grep -v gccbug` \
282         $RPM_BUILD_ROOT%{gcclib}/{cc1*,f771,jc1,jvgenmain}
283
284 # strip mingw32 libraries
285 %{target}-strip -g \
286         $RPM_BUILD_ROOT%{gcclib}/libgcc.a \
287         $RPM_BUILD_ROOT%{arch}/lib/lib*.a
288 %endif
289
290 # restore hardlinks
291 ln -f $RPM_BUILD_ROOT%{_bindir}/%{target}-{g++,c++}
292 ln -f $RPM_BUILD_ROOT%{arch}/bin/{g++,c++}
293
294 # the same... make hardlink
295 ln -f $RPM_BUILD_ROOT%{arch}/bin/gcc $RPM_BUILD_ROOT%{_bindir}/%{target}-gcc
296
297 %clean
298 rm -rf $RPM_BUILD_ROOT
299
300 %files
301 %defattr(644,root,root,755)
302 %attr(755,root,root) %{_bindir}/%{target}-gcc*
303 %attr(755,root,root) %{_bindir}/%{target}-cpp
304 %attr(755,root,root) %{_bindir}/%{target}-gcov
305 %attr(755,root,root) %{arch}/bin/gcc
306 %{arch}/lib/libiberty.a
307
308 %dir %{gccarch}
309 %dir %{gcclib}
310 %attr(755,root,root) %{gcclib}/cc1
311 %{gcclib}/libgcc.a
312 %{gcclib}/libgcov.a
313 %{gcclib}/specs*
314 %{gcclib}/include
315
316 %{_mandir}/man1/%{target}-cpp.1*
317 %{_mandir}/man1/%{target}-gcc.1*
318 %{_mandir}/man1/%{target}-gcov.1*
319
320 %files c++
321 %defattr(644,root,root,755)
322 %attr(755,root,root) %{_bindir}/%{target}-[cg]++
323 %attr(755,root,root) %{arch}/bin/[cg]++
324 %attr(755,root,root) %{gcclib}/cc1plus
325 %{arch}/lib/libstdc++.a
326 %{arch}/lib/libstdc++.la
327 %{arch}/lib/libsupc++.a
328 %{arch}/lib/libsupc++.la
329 %{arch}/include/g++
330 %{_mandir}/man1/%{target}-g++.1*
331
332 %files objc
333 %defattr(644,root,root,755)
334 %attr(755,root,root) %{gcclib}/cc1obj
335 %{arch}/lib/libobjc.a
336 %{arch}/lib/libobjc.la
337
338 %files g77
339 %defattr(644,root,root,755)
340 %attr(755,root,root) %{_bindir}/%{target}-g77
341 %attr(755,root,root) %{gcclib}/f771
342 %{arch}/lib/libfrtbegin.a
343 %{arch}/lib/libg2c.a
344 %{arch}/lib/libg2c.la
345 %{_mandir}/man1/%{target}-g77.1*
346
347 %files java
348 %defattr(644,root,root,755)
349 %attr(755,root,root) %{_bindir}/%{target}-gcj
350 %attr(755,root,root) %{_bindir}/%{target}-gcjh
351 %attr(755,root,root) %{_bindir}/%{target}-grepjar
352 %attr(755,root,root) %{_bindir}/%{target}-jar
353 %attr(755,root,root) %{_bindir}/%{target}-jcf-dump
354 %attr(755,root,root) %{_bindir}/%{target}-jv-scan
355 #%attr(755,root,root) %{arch}/bin/grepjar
356 #%attr(755,root,root) %{arch}/bin/jar
357 %attr(755,root,root) %{gcclib}/jc1
358 %attr(755,root,root) %{gcclib}/jvgenmain
359 %{_mandir}/man1/%{target}-gcj.1*
360 %{_mandir}/man1/%{target}-gcjh.1*
361 %{_mandir}/man1/%{target}-grepjar.1*
362 %{_mandir}/man1/%{target}-jar.1*
363 %{_mandir}/man1/%{target}-jcf-dump.1*
364 %{_mandir}/man1/%{target}-jv-scan.1*
This page took 0.137216 seconds and 3 git commands to generate.