1 | %define ver_major 4
|
---|
2 | %define ver_minor 9
|
---|
3 | %define ver_patch 2
|
---|
4 |
|
---|
5 | %define os2_release 1
|
---|
6 |
|
---|
7 | %define rpm_release 3
|
---|
8 |
|
---|
9 | %global gcc_version %{ver_major}.%{ver_minor}.%{ver_patch}
|
---|
10 | %global gcc_target_platform %{_target_cpu}
|
---|
11 |
|
---|
12 | # New package version scheme: X.Y.Z.N-R, where X.Y.Z is the GCC release (e.g.
|
---|
13 | # 4.5.4, matches gcc_version above), N is the OS/2 release (1, 2, etc) and R is
|
---|
14 | # the RPM release (1, 2, etc). The OS/2 release number increases with each
|
---|
15 | # OS/2 specific update to the sources followed by a new build, the RPM repease
|
---|
16 | # number increases with each new RPM build (which may use the same source tree
|
---|
17 | # but fix only some RPM-specific things). Note that the RPM release number
|
---|
18 | # resets to 1 each time the OS/2 release increases (which is reset to 1 in turn
|
---|
19 | # when the GCC release changes.
|
---|
20 |
|
---|
21 | Summary: Various compilers (C, C++, Objective-C, Java, ...)
|
---|
22 | Name: gcc
|
---|
23 | Version: %{gcc_version}.%{os2_release}
|
---|
24 | Release: %{rpm_release}%{?dist}
|
---|
25 |
|
---|
26 | # libgcc, libgfortran, libmudflap, libgomp, libstdc++ and crtstuff have
|
---|
27 | # GCC Runtime Exception.
|
---|
28 | License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions
|
---|
29 | Group: Development/Languages
|
---|
30 | URL: http://gcc.gnu.org
|
---|
31 |
|
---|
32 | Source0: gcc-gcc-4_9-branch-os2.tar.bz2
|
---|
33 | Source1: gcc-libgcc-fwd.zip
|
---|
34 |
|
---|
35 | Obsoletes: gcc < %{gcc_version}
|
---|
36 |
|
---|
37 | BuildRequires: binutils make
|
---|
38 | BuildRequires: os2-base-fhs
|
---|
39 | BuildRequires: ash gcc gcc-wlink gcc-wrc grep gettext-devel diffutils gawk flex sed
|
---|
40 | BuildRequires: gmp-devel >= 4.1.2-8, mpfr-devel >= 2.2.1, mpc-devel
|
---|
41 | BuildRequires: libc-devel >= 0.6.6-25
|
---|
42 | BuildRequires: rpm >= 4.8.1-22
|
---|
43 |
|
---|
44 | Requires: libgcc1 = %{version}-%{release}
|
---|
45 | Requires: libssp = %{version}-%{release}
|
---|
46 | Requires: libstdc++6 = %{version}-%{release}
|
---|
47 | Requires: libsupc++6 = %{version}-%{release}
|
---|
48 | # libc header fixes
|
---|
49 | Requires: libc-devel >= 0.6.6-25
|
---|
50 | # rpm color workaround
|
---|
51 | Requires: rpm >= 4.8.1-22
|
---|
52 | Requires: binutils
|
---|
53 |
|
---|
54 | %description
|
---|
55 | The gcc package contains the GNU Compiler Collection version %{ver_major}.%{ver_minor}.
|
---|
56 | You'll need this package in order to compile C code.
|
---|
57 |
|
---|
58 | %package -n libgcc-fwd
|
---|
59 | Summary: GCC version shared support forwarder library
|
---|
60 | Group: System Environment/Libraries
|
---|
61 | Autoreq: false
|
---|
62 | Obsoletes: libgcc335 libgcc432 libgcc433 libgcc434 libgcc440 libgcc441
|
---|
63 | Obsoletes: libgcc442 libgcc444 libgcc445 libgcc446 libgcc452 libgcc453
|
---|
64 | Obsoletes: libgcc473 libgcc490 libgcc492
|
---|
65 |
|
---|
66 | %description -n libgcc-fwd
|
---|
67 | This package contains GCC shared support forwarder library which is needed
|
---|
68 | e.g. for exception handling support.
|
---|
69 |
|
---|
70 | %package -n libgcc1
|
---|
71 | Summary: GCC version 1 shared support library
|
---|
72 | Group: System Environment/Libraries
|
---|
73 | Autoreq: false
|
---|
74 |
|
---|
75 | %description -n libgcc1
|
---|
76 | This package contains GCC shared support library which is needed
|
---|
77 | e.g. for exception handling support.
|
---|
78 |
|
---|
79 | %package -n libssp
|
---|
80 | Summary: GCC stack protector shared library
|
---|
81 | Group: System Environment/Libraries
|
---|
82 | Obsoletes: gcc-stack-protector
|
---|
83 |
|
---|
84 | %description -n libssp
|
---|
85 | This package contains GCC shared library which is needed
|
---|
86 | for stack protector.
|
---|
87 |
|
---|
88 | %package -n libstdc++6
|
---|
89 | Summary: GNU Standard C++ Library v3
|
---|
90 | Group: System Environment/Libraries
|
---|
91 |
|
---|
92 | %description -n libstdc++6
|
---|
93 | This package contains GNU Standard C++ Library v3 shared library.
|
---|
94 |
|
---|
95 | %package -n libsupc++6
|
---|
96 | Summary: GNU Standard C++ Library v3 subset
|
---|
97 | Group: System Environment/Libraries
|
---|
98 |
|
---|
99 | %description -n libsupc++6
|
---|
100 | This package contains GNU Standard C++ Library v3 subset shared library.
|
---|
101 |
|
---|
102 | %package wlink
|
---|
103 | Summary: GCC configuration changes for Watcom linker support.
|
---|
104 | Group: Development/Languages
|
---|
105 | Requires: watcom-wlink-hll
|
---|
106 |
|
---|
107 | %description wlink
|
---|
108 | This package triggers the required config.sys settings to allow use of Watcom
|
---|
109 | Linker instead of ld.
|
---|
110 |
|
---|
111 | %package wrc
|
---|
112 | Summary: GCC configuration changes for Watcom resource compiler support.
|
---|
113 | Group: Development/Languages
|
---|
114 | Requires: watcom-wrc
|
---|
115 |
|
---|
116 | %description wrc
|
---|
117 | This package triggers the required config.sys settings to allow use of Watcom
|
---|
118 | resource compiler instead of IBM one.
|
---|
119 |
|
---|
120 | %package debug
|
---|
121 | Summary: HLL debug data for exception handling support.
|
---|
122 |
|
---|
123 | %description debug
|
---|
124 | HLL debug data for exception handling support.
|
---|
125 |
|
---|
126 |
|
---|
127 | %prep
|
---|
128 | %setup -q -c -a 1
|
---|
129 |
|
---|
130 |
|
---|
131 | %build
|
---|
132 | rm -fr obj-%{gcc_target_platform}
|
---|
133 | mkdir obj-%{gcc_target_platform}
|
---|
134 | cd obj-%{gcc_target_platform}
|
---|
135 |
|
---|
136 | script_dir=%{_topdir}/BUILD/%{name}-%{version}/obj-%{gcc_target_platform}
|
---|
137 | export PATH="$script_dir/gcc${PATH:+;$PATH}"
|
---|
138 | export BEGINLIBPATH="$script_dir/gcc${BEGINLIBPATH:+;$BEGINLIBPATH}"
|
---|
139 | export LIBPATHSTRICT=T
|
---|
140 |
|
---|
141 | export CFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
|
---|
142 | export CXXFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
|
---|
143 | export LDFLAGS="-g -Zexe -Zomf -Zmap -Zargs-wild -Zhigh-mem"
|
---|
144 | export LANG=en_US
|
---|
145 | export GREP=grep
|
---|
146 |
|
---|
147 | export PATH_SEPARATOR=;
|
---|
148 | export CONFIG_SITE=/@unixroot/usr/share/config.legacy
|
---|
149 |
|
---|
150 | ../configure --prefix=%{_prefix} \
|
---|
151 | --with-sysroot=/@unixroot \
|
---|
152 | --enable-shared \
|
---|
153 | --enable-languages=c,c++ \
|
---|
154 | --enable-frame-pointer \
|
---|
155 | --with-gnu-as \
|
---|
156 | --disable-bootstrap \
|
---|
157 | --disable-multilib \
|
---|
158 | --disable-libstdcxx-pch \
|
---|
159 | --enable-threads
|
---|
160 |
|
---|
161 | make %{?_smp_mflags}
|
---|
162 |
|
---|
163 |
|
---|
164 | %install
|
---|
165 | rm -rf $RPM_BUILD_ROOT
|
---|
166 | cd obj-%{gcc_target_platform}
|
---|
167 |
|
---|
168 | # There are some MP bugs in libstdc++ Makefiles
|
---|
169 | #make -C %{gcc_target_platform}/libstdc++-v3
|
---|
170 |
|
---|
171 | #make prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir} \
|
---|
172 | # infodir=%{buildroot}%{_infodir} install
|
---|
173 |
|
---|
174 | make DESTDIR=${RPM_BUILD_ROOT} install
|
---|
175 |
|
---|
176 | # copy runtime files
|
---|
177 | emxomf -o i386-pc-os2-emx/libgcc/libgcc_so_d.lib i386-pc-os2-emx/libgcc/libgcc_so_d.a
|
---|
178 | #cp -p i386-pc-os2-emx/libgcc/libgcc_so_d.a %{buildroot}%{_libdir}
|
---|
179 | #cp -p i386-pc-os2-emx/libgcc/libgcc_so_d.lib %{buildroot}%{_libdir}
|
---|
180 | #cp -p i386-pc-os2-emx/libgcc/gcc%{ver_major}%{ver_minor}%{ver_patch}.dll %{buildroot}%{_libdir}
|
---|
181 |
|
---|
182 | #build dll
|
---|
183 | dllar -o stdcpp6.dll i386-pc-os2-emx/libstdc++-v3/src/.libs/libstdc++.a \
|
---|
184 | -d "GNU stdc++ %{version}-%{release}" \
|
---|
185 | -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g -L%{buildroot}%{_libdir}" \
|
---|
186 | -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
|
---|
187 | -libf "INITINSTANCE TERMINSTANCE" \
|
---|
188 | -libd "DATA MULTIPLE"
|
---|
189 | cp -p stdcpp6.dll %{buildroot}%{_libdir}
|
---|
190 | cp -p stdcpp6.a %{buildroot}%{_libdir}/stdc++.a
|
---|
191 | cp -p stdcpp6.lib %{buildroot}%{_libdir}/stdc++.lib
|
---|
192 | mv %{buildroot}%{_libdir}/libstdc++.a %{buildroot}%{_libdir}/stdc++_s.a
|
---|
193 |
|
---|
194 | #build dll
|
---|
195 | dllar -o supcpp6.dll i386-pc-os2-emx/libstdc++-v3/libsupc++/.libs/libsupc++.a \
|
---|
196 | -d "GNU supc++ %{version}-%{release}" \
|
---|
197 | -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g -L%{buildroot}%{_libdir}" \
|
---|
198 | -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
|
---|
199 | -libf "INITINSTANCE TERMINSTANCE" \
|
---|
200 | -libd "DATA MULTIPLE"
|
---|
201 | cp -p supcpp6.dll %{buildroot}%{_libdir}
|
---|
202 | cp -p supcpp6.a %{buildroot}%{_libdir}/supc++.a
|
---|
203 | cp -p supcpp6.lib %{buildroot}%{_libdir}/supc++.lib
|
---|
204 | mv %{buildroot}%{_libdir}/libsupc++.a %{buildroot}%{_libdir}/supc++_s.a
|
---|
205 |
|
---|
206 | #build dll
|
---|
207 | dllar -o ssp.dll i386-pc-os2-emx/libssp/.libs/ssp.a \
|
---|
208 | -d "GNU Stack Protector %{version}-%{release}" \
|
---|
209 | -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g -L%{buildroot}%{_libdir}" \
|
---|
210 | -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
|
---|
211 | -libf "INITINSTANCE TERMINSTANCE" \
|
---|
212 | -libd "DATA MULTIPLE"
|
---|
213 | cp -p ssp.dll %{buildroot}%{_libdir}
|
---|
214 | cp -p ssp.a %{buildroot}%{_libdir}
|
---|
215 | cp -p ssp.lib %{buildroot}%{_libdir}
|
---|
216 | mv %{buildroot}%{_libdir}/ssp.a %{buildroot}%{_libdir}/ssp_s.a
|
---|
217 |
|
---|
218 | cd ..
|
---|
219 |
|
---|
220 | #build gccXXX forwarders
|
---|
221 | for bld in 335 432 433 434 435 440 441 442 444 445 446 452 453 454 464 473 474 482 483 490 491 492; do
|
---|
222 | sed -i 's/Forwarder/Forwarder %{version}-%{release}/' gcc${bld}.def
|
---|
223 | gcc -Zomf -Zmap -Zdll -nostdlib -o gcc${bld}.dll gcc${bld}.def fwdstub.s obj-%{gcc_target_platform}/gcc/libgcc_so_d.a -llibc
|
---|
224 | cp -p gcc${bld}.dll %{buildroot}%{_libdir}
|
---|
225 | done
|
---|
226 |
|
---|
227 | echo dummy for virtual package > gcc-wrc.txt
|
---|
228 | echo dummy for virtual package > gcc-wlink.txt
|
---|
229 |
|
---|
230 | #mkdir -p %{buildroot}%{_usr}
|
---|
231 |
|
---|
232 | rm %{buildroot}%{_libdir}/*.la
|
---|
233 | rm %{buildroot}%{_libdir}/*.py
|
---|
234 |
|
---|
235 | ln -s ./cc1.exe %{buildroot}%{_libexecdir}/gcc/i386-pc-os2-emx/%{gcc_version}/cc1
|
---|
236 | ln -s ./cc1plus.exe %{buildroot}%{_libexecdir}/gcc/i386-pc-os2-emx/%{gcc_version}/cc1plus
|
---|
237 |
|
---|
238 | #yd fix attributes for executables
|
---|
239 | chmod 0755 %{buildroot}%{_bindir}/*.exe
|
---|
240 |
|
---|
241 | %clean
|
---|
242 | rm -rf %{buildroot}
|
---|
243 |
|
---|
244 | %post wrc
|
---|
245 | if [ "$1" = 1 ] ; then
|
---|
246 | #execute only on first install
|
---|
247 | %cube {DELLINE "SET EMXOMFLD_RC="} c:\config.sys > NUL
|
---|
248 | %cube {DELLINE "SET EMXOMFLD_RC_TYPE="} c:\config.sys > NUL
|
---|
249 | %cube {ADDLINE "SET EMXOMFLD_RC=wrc.exe"} c:\config.sys > NUL
|
---|
250 | %cube {ADDLINE "SET EMXOMFLD_RC_TYPE=WRC"} c:\config.sys > NUL
|
---|
251 | fi
|
---|
252 |
|
---|
253 | %postun wrc
|
---|
254 | if [ "$1" = 0 ] ; then
|
---|
255 | #execute only on last uninstall
|
---|
256 | %cube {DELLINE "SET EMXOMFLD_RC="} c:\config.sys > NUL
|
---|
257 | %cube {DELLINE "SET EMXOMFLD_RC_TYPE="} c:\config.sys > NUL
|
---|
258 | fi
|
---|
259 |
|
---|
260 | %post wlink
|
---|
261 | if [ "$1" = 1 ] ; then
|
---|
262 | #execute only on first install
|
---|
263 | %cube {DELLINE "SET EMXOMFLD_LINKER="} c:\config.sys > NUL
|
---|
264 | %cube {DELLINE "SET EMXOMFLD_TYPE="} c:\config.sys > NUL
|
---|
265 | %cube {ADDLINE "SET EMXOMFLD_LINKER=wl.exe"} c:\config.sys > NUL
|
---|
266 | %cube {ADDLINE "SET EMXOMFLD_TYPE=WLINK"} c:\config.sys > NUL
|
---|
267 | fi
|
---|
268 |
|
---|
269 | %postun wlink
|
---|
270 | if [ "$1" = 0 ] ; then
|
---|
271 | #execute only on last uninstall
|
---|
272 | %cube {DELLINE "SET EMXOMFLD_LINKER="} c:\config.sys > NUL
|
---|
273 | %cube {DELLINE "SET EMXOMFLD_TYPE="} c:\config.sys > NUL
|
---|
274 | fi
|
---|
275 |
|
---|
276 | %files
|
---|
277 | %defattr(-,root,root,-)
|
---|
278 | %{_usr}/bin
|
---|
279 | %exclude %{_bindir}/*.dbg
|
---|
280 | %{_usr}/include
|
---|
281 | %{_libdir}/*.*a
|
---|
282 | %{_libdir}/*.lib
|
---|
283 | %exclude %{_libdir}/*.dll
|
---|
284 | %exclude %{_libdir}/*.dbg
|
---|
285 | %{_libdir}/gcc/*
|
---|
286 | %{_libexecdir}
|
---|
287 | %exclude %{_libexecdir}/gcc/i386-pc-os2-emx/%{gcc_version}/*.dbg
|
---|
288 | %exclude %{_libexecdir}/gcc/i386-pc-os2-emx/%{gcc_version}/install-tools/*.dbg
|
---|
289 | %{_datadir}/gcc-%{gcc_version}
|
---|
290 | %{_datadir}/locale
|
---|
291 | %{_datadir}/info
|
---|
292 | %{_datadir}/man
|
---|
293 | %doc ChangeLog ChangeLog.*
|
---|
294 | %doc README README.*
|
---|
295 | %doc COPYING COPYING.*
|
---|
296 | %doc MAINTAINERS
|
---|
297 |
|
---|
298 | %files -n libssp
|
---|
299 | %defattr(-,root,root,-)
|
---|
300 | %{_libdir}/ssp.dll
|
---|
301 |
|
---|
302 | %files -n libstdc++6
|
---|
303 | %defattr(-,root,root,-)
|
---|
304 | %{_libdir}/stdcp*.dll
|
---|
305 |
|
---|
306 | %files -n libsupc++6
|
---|
307 | %defattr(-,root,root,-)
|
---|
308 | %{_libdir}/supcp*.dll
|
---|
309 |
|
---|
310 | %files wlink
|
---|
311 | %doc gcc-wlink.txt
|
---|
312 |
|
---|
313 | %files wrc
|
---|
314 | %doc gcc-wrc.txt
|
---|
315 |
|
---|
316 | %files -n libgcc-fwd
|
---|
317 | %defattr(-,root,root,-)
|
---|
318 | %{_libdir}/gcc???.dll
|
---|
319 |
|
---|
320 | %files -n libgcc1
|
---|
321 | %defattr(-,root,root,-)
|
---|
322 | %{_libdir}/gcc1.dll
|
---|
323 |
|
---|
324 | %files debug
|
---|
325 | %defattr(-,root,root)
|
---|
326 | %{_bindir}/*.dbg
|
---|
327 | %{_libdir}/*.dbg
|
---|
328 | %{_libexecdir}/gcc/i386-pc-os2-emx/%{gcc_version}/*.dbg
|
---|
329 | %{_libexecdir}/gcc/i386-pc-os2-emx/%{gcc_version}/install-tools/*.dbg
|
---|
330 |
|
---|
331 | %changelog
|
---|
332 | * Tue Jan 30 2015 yd <yd@os2power.com> 4.9.2.1-3
|
---|
333 | - updated source code to gcc 4.9.2.
|
---|
334 | - create gccXXX forwarders to gcc1 runtime dll, use libc06 exports for
|
---|
335 | non-standard symbols.
|
---|
336 | - use --enable-frame-pointer to disable unwinding table generation.
|
---|
337 | - build requires patched builtin.h and stddef.h (libc-0.6.6-25).
|
---|
338 | - use standard toolchain to build gcc runtime dll, use named exports only.
|
---|
339 |
|
---|
340 | * Wed Nov 27 2013 yd
|
---|
341 | - Rename the following packages to avoid ABI breaks (using gcc versioning policy):
|
---|
342 | + libstdc++ => libstdc++6
|
---|
343 | + libsupc++ => libsupc++6
|
---|
344 | - updated source code to gcc 4.7.3.
|
---|
345 |
|
---|
346 | * Mon Jul 25 2013 Dmitriy Kuminov <coding@dmik.org> - 4.4.6.17-1
|
---|
347 | - New OS/2 Release 17 of 4.4.6. See ChangeLog.OS2 for more information.
|
---|
348 |
|
---|
349 | * Mon Jul 23 2013 Dmitriy Kuminov <coding@dmik.org> - 4.4.6.16-1
|
---|
350 | - New OS/2 Release 16 of 4.4.6. See ChangeLog.OS2 for more information.
|
---|
351 | - Rename the following packages to better match the conventions:
|
---|
352 | + gcc-stack-protector => libssp
|
---|
353 | + gcc-stdc++-shared-library => libstdc++
|
---|
354 | + gcc-supc++-shared-library => libsupc++
|
---|
355 |
|
---|
356 | * Mon Jan 09 2012 yd
|
---|
357 | - install also dlls with main package.
|
---|
358 |
|
---|
359 | * Sun Jan 08 2012 yd
|
---|
360 | - moved dlls out from main package.
|
---|
361 |
|
---|
362 | * Fri Dec 23 2011 yd
|
---|
363 | - fixed spawn internal error report.
|
---|
364 | - fixed handling of big command lines (fixes OOo building).
|
---|
365 | - fixed Optlink calls.
|
---|
366 |
|
---|
367 | * Fri Dec 9 2011 yd
|
---|
368 | - updated source code to 4.4.6, github tree
|
---|