1 | # |
---|
2 | # spec file for building gcc for rtems |
---|
3 | # |
---|
4 | # Copyright (c) 1999 OARCorp, Huntsville, AL |
---|
5 | # |
---|
6 | # please send bugfixes or comments to joel@OARcorp.com |
---|
7 | # |
---|
8 | |
---|
9 | Vendor: OAR Corporation |
---|
10 | Distribution: Linux |
---|
11 | Name: @target_alias@-gcc-newlib |
---|
12 | Summary: gcc and newlib C Library for @target_alias@. |
---|
13 | Group: rtems |
---|
14 | Release: @Release@ |
---|
15 | Copyright: 1999 OARCorp |
---|
16 | |
---|
17 | Provides: rtems-base-gcc @target_alias@-gcc @target_alias@-chill |
---|
18 | Provides: @target_alias@-gcj @target_alias@-g77 @target_alias@-objc |
---|
19 | Requires: @target_alias@-binutils |
---|
20 | |
---|
21 | Autoreqprov: on |
---|
22 | Packager: corsepiu@faw.uni-ulm.de and joel@OARcorp.com |
---|
23 | |
---|
24 | Version: gcc@gcc_version@newlib@newlib_version@ |
---|
25 | Source0: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-@gcc_version@.tar.gz |
---|
26 | Source1: ftp://sourceware.cygnus/com/pub/newlib/newlib-@newlib_version@.tar.gz |
---|
27 | Patch0: gcc-@gcc_version@-rtems-@gcc_patch_version@.diff |
---|
28 | Patch1: newlib-@newlib_version@-rtems-@newlib_patch_version@.diff |
---|
29 | Buildroot: /tmp |
---|
30 | |
---|
31 | # |
---|
32 | # The original sources are not included in the source RPM. |
---|
33 | # If we included them, then the source RPMs for each target |
---|
34 | # would duplicate MBs of source unnecessarily. This is |
---|
35 | # a duplication of over 30 MBs of source for each of |
---|
36 | # the more than 10 targets it is possible to build. |
---|
37 | # |
---|
38 | # You can get them yourself from the Internet and copy them to |
---|
39 | # your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR). |
---|
40 | # Or you can try the ftp options of rpm :-) |
---|
41 | # |
---|
42 | NoSource: 0, 1 |
---|
43 | |
---|
44 | %description |
---|
45 | RTEMS is an open source operating system for embedded systems. |
---|
46 | |
---|
47 | This is gcc's and newlib C Library's sources with patches for RTEMS. |
---|
48 | |
---|
49 | The original sources are not included in the source RPM. |
---|
50 | If we included them, then the source RPMs for each target |
---|
51 | would duplicate MBs of source unnecessarily. This is |
---|
52 | a duplication of over 30 MBs of source for each of |
---|
53 | the more than 10 targets it is possible to build. |
---|
54 | |
---|
55 | You can get them yourself from the Internet and copy them to |
---|
56 | your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR). |
---|
57 | Or you can try the ftp options of rpm :-) |
---|
58 | |
---|
59 | %package -n rtems-base-gcc |
---|
60 | Summary: base package for rtems gcc and newlib C Library |
---|
61 | Group: rtems |
---|
62 | |
---|
63 | %description -n rtems-base-gcc |
---|
64 | |
---|
65 | RTEMS is an open source operating system for embedded systems. |
---|
66 | |
---|
67 | This is the files for gcc and newlib that are shared by all targets. |
---|
68 | |
---|
69 | %package -n @target_alias@-gcc |
---|
70 | Summary: rtems gcc and newlib C Library for @target_alias@ |
---|
71 | Group: rtems |
---|
72 | Requires: @target_alias@-binutils rtems-base-gcc |
---|
73 | |
---|
74 | %description -n @target_alias@-gcc |
---|
75 | RTEMS is an open source operating system for embedded systems. |
---|
76 | |
---|
77 | This is gcc and newlib C Library for @target_alias@. |
---|
78 | |
---|
79 | %package -n @target_alias@-chill |
---|
80 | Summary: gcc/chill compiler for @target_alias@ |
---|
81 | Group: rtems |
---|
82 | Requires: @target_alias@-gcc |
---|
83 | |
---|
84 | %description -n @target_alias@-chill |
---|
85 | RTEMS is an open source operating system for embedded systems. |
---|
86 | |
---|
87 | This is the gcc/chill compiler and support files for @target_alias@ |
---|
88 | |
---|
89 | %package -n @target_alias@-gcj |
---|
90 | Summary: gcc/java compiler (gcj) for @target_alias@ |
---|
91 | Group: rtems |
---|
92 | Requires: @target_alias@-gcc |
---|
93 | |
---|
94 | %description -n @target_alias@-gcj |
---|
95 | RTEMS is an open source operating system for embedded systems. |
---|
96 | |
---|
97 | This is the gcc/java compiler for @target_alias@ |
---|
98 | |
---|
99 | %package -n @target_alias@-g77 |
---|
100 | Summary: gcc/g77 compiler for @target_alias@ |
---|
101 | Group: rtems |
---|
102 | Requires: @target_alias@-gcc |
---|
103 | |
---|
104 | %description -n @target_alias@-g77 |
---|
105 | RTEMS is an open source operating system for embedded systems. |
---|
106 | |
---|
107 | This is the gcc/g77 compiler for @target_alias@ |
---|
108 | |
---|
109 | %package -n @target_alias@-objc |
---|
110 | Summary: gcc/objc compiler for @target_alias@ |
---|
111 | Group: rtems |
---|
112 | Requires: @target_alias@-objc |
---|
113 | |
---|
114 | %description -n @target_alias@-objc |
---|
115 | RTEMS is an open source operating system for embedded systems. |
---|
116 | |
---|
117 | This is the gcc/objc compiler for @target_alias@ |
---|
118 | |
---|
119 | %prep |
---|
120 | # untar the sources inside @target_alias@-gcc-newlib |
---|
121 | %setup -c -n @target_alias@-gcc-newlib -a 0 -a 1 |
---|
122 | |
---|
123 | %patch0 -p0 |
---|
124 | %patch1 -p0 |
---|
125 | |
---|
126 | # Copy the C library into gcc's source tree |
---|
127 | ln -s ../newlib-@newlib_version@/newlib gcc-@gcc_version@ |
---|
128 | test -d build || mkdir build |
---|
129 | |
---|
130 | %build |
---|
131 | cd build |
---|
132 | ../gcc-@gcc_version@/configure --target=@target_alias@ \ |
---|
133 | --with-gnu-as --with-gnu-ld --with-newlib --verbose \ |
---|
134 | --prefix=/opt/rtems |
---|
135 | |
---|
136 | # for now we are building all the languages |
---|
137 | # '--enable-languages=c,c++' |
---|
138 | |
---|
139 | make all |
---|
140 | make info |
---|
141 | |
---|
142 | # Since gcc now finds the RTEMS limits.h, this should not be needed |
---|
143 | # cd gcc |
---|
144 | # rm -f stmp-multilib |
---|
145 | # find . -name "*.a" -print | xargs -e rm -f |
---|
146 | # |
---|
147 | # make all |
---|
148 | # cd .. |
---|
149 | |
---|
150 | %install |
---|
151 | cd build |
---|
152 | # Bug in gcc-2.95.1: It doesn't build this installation directory |
---|
153 | # If it doesn't find it, gcc doesn't install @target_alias@/bin/gcc |
---|
154 | ../gcc-@gcc_version@/mkinstalldirs \ |
---|
155 | $RPM_BUILD_ROOT/opt/rtems/@target_alias@/bin |
---|
156 | |
---|
157 | make prefix=$RPM_BUILD_ROOT/opt/rtems install |
---|
158 | cd @target_alias@/newlib |
---|
159 | make prefix=$RPM_BUILD_ROOT/opt/rtems install-info |
---|
160 | |
---|
161 | # cd back to build/ |
---|
162 | cd ../.. |
---|
163 | |
---|
164 | # gzip info files |
---|
165 | gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info 2>/dev/null |
---|
166 | gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-? 2>/dev/null |
---|
167 | gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-?? 2>/dev/null |
---|
168 | |
---|
169 | rm -f dirs ; |
---|
170 | echo "%dir /opt/rtems/lib" >> dirs ; |
---|
171 | echo "%dir /opt/rtems/lib/gcc-lib" >> dirs ; |
---|
172 | echo "%dir /opt/rtems/lib/gcc-lib/@target_alias@" >> dirs ; |
---|
173 | |
---|
174 | # Collect multilib subdirectories |
---|
175 | TGTDIR="$RPM_BUILD_ROOT/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@" |
---|
176 | find $TGTDIR \ |
---|
177 | \( -type d -a ! -path "$TGTDIR/include*" \) -print | \ |
---|
178 | sed -e "s,^$RPM_BUILD_ROOT,%dir ,g" >> dirs |
---|
179 | |
---|
180 | # Collect files to go into different packages |
---|
181 | cp dirs files.chill |
---|
182 | cp dirs files.gcc |
---|
183 | cp dirs files.g77 |
---|
184 | cp dirs files.objc |
---|
185 | cp dirs files.gcj |
---|
186 | |
---|
187 | f=`find $TGTDIR ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
188 | for i in $f; do |
---|
189 | case $i in |
---|
190 | *chill*) echo "$i" >> files.chill ;; |
---|
191 | *f771) ;; |
---|
192 | *cc1obj) ;; |
---|
193 | *libobjc*) echo "$i" >> files.objc ;; |
---|
194 | *include/objc*) ;; |
---|
195 | *jc1) ;; |
---|
196 | *jvgenmain) ;; |
---|
197 | *) echo "$i" >> files.gcc ;; |
---|
198 | esac |
---|
199 | done |
---|
200 | |
---|
201 | %files -n rtems-base-gcc |
---|
202 | %dir /opt/rtems/info |
---|
203 | # %doc /opt/rtems/info/dir |
---|
204 | %doc /opt/rtems/info/cpp.info* |
---|
205 | %doc /opt/rtems/info/gcc.info* |
---|
206 | %doc /opt/rtems/info/libc.info* |
---|
207 | %doc /opt/rtems/info/libm.info* |
---|
208 | |
---|
209 | %dir /opt/rtems/bin |
---|
210 | /opt/rtems/bin/cpp@exe_ext@ |
---|
211 | /opt/rtems/bin/gcov@exe_ext@ |
---|
212 | |
---|
213 | %dir /opt/rtems/man |
---|
214 | %dir /opt/rtems/man/man1 |
---|
215 | %doc /opt/rtems/man/man1/cccp.1 |
---|
216 | |
---|
217 | %dir /opt/rtems/include |
---|
218 | /opt/rtems/include/g++-3 |
---|
219 | |
---|
220 | %files -n @target_alias@-gcc -f build/files.gcc |
---|
221 | |
---|
222 | %doc /opt/rtems/man/man1/@target_alias@-gcc.1 |
---|
223 | %doc /opt/rtems/man/man1/@target_alias@-g++.1 |
---|
224 | |
---|
225 | /opt/rtems/bin/@target_alias@-c++@exe_ext@ |
---|
226 | /opt/rtems/bin/@target_alias@-g++@exe_ext@ |
---|
227 | /opt/rtems/bin/@target_alias@-gcc@exe_ext@ |
---|
228 | /opt/rtems/bin/@target_alias@-protoize@exe_ext@ |
---|
229 | /opt/rtems/bin/@target_alias@-unprotoize@exe_ext@ |
---|
230 | |
---|
231 | %dir /opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/include |
---|
232 | |
---|
233 | /opt/rtems/@target_alias@ |
---|
234 | |
---|
235 | %post -n @target_alias@-gcc |
---|
236 | if test -d $RPM_INSTALL_PREFIX/rtems/info; |
---|
237 | then |
---|
238 | rm -f $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
239 | f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'` |
---|
240 | test -n "$f" && for i in $f; do |
---|
241 | install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
242 | done |
---|
243 | fi |
---|
244 | |
---|
245 | %postun -n @target_alias@-gcc |
---|
246 | if test -d $RPM_INSTALL_PREFIX/rtems/info; |
---|
247 | then |
---|
248 | rm -f $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
249 | f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'` |
---|
250 | test -n "$f" && for i in $f; do |
---|
251 | install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
252 | done |
---|
253 | fi |
---|
254 | |
---|
255 | |
---|
256 | %files -n @target_alias@-chill -f build/files.chill |
---|
257 | %dir /opt/rtems/bin |
---|
258 | /opt/rtems/bin/@target_alias@-chill |
---|
259 | |
---|
260 | %dir /opt/rtems/info |
---|
261 | %doc /opt/rtems/info/dir |
---|
262 | %doc /opt/rtems/info/chill.info* |
---|
263 | |
---|
264 | %post -n @target_alias@-chill |
---|
265 | if test -d $RPM_INSTALL_PREFIX/rtems/info; |
---|
266 | then |
---|
267 | rm -f $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
268 | f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'` |
---|
269 | test -n "$f" && for i in $f; do |
---|
270 | install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
271 | done |
---|
272 | fi |
---|
273 | |
---|
274 | %postun -n @target_alias@-chill |
---|
275 | if test -d $RPM_INSTALL_PREFIX/rtems/info; |
---|
276 | then |
---|
277 | rm -f $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
278 | f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'` |
---|
279 | test -n "$f" && for i in $f; do |
---|
280 | install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
281 | done |
---|
282 | fi |
---|
283 | |
---|
284 | |
---|
285 | %files -n @target_alias@-gcj -f build/files.gcj |
---|
286 | %dir /opt/rtems/bin |
---|
287 | /opt/rtems/bin/jcf-dump@exe_ext@ |
---|
288 | /opt/rtems/bin/jv-scan@exe_ext@ |
---|
289 | /opt/rtems/bin/gcjh@exe_ext@ |
---|
290 | /opt/rtems/bin/@target_alias@-gcj@exe_ext@ |
---|
291 | |
---|
292 | /opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/jc1 |
---|
293 | /opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/jvgenmain |
---|
294 | |
---|
295 | |
---|
296 | %files -n @target_alias@-g77 -f build/files.g77 |
---|
297 | %dir /opt/rtems/bin |
---|
298 | /opt/rtems/bin/@target_alias@-g77@exe_ext@ |
---|
299 | |
---|
300 | %dir /opt/rtems/info |
---|
301 | %doc /opt/rtems/info/g77.info* |
---|
302 | |
---|
303 | %dir /opt/rtems/man |
---|
304 | %dir /opt/rtems/man/man1 |
---|
305 | %doc /opt/rtems/man/man1/@target_alias@-g77.1 |
---|
306 | |
---|
307 | /opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/f771@exe_ext@ |
---|
308 | |
---|
309 | %post -n @target_alias@-g77 |
---|
310 | if test -d $RPM_INSTALL_PREFIX/rtems/info; |
---|
311 | then |
---|
312 | rm -f $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
313 | f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'` |
---|
314 | test -n "$f" && for i in $f; do |
---|
315 | install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
316 | done |
---|
317 | fi |
---|
318 | |
---|
319 | %postun -n @target_alias@-g77 |
---|
320 | if test -d $RPM_INSTALL_PREFIX/rtems/info; |
---|
321 | then |
---|
322 | rm -f $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
323 | f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'` |
---|
324 | test -n "$f" && for i in $f; do |
---|
325 | install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
326 | done |
---|
327 | fi |
---|
328 | |
---|
329 | |
---|
330 | %files -n @target_alias@-objc -f build/files.objc |
---|
331 | /opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/cc1obj@exe_ext@ |
---|
332 | /opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/include/objc |
---|