source: rtems/doc/started/buildc.t @ 4aa6b64

4.104.114.84.95
Last change on this file since 4aa6b64 was 0df2ab87, checked in by Joel Sherrill <joel.sherrill@…>, on 04/13/98 at 19:42:55

Now builds for all formats.

Updated to include Steve's figures for the first time.

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