source: rtems/doc/started/buildc.t @ 513196f

4.104.114.84.95
Last change on this file since 513196f was 513196f, checked in by Joel Sherrill <joel.sherrill@…>, on 04/14/98 at 14:21:33

Added rudimentary section on reading the documentation for each tool

  • Property mode set to 100644
File size: 10.2 KB
Line 
1@c
2@c  COPYRIGHT (c) 1988-1998.
3@c  On-Line Applications Research Corporation (OAR).
4@c  All rights reserved.
5@c
6@c  $Id$
7@c
8
9@chapter Building the GNU C/C++ Cross Compiler Toolset
10
11This chapter describes the steps required to acquire the
12source code for a GNU cross compiler toolset, apply
13any required RTEMS specific patches, compile that
14toolset and install it.
15
16@section Create the Archive and Build Directories
17
18Start by making the @code{archive} directory to contain the downloaded
19source code and the @code{tools} directory to be used as a build
20directory.  The command sequence to do this is shown
21below:
22
23@example
24mkdir arc
25mkdir tools
26@end example
27
28This will result in an initial directory structure similar to the
29one shown in the following figure:
30
31@ifset use-ascii
32@example
33@group
34                parent directory common to the
35               tools and archive subdirectories
36                             |
37      +----------------------+----------------------+
38      |                                             | 
39   tools                                           arc
40@end group
41@end example
42@end ifset
43
44
45@ifset use-tex
46@c for now use the ascii version
47@example
48@group
49                parent directory common to the
50               tools and archive subdirectories
51                             |
52      +----------------------+----------------------+
53      |                                             |
54   tools                                           arc
55@end group
56@end example
57@tex
58@end tex
59@end ifset
60
61
62@ifset use-html
63@html
64<IMG SRC="sfile12c.jpg" WIDTH=417 HEIGHT=178
65    ALT="Starting Directory Organization">
66@end html
67@end ifset
68
69@section Get all the Pieces
70
71This section lists the components of an RTEMS cross development system. 
72Included are the locations of each component as well as any required RTEMS
73specific patches.
74
75@subheading @value{GCC-VERSION}
76@example
77    FTP Site:    @value{GCC-FTPSITE}
78    Directory:   @value{GCC-FTPDIR}
79    File:        @value{GCC-TAR}
80@end example
81
82@subheading @value{BINUTILS-VERSION}
83@example
84    FTP Site:    @value{BINUTILS-FTPSITE}
85    Directory:   @value{BINUTILS-FTPDIR}
86    File:        @value{BINUTILS-TAR}
87@end example
88
89@subheading @value{NEWLIB-VERSION}
90@example
91    FTP Site:    @value{NEWLIB-FTPSITE}
92    Directory:   @value{NEWLIB-FTPDIR}
93    File:        @value{NEWLIB-TAR}
94@end example
95
96@subheading @value{RTEMS-VERSION}
97@example
98    FTP Site:    @value{RTEMS-FTPSITE}
99    Directory:   @value{RTEMS-FTPDIR}
100    File:        @value{RTEMS-TAR}
101    File:        hello_world_c.tgz
102    File:        bit
103@end example
104
105@subheading RTEMS Specific Tool Patches
106@example
107    FTP Site:    @value{RTEMS-FTPSITE}
108    Directory:   @value{RTEMS-FTPDIR}/c_tools
109@ifset BINUTILS-RTEMSPATCH
110    File:        @value{BINUTILS-RTEMSPATCH}
111@end ifset
112@ifset NEWLIB-RTEMSPATCH
113    File:        @value{NEWLIB-RTEMSPATCH}
114@end ifset
115@ifset GCC-RTEMSPATCH
116    File:        @value{GCC-RTEMSPATCH}
117@end ifset
118@c Just in case there are ever no patches
119@ifset BINUTILS-RTEMSPATCH
120@ifset GCC-RTEMSPATCH
121@ifset NEWLIB-RTEMSPATCH
122    No RTEMS specific patches are required.
123@end ifset
124@end ifset
125@end ifset
126
127@end example
128
129@section Unarchiving the Tools
130
131While in the @code{tools} directory, unpack the compressed
132tar files using the following command sequence:
133
134@example
135cd tools
136tar xzf ../arc/@value{GCC-TAR}
137tar xzf ../arc/@value{BINUTILS-TAR}
138tar xzf ../arc/@value{NEWLIB-TAR}
139@end example
140
141After the compressed tar files have been unpacked, the following
142directories will have been created under tools.
143
144@itemize @bullet
145@item @value{BINUTILS-UNTAR}
146@item @value{GCC-UNTAR}
147@item @value{NEWLIB-UNTAR}
148@end itemize
149
150The @code{bit} script will automatically create two other
151subdirectories:
152
153@itemize @bullet
154@item src
155@item build-$@{CPU@}-tools
156@end itemize
157
158Ignoring version numbers, this will look something like the following figure:
159
160@ifset use-ascii
161@example
162@group
163                       tools
164                         |    bit (script)
165                         +
166 +---------+-------------+------------+----------------+
167 |         |             |            |                |
168src   binutils-2.9   egcs-1.0.2  newlib-1.8.0  build-$@{CPU@}-tools
169@end group
170@end example
171@end ifset
172
173
174@ifset use-tex
175@c for now use the ascii version
176@example
177@group
178                       tools
179                         |    bit (script)
180                         +
181 +---------+-------------+------------+----------------+
182 |         |             |            |                |
183src   binutils-2.9   egcs-1.0.2  newlib-1.8.0  build-${CPU}-tools
184@end group
185@end example
186@tex
187@end tex
188@end ifset
189
190@ifset use-html
191@html
192<IMG SRC="bit_c.jpg" WIDTH=816 HEIGHT=267 ALT="Directory Organization">
193@end html
194@end ifset
195
196@c
197@c  Reading the Documentation
198@c
199
200@section Reading the Tools Documentation
201
202Each of the tools in the GNU development suite comes with documentation.
203It is in the reader's and tool maintainers' interest that one read the
204documentation before posting a problem to a mailing list or news group.
205
206@c
207@c  EGCS patches
208@c
209
210@section Apply RTEMS Patch to EGCS
211
212@ifclear GCC-RTEMSPATCH
213No RTEMS specific patches are required for @value{GCC-VERSION} to
214support @value{RTEMS-VERSION}.
215@end ifclear
216
217@ifset GCC-RTEMSPATCH
218
219Apply the patch using the following command sequence:
220
221@example
222cd tools/@value{GCC-UNTAR}
223zcat arc/@value{GCC-RTEMSPATCH} | patch -p1
224@end example
225
226Check to see if any of these patches have been rejected using the following
227sequence:
228
229@example
230cd tools/@value{GCC-UNTAR}
231find . -name "*.rej" -print
232@end example
233
234If any files are found with the .rej extension, a patch has been rejected.
235This should not happen with a good patch file.
236
237@end ifset
238
239@c
240@c  BINUTILS patches
241@c
242
243@section Apply RTEMS Patch to binutils
244
245@ifclear BINUTILS-RTEMSPATCH
246No RTEMS specific patches are required for @value{BINUTILS-VERSION} to
247support @value{RTEMS-VERSION}.
248@end ifclear
249
250@ifset BINUTILS-RTEMSPATCH
251Apply the patch using the following command sequence:
252
253@example
254cd tools/@value{BINUTILS-UNTAR}
255zcat arc/@value{BINUTILS-RTEMSPATCH} | patch -p1
256@end example
257
258Check to see if any of these patches have been rejected using the following
259sequence:
260
261@example
262cd tools/@value{BINUTILS-UNTAR}
263find . -name "*.rej" -print
264@end example
265
266If any files are found with the .rej extension, a patch has been rejected.
267This should not happen with a good patch file.
268
269@end ifset
270
271@c
272@c  Newlib patches
273@c
274
275@section Apply RTEMS Patch to newlib
276
277@ifclear NEWLIB-RTEMSPATCH
278No RTEMS specific patches are required for @value{NEWLIB-VERSION} to
279support @value{RTEMS-VERSION}.
280@end ifclear
281
282@ifset NEWLIB-RTEMSPATCH
283
284Apply the patch using the following command sequence:
285
286@example
287cd tools/@value{NEWLIB-UNTAR}
288zcat arc/@value{NEWLIB-RTEMSPATCH} | patch -p1
289@end example
290
291Check to see if any of these patches have been rejected using the following
292sequence:
293
294@example
295cd tools/@value{NEWLIB-UNTAR}
296find . -name "*.rej" -print
297@end example
298
299If any files are found with the .rej extension, a patch has been rejected.
300This should not happen with a good patch file.
301
302@end ifset
303
304@c
305@c  Modify the bit script
306@c
307
308@section Modify the bit Script
309
310Copy the @code{bit} script from arc to the tools directory.
311
312Edit the @code{bit} file to alter the following environmental variables:
313
314@itemize @bullet
315@item INSTALL_POINT
316@item BINUTILS
317@item NEWLIB
318@item GCC
319@item BUILD_DOCS
320@item BUILD_OTHER_LANGUAGES
321@end itemize
322
323These variables are located in the script section that resembles the
324extract below:
325
326
327@example
328# USERCHANGE -- localize these.
329#
330#  INSTALL_POINT: Directory tools are installed into.
331#      Recommended installation point for various OS's:
332#         Linux:    /usr/local/rtems
333#         Solaris:  /opt/gnu/rtems
334#   BINUTILS:     Binutils source directory
335#   NEWLIB:       Newlib source directory
336#   GCC:          Newlib source directory
337#   BUILD_DOCS:   Set to "yes" if you want to install documentation.
338#   BUILD_OTHER_LANGUAGES:
339#                 Set to "yes" if you want to build Fortran and Objective-C
340#
341BINUTILS=@value{BINUTILS-UNTAR}
342GCC=@value{GCC-UNTAR}
343NEWLIB=@value{NEWLIB-UNTAR}
344BUILD_DOCS=yes
345BUILD_OTHER_LANGUAGES=yes
346INSTALL_POINT=/home/joel/$@{GCC@}/$@{target@}
347
348# USERCHANGE - uncomment this if you want to watch the commands.
349@end example
350
351Where each of the variables which may be modified is described below:
352
353@table @code
354@item INSTALL_POINT
355is the location where you wish the GNU C/C++ cross compilation tools for
356RTEMS to be built. It is recommended that the directory chosen to receive
357these tools be named so that it is clear from which egcs distribution it
358was generated and for which target system the tools are to produce code for.
359
360@item BINUTILS
361is the directory under tools that contains @value{BINUTILS-UNTAR}.
362For example:
363
364@example
365BINUTILS=@value{BINUTILS-UNTAR}
366@end example
367
368@item GCC
369is the directory under tools that contains @value{GCC-UNTAR}.
370For example,
371
372@example
373GCC=@value{GCC-UNTAR}
374@end example
375
376@item NEWLIB
377is the directory under tools that contains @value{NEWLIB-UNTAR}.
378For example:
379
380@example
381NEWLIB=@value{NEWLIB-UNTAR}
382@end example
383
384@item BUILD_DOCS
385is set to "yes" if you want to install documentation.
386For example:
387
388@example
389BUILD_DOCS=yes
390@end example
391
392@item BUILD_OTHER_LANGUAGES
393is set to "yes" if you want to build languages other than C and C++.  At
394the current time, this enables Fortan and Objective-C.
395For example:
396
397@example
398BUILD_OTHER_LANGUAGES=yes
399@end example
400
401@end table
402
403@section Running the bit Script
404
405After the @code{bit} script has been modified to reflect the
406local installation, the modified @code{bit} script is run
407using the following sequence:
408
409@example
410cd tools
411./bit <target configuration>
412@end example
413
414Where <target configuration> is one of the following:
415
416@itemize @bullet
417@item hppa1.1
418@item i386
419@item i386-elf
420@item i386-go32
421@item i960
422@item m68k
423@item mips64orion
424@item powerpc
425@item sh
426@item sparc
427@end itemize
428
429If no errors are encountered, the @code{bit} script will conclude by
430printing messages similar to the following:
431
432@example
433
434The src and build-i386-tools subdirectory may now be removed.
435
436Started:  Fri Apr 10 10:14:07 CDT 1998
437Finished: Fri Apr 10 12:01:33 CDT 1998
438@end example
439
440If the @code{bit} script successfully completes, then the
441GNU C/C++ cross compilation tools are installed.
442
443If the @code{bit} script does not successfully complete, then investigation
444will be required to determine the source of the error.
445
Note: See TracBrowser for help on using the repository browser.