1 | %global gcc_version 4.4.6
|
---|
2 | %global gcc_target_platform %{_target_cpu}
|
---|
3 |
|
---|
4 | Summary: Various compilers (C, C++, Objective-C, Java, ...)
|
---|
5 | Name: gcc
|
---|
6 | Version: %{gcc_version}
|
---|
7 | Release: 15%{?dist}
|
---|
8 |
|
---|
9 | # libgcc, libgfortran, libmudflap, libgomp, libstdc++ and crtstuff have
|
---|
10 | # GCC Runtime Exception.
|
---|
11 | License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions
|
---|
12 | Group: Development/Languages
|
---|
13 | URL: http://gcc.gnu.org
|
---|
14 |
|
---|
15 | Source0: gcc-os2-20111223.tar.bz2
|
---|
16 | Patch0: gcc-os2.diff
|
---|
17 |
|
---|
18 | BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
|
---|
19 |
|
---|
20 | Obsoletes: gcc < %{gcc_version}
|
---|
21 |
|
---|
22 | BuildRequires: binutils
|
---|
23 | BuildRequires: gmp-devel >= 4.1.2-8, mpfr-devel >= 2.2.1
|
---|
24 |
|
---|
25 | Requires: libgcc446 = %{gcc_version}
|
---|
26 | Requires: libc-devel >= 0.6.3
|
---|
27 | Requires: binutils
|
---|
28 |
|
---|
29 | %description
|
---|
30 | The gcc package contains the GNU Compiler Collection version 4.4.
|
---|
31 | You'll need this package in order to compile C code.
|
---|
32 |
|
---|
33 | %package -n libgcc446
|
---|
34 | Summary: GCC version 4.4 shared support library
|
---|
35 | Group: System Environment/Libraries
|
---|
36 | Autoreq: false
|
---|
37 |
|
---|
38 | %description -n libgcc446
|
---|
39 | This package contains GCC shared support library which is needed
|
---|
40 | e.g. for exception handling support.
|
---|
41 |
|
---|
42 | %package -n libssp
|
---|
43 | Summary: GCC stack protector shared library
|
---|
44 | Group: System Environment/Libraries
|
---|
45 |
|
---|
46 | %description -n libssp
|
---|
47 | This package contains GCC shared library which is needed
|
---|
48 | for stack protector.
|
---|
49 |
|
---|
50 | %package -n libstdc++
|
---|
51 | Summary: GNU Standard C++ Library v3
|
---|
52 | Group: System Environment/Libraries
|
---|
53 |
|
---|
54 | %description -n libstdc++
|
---|
55 | This package contains GNU Standard C++ Library v3 shared library.
|
---|
56 |
|
---|
57 | %package -n libsupc++
|
---|
58 | Summary: GNU Standard C++ Library v3 subset
|
---|
59 | Group: System Environment/Libraries
|
---|
60 |
|
---|
61 | %description -n libsupc++
|
---|
62 | This package contains GNU Standard C++ Library v3 subset shared library.
|
---|
63 |
|
---|
64 | %package wlink
|
---|
65 | Summary: GCC configuration changes for Watcom linker support.
|
---|
66 | Group: Development/Languages
|
---|
67 | Requires: watcom-wlink-hll
|
---|
68 |
|
---|
69 | %description wlink
|
---|
70 | This package triggers the required config.sys settings to allow use of Watcom
|
---|
71 | Linker instead of ld.
|
---|
72 |
|
---|
73 | %package wrc
|
---|
74 | Summary: GCC configuration changes for Watcom resource compiler support.
|
---|
75 | Group: Development/Languages
|
---|
76 | Requires: watcom-wrc
|
---|
77 |
|
---|
78 | %description wrc
|
---|
79 | This package triggers the required config.sys settings to allow use of Watcom
|
---|
80 | resource compiler instead of IBM one.
|
---|
81 |
|
---|
82 | %prep
|
---|
83 | %setup -q -c
|
---|
84 | %patch0 -p1 -b .os2~
|
---|
85 |
|
---|
86 | %build
|
---|
87 | rm -fr obj-%{gcc_target_platform}
|
---|
88 | mkdir obj-%{gcc_target_platform}
|
---|
89 | cd obj-%{gcc_target_platform}
|
---|
90 |
|
---|
91 | script_dir=%{_topdir}/BUILD/%{name}-%{version}/obj-%{gcc_target_platform}
|
---|
92 | export PATH="$script_dir/gcc${PATH:+;$PATH}"
|
---|
93 | export BEGINLIBPATH="$script_dir/gcc${BEGINLIBPATH:+;$BEGINLIBPATH}"
|
---|
94 |
|
---|
95 | export CONFIG_SHELL=/@unixroot/usr/bin/sh.exe;
|
---|
96 | export AWK=awk;
|
---|
97 | export CFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
|
---|
98 | export CXXFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
|
---|
99 | export LDFLAGS="-g -Zexe -Zomf -Zmap -Zargs-wild -Zhigh-mem"
|
---|
100 | export LANG="";
|
---|
101 | ../configure --prefix=%{_prefix} \
|
---|
102 | --with-sysroot=/@unixroot \
|
---|
103 | --enable-shared \
|
---|
104 | --enable-languages=c,c++ \
|
---|
105 | --with-gnu-as \
|
---|
106 | --disable-bootstrap \
|
---|
107 | --disable-multilib \
|
---|
108 | --disable-libstdcxx-pch \
|
---|
109 | --enable-threads \
|
---|
110 | "--cache-file=%{_topdir}/cache/%{name}-%{_target_cpu}.cache"
|
---|
111 |
|
---|
112 | make %{?_smp_mflags}
|
---|
113 |
|
---|
114 | %install
|
---|
115 | rm -rf $RPM_BUILD_ROOT
|
---|
116 |
|
---|
117 | cd obj-%{gcc_target_platform}
|
---|
118 |
|
---|
119 | # There are some MP bugs in libstdc++ Makefiles
|
---|
120 | #make -C %{gcc_target_platform}/libstdc++-v3
|
---|
121 |
|
---|
122 | #make prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir} \
|
---|
123 | # infodir=%{buildroot}%{_infodir} install
|
---|
124 |
|
---|
125 | make DESTDIR=${RPM_BUILD_ROOT} install
|
---|
126 |
|
---|
127 | #build dll
|
---|
128 | dllar -o stdcpp.dll i386-pc-os2-emx/libstdc++-v3/src/.libs/stdc++.a \
|
---|
129 | -d "GNU stdc++ %{gcc_version}" \
|
---|
130 | -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g" \
|
---|
131 | -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
|
---|
132 | -libf "INITINSTANCE TERMINSTANCE" \
|
---|
133 | -libd "DATA MULTIPLE"
|
---|
134 | cp -p stdcpp.dll %{buildroot}%{_libdir}
|
---|
135 | cp -p stdcpp.a %{buildroot}%{_libdir}/stdc++.a
|
---|
136 | cp -p stdcpp.lib %{buildroot}%{_libdir}/stdc++.lib
|
---|
137 | mv %{buildroot}%{_libdir}/stdc++.a %{buildroot}%{_libdir}/stdc++_s.a
|
---|
138 |
|
---|
139 | #build dll
|
---|
140 | dllar -o supcpp.dll i386-pc-os2-emx/libstdc++-v3/libsupc++/.libs/supc++.a \
|
---|
141 | -d "GNU supc++ %{gcc_version}" \
|
---|
142 | -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g" \
|
---|
143 | -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
|
---|
144 | -libf "INITINSTANCE TERMINSTANCE" \
|
---|
145 | -libd "DATA MULTIPLE"
|
---|
146 | cp -p supcpp.dll %{buildroot}%{_libdir}
|
---|
147 | cp -p supcpp.a %{buildroot}%{_libdir}/supc++.a
|
---|
148 | cp -p supcpp.lib %{buildroot}%{_libdir}/supc++.lib
|
---|
149 | mv %{buildroot}%{_libdir}/supc++.a %{buildroot}%{_libdir}/supc++_s.a
|
---|
150 |
|
---|
151 | #build dll
|
---|
152 | dllar -o ssp.dll i386-pc-os2-emx/libssp/.libs/ssp.a \
|
---|
153 | -d "GNU Stack Protector %{gcc_version}" \
|
---|
154 | -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g" \
|
---|
155 | -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
|
---|
156 | -libf "INITINSTANCE TERMINSTANCE" \
|
---|
157 | -libd "DATA MULTIPLE"
|
---|
158 | cp -p ssp.dll %{buildroot}%{_libdir}
|
---|
159 | cp -p ssp.a %{buildroot}%{_libdir}
|
---|
160 | cp -p ssp.lib %{buildroot}%{_libdir}
|
---|
161 | mv %{buildroot}%{_libdir}/ssp.a %{buildroot}%{_libdir}/ssp_s.a
|
---|
162 |
|
---|
163 | cd ..
|
---|
164 |
|
---|
165 | echo dummy for virtual package > gcc-wrc.txt
|
---|
166 | echo dummy for virtual package > gcc-wlink.txt
|
---|
167 |
|
---|
168 | #mkdir -p %{buildroot}%{_usr}
|
---|
169 |
|
---|
170 | rm %{buildroot}%{_libdir}/*.la
|
---|
171 |
|
---|
172 | #mv %{buildroot}%{_usr}/readme.os2 $RPM_BUILD_ROOT%_docdir/%{name}-%{version}/
|
---|
173 |
|
---|
174 | ln -s ./cc1.exe %{buildroot}%{_libexecdir}/gcc/i386-pc-os2-emx/%{version}/cc1
|
---|
175 | ln -s ./cc1plus.exe %{buildroot}%{_libexecdir}/gcc/i386-pc-os2-emx/%{version}/cc1plus
|
---|
176 |
|
---|
177 | #yd fix attributes for executables
|
---|
178 | chmod 0755 %{buildroot}%{_bindir}/*.exe
|
---|
179 |
|
---|
180 | %clean
|
---|
181 | rm -rf %{buildroot}
|
---|
182 |
|
---|
183 | %post wrc
|
---|
184 | if [ "$1" = 1 ] ; then
|
---|
185 | #execute only on first install
|
---|
186 | %cube {DELLINE "SET EMXOMFLD_RC="} c:\config.sys > NUL
|
---|
187 | %cube {DELLINE "SET EMXOMFLD_RC_TYPE="} c:\config.sys > NUL
|
---|
188 | %cube {ADDLINE "SET EMXOMFLD_RC=wrc.exe"} c:\config.sys > NUL
|
---|
189 | %cube {ADDLINE "SET EMXOMFLD_RC_TYPE=WRC"} c:\config.sys > NUL
|
---|
190 | fi
|
---|
191 |
|
---|
192 | %postun wrc
|
---|
193 | if [ "$1" = 0 ] ; then
|
---|
194 | #execute only on last uninstall
|
---|
195 | %cube {DELLINE "SET EMXOMFLD_RC="} c:\config.sys > NUL
|
---|
196 | %cube {DELLINE "SET EMXOMFLD_RC_TYPE="} c:\config.sys > NUL
|
---|
197 | fi
|
---|
198 |
|
---|
199 | %post wlink
|
---|
200 | if [ "$1" = 1 ] ; then
|
---|
201 | #execute only on first install
|
---|
202 | %cube {DELLINE "SET EMXOMFLD_LINKER="} c:\config.sys > NUL
|
---|
203 | %cube {DELLINE "SET EMXOMFLD_TYPE="} c:\config.sys > NUL
|
---|
204 | %cube {ADDLINE "SET EMXOMFLD_LINKER=wl.exe"} c:\config.sys > NUL
|
---|
205 | %cube {ADDLINE "SET EMXOMFLD_TYPE=WLINK"} c:\config.sys > NUL
|
---|
206 | fi
|
---|
207 |
|
---|
208 | %postun wlink
|
---|
209 | if [ "$1" = 0 ] ; then
|
---|
210 | #execute only on last uninstall
|
---|
211 | %cube {DELLINE "SET EMXOMFLD_LINKER="} c:\config.sys > NUL
|
---|
212 | %cube {DELLINE "SET EMXOMFLD_TYPE="} c:\config.sys > NUL
|
---|
213 | fi
|
---|
214 |
|
---|
215 | %files
|
---|
216 | %defattr(-,root,root,-)
|
---|
217 | %{_usr}/bin
|
---|
218 | %{_usr}/include
|
---|
219 | %{_usr}/info
|
---|
220 | %{_libdir}/*.*a
|
---|
221 | %{_libdir}/*.lib
|
---|
222 | %{_libdir}/*.dll
|
---|
223 | %exclude %{_libdir}/*.dll
|
---|
224 | %{_libdir}/*.spec
|
---|
225 | %{_libdir}/gcc/*
|
---|
226 | %{_usr}/libexec
|
---|
227 | %{_usr}/man
|
---|
228 | %{_usr}/share
|
---|
229 |
|
---|
230 | %files -n libssp
|
---|
231 | %defattr(-,root,root,-)
|
---|
232 | %{_libdir}/ssp.dll
|
---|
233 |
|
---|
234 | %files -n libstdc++
|
---|
235 | %defattr(-,root,root,-)
|
---|
236 | %{_libdir}/stdcpp.dll
|
---|
237 |
|
---|
238 | %files -n libsupc++
|
---|
239 | %defattr(-,root,root,-)
|
---|
240 | %{_libdir}/supcpp.dll
|
---|
241 |
|
---|
242 | %files wlink
|
---|
243 | %doc gcc-wlink.txt
|
---|
244 |
|
---|
245 | %files wrc
|
---|
246 | %doc gcc-wrc.txt
|
---|
247 |
|
---|
248 | %files -n libgcc446
|
---|
249 | %defattr(-,root,root,-)
|
---|
250 | %{_libdir}/gcc446.dll
|
---|
251 | #%doc %{_datadir}/doc/*
|
---|
252 |
|
---|
253 | %changelog
|
---|
254 | * Wed Jan 11 2012 yd
|
---|
255 | - use more conventionional names for shared libraries packages.
|
---|
256 |
|
---|
257 | * Mon Jan 09 2012 yd
|
---|
258 | - install also dlls with main package.
|
---|
259 |
|
---|
260 | * Sun Jan 08 2012 yd
|
---|
261 | - moved dlls out from main package.
|
---|
262 |
|
---|
263 | * Fri Dec 23 2011 yd
|
---|
264 | - fixed spawn internal error report.
|
---|
265 | - fixed handling of big command lines (fixes OOo building).
|
---|
266 | - fixed Optlink calls.
|
---|
267 |
|
---|
268 | * Fri Dec 9 2011 yd
|
---|
269 | - updated source code to 4.4.6, github tree
|
---|