source: rtems/doc/started/buildc.t @ 6e3c36b7

4.104.114.84.95
Last change on this file since 6e3c36b7 was 6e3c36b7, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 13, 1998 at 8:03:57 PM

added ASCII versions of directory tree figures

  • Property mode set to 100644
File size: 10.4 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 Tools
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
131The @code{bit} script will automatically create two other
132subdirectories:
133
134@itemize @bullet
135@item src
136@item build-$@{CPU@}-tools
137@end itemize
138
139Ignoring version numbers, this will look something like the following figure:
140
141@ifset use-ascii
142@example
143@group
144                       tools
145                         |    bit (script)
146                         +
147 +---------+-------------+------------+----------------+
148 |         |             |            |                |
149src   binutils-2.9   egcs-1.0.2  newlib-1.8.0  build-$@{CPU@}-tools
150@end group
151@end example
152@end ifset
153
154
155@ifset use-tex
156@c for now use the ascii version
157@example
158@group
159                       tools
160                         |    bit (script)
161                         +
162 +---------+-------------+------------+----------------+
163 |         |             |            |                |
164src   binutils-2.9   egcs-1.0.2  newlib-1.8.0  build-${CPU}-tools
165@end group
166@end example
167@tex
168@end tex
169@end ifset
170
171@ifset use-html
172@html
173<IMG SRC="bit_c.jpg" WIDTH=816 HEIGHT=267 ALT="Directory Organization">
174@end html
175@end ifset
176
177@c
178@c  EGCS patches
179@c
180
181@section Apply RTEMS Patch to EGCS
182
183@ifclear GCC-RTEMSPATCH
184No RTEMS specific patches are required for @value{GCC-VERSION} to
185support @value{RTEMS-VERSION}.
186@end ifclear
187
188@ifset GCC-RTEMSPATCH
189
190Apply the patch using the following command sequence:
191
192@example
193cd tools/@value{GCC-UNTAR}
194zcat arc/@value{GCC-RTEMSPATCH} | patch -p1
195@end example
196
197Check to see if any of these patches have been rejected using the following
198sequence:
199
200@example
201cd tools/@value{GCC-UNTAR}
202find . -name "*.rej" -print
203@end example
204
205If any files are found with the .rej extension, a patch has been rejected.
206This should not happen with a good patch file.
207
208To see the files that have been modified use the sequence:
209
210@example
211cd tools/@value{GCC-UNTAR}
212find . -name "*.orig" -print
213@end example
214
215The files that are found, have been modified by the patch file.
216
217@end ifset
218
219@c
220@c  BINUTILS patches
221@c
222
223@section Apply RTEMS Patch to binutils
224
225@ifclear BINUTILS-RTEMSPATCH
226No RTEMS specific patches are required for @value{BINUTILS-VERSION} to
227support @value{RTEMS-VERSION}.
228@end ifclear
229
230@ifset BINUTILS-RTEMSPATCH
231Apply the patch using the following command sequence:
232
233@example
234cd tools/@value{BINUTILS-UNTAR}
235zcat arc/@value{BINUTILS-RTEMSPATCH} | patch -p1
236@end example
237
238Check to see if any of these patches have been rejected using the following
239sequence:
240
241@example
242cd tools/@value{BINUTILS-UNTAR}
243find . -name "*.rej" -print
244@end example
245
246If any files are found with the .rej extension, a patch has been rejected.
247This should not happen with a good patch file.
248
249To see the files that have been modified use the sequence:
250
251@example
252cd tools/@value{BINUTILS-UNTAR}
253find . -name "*.orig" -print
254@end example
255
256The files that are found, have been modified by the patch file.
257
258@end ifset
259
260@c
261@c  Newlib patches
262@c
263
264@section Apply RTEMS Patch to newlib
265
266@ifclear NEWLIB-RTEMSPATCH
267No RTEMS specific patches are required for @value{NEWLIB-VERSION} to
268support @value{RTEMS-VERSION}.
269@end ifclear
270
271@ifset NEWLIB-RTEMSPATCH
272
273Apply the patch using the following command sequence:
274
275@example
276cd tools/@value{NEWLIB-UNTAR}
277zcat arc/@value{NEWLIB-RTEMSPATCH} | patch -p1
278@end example
279
280Check to see if any of these patches have been rejected using the following
281sequence:
282
283@example
284cd tools/@value{NEWLIB-UNTAR}
285find . -name "*.rej" -print
286@end example
287
288If any files are found with the .rej extension, a patch has been rejected.
289This should not happen with a good patch file.
290
291To see the files that have been modified use the sequence:
292
293@example
294cd tools/@value{NEWLIB-UNTAR}
295find . -name "*.orig" -print
296@end example
297
298The files that are found, have been modified by the patch file.
299
300@end ifset
301
302@c
303@c  Modify the bit script
304@c
305
306@section Modify the bit Script
307
308Copy the @code{bit} script from arc to the tools directory.
309
310Edit the @code{bit} file to alter the following environmental variables:
311
312@itemize @bullet
313@item INSTALL_POINT
314@item BINUTILS
315@item NEWLIB
316@item GCC
317@item BUILD_DOCS
318@item BUILD_OTHER_LANGUAGES
319@end itemize
320
321These variables are located in the script section that resembles the
322extract below:
323
324
325@example
326# USERCHANGE -- localize these.
327#
328#  INSTALL_POINT: Directory tools are installed into.
329#      Recommended installation point for various OS's:
330#         Linux:    /usr/local/rtems
331#         Solaris:  /opt/gnu/rtems
332#   BINUTILS:     Binutils source directory
333#   NEWLIB:       Newlib source directory
334#   GCC:          Newlib source directory
335#   BUILD_DOCS:   Set to "yes" if you want to install documentation.
336#   BUILD_OTHER_LANGUAGES:
337#                 Set to "yes" if you want to build Fortran and Objective-C
338#
339BINUTILS=@value{BINUTILS-UNTAR}
340GCC=@value{GCC-UNTAR}
341NEWLIB=@value{NEWLIB-UNTAR}
342BUILD_DOCS=yes
343BUILD_OTHER_LANGUAGES=yes
344INSTALL_POINT=/home/joel/$@{GCC@}/$@{target@}
345
346# USERCHANGE - uncomment this if you want to watch the commands.
347@end example
348
349Where each of the variables which may be modified is described below:
350
351@table @code
352@item INSTALL_POINT
353is the location where you wish the GNU C/C++ cross compilation tools for
354RTEMS to be built. It is recommended that the directory chosen to receive
355these tools be named so that it is clear from which egcs distribution it
356was generated and for which target system the tools are to produce code for.
357
358@item BINUTILS
359is the directory under tools that contains @value{BINUTILS-UNTAR}.
360For example:
361
362@example
363BINUTILS=@value{BINUTILS-UNTAR}
364@end example
365
366@item GCC
367is the directory under tools that contains @value{GCC-UNTAR}.
368For example,
369
370@example
371GCC=@value{GCC-UNTAR}
372@end example
373
374@item NEWLIB
375is the directory under tools that contains @value{NEWLIB-UNTAR}.
376For example:
377
378@example
379NEWLIB=@value{NEWLIB-UNTAR}
380@end example
381
382@item BUILD_DOCS
383is set to "yes" if you want to install documentation.
384For example:
385
386@example
387BUILD_DOCS=yes
388@end example
389
390@item BUILD_OTHER_LANGUAGES
391is set to "yes" if you want to build languages other than C and C++.  At
392the current time, this enables Fortan and Objective-C.
393For example:
394
395@example
396BUILD_OTHER_LANGUAGES=yes
397@end example
398
399@end table
400
401@section Running the bit Script
402
403After the @code{bit} script has been modified to reflect the
404local installation, the modified @code{bit} script is run
405using the following sequence:
406
407@example
408cd tools
409./bit <target configuration>
410@end example
411
412Where <target configuration> is one of the following:
413
414@itemize @bullet
415@item hppa1.1
416@item i386
417@item i386-elf
418@item i386-go32
419@item i960
420@item m68k
421@item mips64orion
422@item powerpc
423@item sh
424@item sparc
425@end itemize
426
427If no errors are encountered, the @code{bit} script will conclude by
428printing messages similar to the following:
429
430@example
431
432The src and build-i386-tools subdirectory may now be removed.
433
434Started:  Fri Apr 10 10:14:07 CDT 1998
435Finished: Fri Apr 10 12:01:33 CDT 1998
436@end example
437
438If the @code{bit} script successfully completes, then the
439GNU C/C++ cross compilation tools are installed.
440
441If the @code{bit} script does not successfully complete, then investigation
442will be required to determine the source of the error.
443
Note: See TracBrowser for help on using the repository browser.