source: rtems/scripts/README @ afe5cac

4.104.114.84.95
Last change on this file since afe5cac was 49d0704, checked in by Joel Sherrill <joel.sherrill@…>, on 01/24/02 at 14:18:41

2001-01-24 Joel Sherrill <joel@…>

  • README: Added Canadian Cross instructions.
  • Property mode set to 100644
File size: 7.7 KB
Line 
1
2        RPM support for BSPs
3        ====================
4
5Introduction
6------------
7
8Building an rpm requires to have a tar archive of the sources, and a
9rpm-spec files specifying the details of building.
10
11To support per bsp rpms, one rpm-spec is used per BSP.
12Instead of writing one rpm-spec for each BSP, I have written a shell script
13(mkspec) which generates one *.spec (rtems-<target_alias>-<bsp>.spec) per BSP
14bsp from an rpm-spec template (rtems.spec.in).
15
16A second shell script (mkrpms) is a convienience script which invokes a
17sequence of building rpms for several bsps.
18
19
20mkbinutilspec
21-------------
22
23mkbinutilspec takes two arguments:
24
25$1 ... the target_alias for binutils RPMs of this toolset
26
27Invoking mkbinutilspec will generate a <target_alias>-binutils.spec either in
28
29    /usr/src/packages/SPECS (SuSE convention) or
30    /usr/src/redhat/SPECS (Redhat convention) or
31    /usr/src/SPECS
32
33Eg. ./mkbinutilspec sparc-rtems generates
34
35On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-binutils.spec
36On RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-binutils.spec
37
38mkgccnewlibspec
39---------------
40
41mkgccnewlibspec takes two arguments:
42
43$1 ... the target_alias for the gcc/newlib RPMs of this toolset
44
45Invoking mkgccnewlibspec will generate a <target_alias>-gccnewlibs.spec
46either in:
47
48    /usr/src/packages/SPECS (SuSE convention) or
49    /usr/src/redhat/SPECS (Redhat convention) or
50    /usr/src/SPECS
51
52Eg. ./mkgccnewlibspec sparc-rtems generates
53
54On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
55On RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-gcc_newlib.spec
56
57mkgdbspec
58---------
59
60mkgdbspec takes two arguments:
61
62$1 ... the target_alias for the gdb RPMs of this toolset
63
64Invoking mkgdbspec will generate a <target_alias>-gdb.spec
65either in:
66
67    /usr/src/packages/SPECS (SuSE convention) or
68    /usr/src/redhat/SPECS (Redhat convention) or
69    /usr/src/SPECS
70
71Eg. ./mkgdbspec sparc-rtems generates
72
73On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
74On RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-gcc_newlib.spec
75
76
77# XXX BSPs not tested yet by Joel
78#
79#  mkbspspec
80#  ---------
81
82#  mkbspspec takes two arguments:
83#  $1 ... the target_alias this bsp belongs to
84#  $2 ... the bsp to be built
85
86#  Invoking mkbspspec will generate a rtems-<target_alias>-<bsp>.spec either in
87#  /usr/src/packages/SPECS (SuSE convention) or
88#  /usr/src/redhat/SPECS (Redhat convention) or
89#  /usr/src/SPECS
90
91#  Eg. ./mkspec gensh1 sh-rtemself generates
92#  /usr/src/packages/SPECS/rtems-sh-rtemself-gensh1.spec on SuSE-6.2.
93
94mkspec
95---------
96
97mkspec takes two arguments:
98
99$1 ... the target_alias for the RPMs composing this toolset
100$2 ... the bsp to be built
101
102Invoking mkspec will generate a set of spec files either in:
103
104    /usr/src/packages/SPECS (SuSE convention) or
105    /usr/src/redhat/SPECS (Redhat convention) or
106    /usr/src/SPECS
107
108Eg. ./mkspec sparc-rtems erc32 generates
109
110On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-binutils.spec
111               /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
112               /usr/src/packages/SPECS/sparc-rtems-gdb.spec
113On RedHat 6.0: /usr/src/packages/SPECS/sparc-rtems-binutils.spec
114               /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
115               /usr/src/packages/SPECS/sparc-rtems-gdb.spec
116
117
118Building binutils-rpms
119----------------------
120
1210. Login as root.
122
1231. Install a tarball of the various tool sources (with the
124version number attached!) to /usr/src/[packages|redhat]/SOURCES
125
126  cd /usr/src/[packages|redhat]/SOURCES
127  cp .../binutils-<VERSION>  .
128  cp .../binutils-<VERSION>-rtems-<DATE>.diff  .
129
1302. Generate and install the required rpm-spec file[s]
131
132cd rtems-<VERSION>/scripts/
133mkbinutilspec <target_alias>
134
135where target_alias is of the form sparc-rtems or sh-rtems-elf.
136
1373. Build the rpms
138
139Building a binary rpm:
140
141rpm -bb /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>-binutils.spec
142
143Building a source and binary rpm
144rpm -ba /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>-binutils.spec
145
146XXX Note: a BSP's src.rpm contains its spec-file and the tar-archive of the
147sources (approx. 4-5MB per BSP).
148
149Building TOOL-rpms
150------------------
151
1520. Login as root.
153
1541. Install a tarball of the various tool sources (with the
155version number attached!) to /usr/src/[packages|redhat]/SOURCES
156
157  cd /usr/src/[packages|redhat]/SOURCES
158  cp .../binutils-<VERSION>  .
159  cp .../gcc-<VERSION>       .
160  cp .../newlib-<VERSION>    .
161
1622. Generate and install the required rpm-spec file[s]
163
164cd rtems-<VERSION>/scripts/
165mktoolspec <target_alias>
166
1673. Build the rpms
168
169Building a binary rpm:
170rpm -bb /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>.spec
171
172Building a source and binary rpm
173rpm -ba /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>.spec
174
175XXX Note: a BSP's src.rpm contains its spec-file and the tar-archive of the
176sources (approx. 4-5MB per BSP).
177
178Building BSP-rpms
179-----------------
180
1810. Login as root.
182
1831. Install a tarball of RTEMS's sources (with version number attached!) to
184/usr/src/[packages|redhat]/SOURCES
185Eg.
186tar czvf /usr/src/packages/SOURCES/rtems-<VERSION>.tar.gz rtems-<VERSION>
187
1882. Generate and install the required rpm-spec file[s]
189cd rtems-<VERSION>/scripts/
190mkspec <bsp> <target_alias>
191
1923. Build the rpms
193Building a binary rpm:
194rpm -bb /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>-<bsp>.spec
195
196Building a source and binary rpm
197rpm -ba /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>-<bsp>.spec
198
199Note: a BSP's src.rpm contains its spec-file and the tar-archive of the
200sources (approx. 4-5MB per BSP).
201
202Canadian Cross RPMS
203-------------------
204Normally one uses a GNU/Linux host computer to produce RPMs that are
205to be installed and run on another GNU/Linux host computer.  When
206building Canadian Cross RPMs, we build *-rtems tools that are to be
207installed on a non-GNU/Linux host. 
208
209To build cygwin-rpms on a GNU/Linux host, you will to have a GNU/Linux ->
210i386-cygwin cross-toolset installed and in your PATH before executing the
211following commands:
212
213  cd scripts
214  ./configure --build=`../config.guess` --host=i386-cygwin \
215    --target=<target>
216  make
217  rpm --target=<i386-cygwin> -b[b|a] binutils/<target>-....spec
218
219Known Bugs/Deficiencies
220-----------------------
221
222* All files mentioned in here are in its early infancy ;-)
223
224* Building for a single bsp requires an own copy of the source tree inside
225rpm's build directory.
226* Building inside the RTEMS source tree doesn't work.
227* Dependencies on toolchain-rpms not yet supported in rtems.spec.in.
228* Installing multiple binary bsp rpms for the same target can cause
229warnings from rpm, because these bsp-rpms share files.
230* rtems.spec.in is prepared for rpm relocation support, but RTEMS is not
231relocatible (yet?)
232* rtems.spec.in deserves to be extended (description, authors etc)
233* The final packaging stage to build a binary rpm takes an awful lot of
234time - deserves to be investigated.
235* Some RTEMS's cross executables (eg. hello.exe for sparc-rtems/erc32) cause
236warnings from rpm and/or objdump. AFAIS, this is a bug in rpm.
237* Probably many more ...
238
239* Last but not least: RTEMS should be split.
240
241Remarks
242-------
243* It would make sense to split RTEMS host/cross-tools and files depending on
244the target only (<target_alias>/make/*.cfg -- Whow, RTEMS really has files
245which depend on the target only :) into separate rpms.
246* Instead of using a single rpm-spec for each bsp, RTEMS could also use a
247single rpm-spec for all (or at least a given subset of all) bsps of a target.
248* rpm -b[b|a] leaves its built trees unpacked in
249/usr/src/[packages|redhat]/BUILD. Therefore you will rather soon run out of disc
250space if not removing them. (Use rpm --clean -b[a|b] for cleaning them up
251automatically after building)
252* The size of binary rpms can differ up to one magnitude depending on the
253target/bsp (eg. sh-rtems/gensh1 ~10MB vs. sh-rtemself/gensh1 ~32MB)
254
255Ralf Corsepius, 1999/10/14
Note: See TracBrowser for help on using the repository browser.