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