source: rtems/doc/started/buildc.t @ 5558bd3

4.104.114.84.95
Last change on this file since 5558bd3 was ae2e9f2, checked in by Joel Sherrill <joel.sherrill@…>, on 04/14/98 at 21:17:53

"arc" changed to "archive"

Pictures now in ASCII.

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