source: rtems/doc/started_ada/buildada.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: 11.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 GNAT 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{GNAT-VERSION}
83@example
84    FTP Site:    @value{GNAT-FTPSITE}
85    Directory:   @value{GNAT-FTPDIR}
86    File:        @value{GNAT-TAR}
87@end example
88
89@subheading @value{BINUTILS-VERSION}
90@example
91    FTP Site:    @value{BINUTILS-FTPSITE}
92    Directory:   @value{BINUTILS-FTPDIR}
93    File:        @value{BINUTILS-TAR}
94@end example
95
96@subheading @value{NEWLIB-VERSION}
97@example
98    FTP Site:    @value{NEWLIB-FTPSITE}
99    Directory:   @value{NEWLIB-FTPDIR}
100    File:        @value{NEWLIB-TAR}
101@end example
102
103@subheading @value{RTEMS-VERSION}
104@example
105    FTP Site:    @value{RTEMS-FTPSITE}
106    Directory:   @value{RTEMS-FTPDIR}
107    File:        @value{RTEMS-TAR}
108    File:        bit_ada
109    File:        hello_world_ada.tgz
110@end example
111
112@subheading RTEMS Specific Tool Patches
113@example
114    FTP Site:    @value{RTEMS-FTPSITE}
115    Directory:   @value{RTEMS-FTPDIR}/ada_tools
116@ifset BINUTILS-RTEMSPATCH
117    File:        @value{BINUTILS-RTEMSPATCH}
118@end ifset
119@ifset NEWLIB-RTEMSPATCH
120    File:        @value{NEWLIB-RTEMSPATCH}
121@end ifset
122@ifset GCC-RTEMSPATCH
123    File:        @value{GCC-RTEMSPATCH}
124@end ifset
125@ifset GNAT-RTEMSPATCH
126    File:        @value{GNAT-RTEMSPATCH}
127@end ifset
128@c Just in case there are ever no patches
129@ifset BINUTILS-RTEMSPATCH
130@ifset GCC-RTEMSPATCH
131@ifset NEWLIB-RTEMSPATCH
132@ifset GNAT-RTEMSPATCH
133    No RTEMS specific patches are required.
134@end ifset
135@end ifset
136@end ifset
137@end ifset
138@end example
139
140@section Unarchiving the Tools
141
142While in the @code{tools} directory, unpack the compressed
143tar files using the following command sequence:
144
145@example
146cd tools
147tar xzf ../arc/@value{GCC-TAR}
148tar xzf ../arc/@value{GNAT-TAR}
149tar xzf ../arc/@value{BINUTILS-TAR}
150tar xzf ../arc/@value{NEWLIB-TAR}
151@end example
152
153After the compressed tar files have been unpacked, the following
154directories will have been created under tools.
155
156@itemize @bullet
157@item @value{BINUTILS-UNTAR}
158@item @value{GCC-UNTAR}
159@item @value{GNAT-UNTAR}
160@item @value{NEWLIB-UNTAR}
161@end itemize
162
163The @code{bit_ada} script will automatically create two other
164subdirectories:
165
166@itemize @bullet
167@item src
168@item build-$@{CPU@}-tools
169@end itemize
170
171Ignoring version numbers, this will look something like the following figure:
172
173@ifset use-ascii
174@example
175@group
176                       tools
177                         |    bit_ada (script)
178                         +
179 +---------+-------------+-----------+----------------+
180 |         |             |           |                |
181src   binutils-2.9   gcc-2.8.1  newlib-1.8.0  build-$@{CPU@}-tools
182@end group
183@end example
184@end ifset
185
186
187@ifset use-tex
188@c for now use the ascii version
189@example
190@group
191                       tools
192                         |    bit_ada (script)
193                         +
194 +---------+-------------+-----------+----------------+
195 |         |             |           |                |
196src   binutils-2.9   gcc-2.8.1  newlib-1.8.0  build-${CPU}-tools
197@end group
198@end example
199@tex
200@end tex
201@end ifset
202
203@ifset use-html
204@html
205<IMG SRC="bit_ada.jpg" WIDTH=816 HEIGHT=267 ALT="Directory Organization">
206@end html
207@end ifset
208
209@c
210@c  Reading the Documentation
211@c
212
213@section Reading the Tools Documentation
214
215Each of the tools in the GNU development suite comes with documentation.
216It is in the reader's and tool maintainers' interest that one read the
217documentation before posting a problem to a mailing list or news group.
218
219
220@c
221@c  GCC patches
222@c
223
224@section Apply RTEMS Patch to GCC
225
226@ifclear GCC-RTEMSPATCH
227No RTEMS specific patches are required for @value{GCC-VERSION} to
228support @value{RTEMS-VERSION}.
229@end ifclear
230
231@ifset GCC-RTEMSPATCH
232
233Apply the patch using the following command sequence:
234
235@example
236cd tools/@value{GCC-UNTAR}
237zcat arc/@value{GCC-RTEMSPATCH} | patch -p1
238@end example
239
240Check to see if any of these patches have been rejected using the following
241sequence:
242
243@example
244cd tools/@value{GCC-UNTAR}
245find . -name "*.rej" -print
246@end example
247
248If any files are found with the .rej extension, a patch has been rejected.
249This should not happen with a good patch file.
250
251@end ifset
252
253@c
254@c  BINUTILS patches
255@c
256
257@section Apply RTEMS Patch to binutils
258
259@ifclear BINUTILS-RTEMSPATCH
260No RTEMS specific patches are required for @value{BINUTILS-VERSION} to
261support @value{RTEMS-VERSION}.
262@end ifclear
263
264@ifset BINUTILS-RTEMSPATCH
265Apply the patch using the following command sequence:
266
267@example
268cd tools/@value{BINUTILS-UNTAR}
269zcat arc/@value{BINUTILS-RTEMSPATCH} | patch -p1
270@end example
271
272Check to see if any of these patches have been rejected using the following
273sequence:
274
275@example
276cd tools/@value{BINUTILS-UNTAR}
277find . -name "*.rej" -print
278@end example
279
280If any files are found with the .rej extension, a patch has been rejected.
281This should not happen with a good patch file.
282
283@end ifset
284
285@c
286@c  Newlib patches
287@c
288
289@section Apply RTEMS Patch to newlib
290
291@ifclear NEWLIB-RTEMSPATCH
292No RTEMS specific patches are required for @value{NEWLIB-VERSION} to
293support @value{RTEMS-VERSION}.
294@end ifclear
295
296@ifset NEWLIB-RTEMSPATCH
297
298Apply the patch using the following command sequence:
299
300@example
301cd tools/@value{NEWLIB-UNTAR}
302zcat arc/@value{NEWLIB-RTEMSPATCH} | patch -p1
303@end example
304
305Check to see if any of these patches have been rejected using the following
306sequence:
307
308@example
309cd tools/@value{NEWLIB-UNTAR}
310find . -name "*.rej" -print
311@end example
312
313If any files are found with the .rej extension, a patch has been rejected.
314This should not happen with a good patch file.
315
316@end ifset
317
318@c 
319@c  GNAT patches
320@c
321
322@section Apply RTEMS Patch to GNAT
323
324@ifclear GNAT-RTEMSPATCH
325No RTEMS specific patches are required for @value{GNAT-VERSION} to
326support @value{RTEMS-VERSION}.
327@end ifclear
328
329@ifset GNAT-RTEMSPATCH
330
331Apply the patch using the following command sequence:
332
333@example
334cd tools/@value{GNAT-UNTAR}
335zcat arc/@value{GNAT-RTEMSPATCH} | patch -p1
336@end example
337
338Check to see if any of these patches have been rejected using the following
339sequence:
340
341@example
342cd tools/@value{GNAT-UNTAR}
343find . -name "*.rej" -print
344@end example
345
346If any files are found with the .rej extension, a patch has been rejected.
347This should not happen with a good patch file.
348
349@end ifset
350
351@c
352@c  Copy the ada directory
353@c
354
355
356@section Copy the ada Subdirectory to the GCC Source Tree
357
358Copy the ada subtree in the patched subtree of
359tools/@value{GNAT-UNTAR}/src to the
360tools/@value{GCC-UNTAR} directory:
361
362@example
363cd tools/@value{GNAT-UNTAR}/src
364cp -r ada ../../../@value{GCC-UNTAR}
365@end example
366
367@c
368@c  Modify the bit_ada script
369@c
370
371@section Modify the bit_ada Script
372
373Copy the @code{bit_ada} script from arc to the tools directory.
374
375Edit the @code{bit_ada} file to alter the following environmental variables:
376
377@itemize @bullet
378@item INSTALL_POINT
379@item BINUTILS
380@item NEWLIB
381@item GCC
382@item BUILD_DOCS
383@end itemize
384
385These variables are located in the script section that resembles the
386extract below:
387
388
389@example
390# USERCHANGE -- localize these.
391#
392#  INSTALL_POINT: Directory tools are installed into.
393#      Recommended installation point for various OS's:
394#         Linux:    /usr/local/rtems
395#         Solaris:  /opt/gnu/rtems
396#   BINUTILS:     Binutils source directory
397#   NEWLIB:       Newlib source directory
398#   GCC:          Newlib source directory
399#   BUILD_DOCS:   Set to "yes" if you want to install documentation.
400#
401BINUTILS=@value{BINUTILS-UNTAR}
402GCC=@value{GCC-UNTAR}
403NEWLIB=@value{NEWLIB-UNTAR}
404BUILD_DOCS=yes
405INSTALL_POINT=/home/joel/$@{GCC@}/$@{target@}
406
407# USERCHANGE - uncomment this if you want to watch the commands.
408@end example
409
410Where each of the variables which may be modified is described below:
411
412@table @code
413@item INSTALL_POINT
414is the location where you wish the GNU C/C++ cross compilation tools for
415RTEMS to be built. It is recommended that the directory chosen to receive
416these tools be named so that it is clear from which egcs distribution it
417was generated and for which target system the tools are to produce code for.
418
419@item BINUTILS
420is the directory under tools that contains @value{BINUTILS-UNTAR}.
421For example:
422
423@example
424BINUTILS=@value{BINUTILS-UNTAR}
425@end example
426
427@item GCC
428is the directory under tools that contains @value{GCC-UNTAR}.
429For example:
430
431@example
432GCC=@value{GCC-UNTAR}
433@end example
434
435@item NEWLIB
436is the directory under tools that contains @value{NEWLIB-UNTAR}.
437For example:
438
439@example
440NEWLIB=@value{NEWLIB-UNTAR}
441@end example
442
443@item BUILD_DOCS
444is set to "yes" if you want to install documentation.
445For example:
446
447@example
448BUILD_DOCS=yes
449@end example
450
451@end table
452
453@section Running the bit_ada Script
454
455After the @code{bit_ada} script has been modified to reflect the
456local installation, the modified @code{bit_ada} script is run
457using the following sequence:
458
459@example
460cd tools
461./bit_ada <target configuration>
462@end example
463
464Where <target configuration> is one of the following:
465
466@itemize @bullet
467@item hppa1.1
468@item i386
469@item i386-elf
470@item i386-go32
471@item i960
472@item m68k
473@item mips64orion
474@item powerpc
475@item sh
476@item sparc
477@end itemize
478
479NOTE:  The above list of target configurations is the list of RTEMS supported
480targets.  Only a subset of these have been tested with GNAT/RTEMS.  For more
481information, contact your GNAT/RTEMS representative.
482
483If no errors are encountered, the @code{bit_ada} script will conclude by
484printing messages similar to the following:
485
486@example
487
488The src and build-i386-tools subdirectory may now be removed.
489
490Started:  Fri Apr 10 10:14:07 CDT 1998
491Finished: Fri Apr 10 12:01:33 CDT 1998
492@end example
493
494If the @code{bit_ada} script successfully completes, then the
495GNU C/C++ cross compilation tools are installed.
496
497If the @code{bit_ada} script does not successfully complete, then investigation
498will be required to determine the source of the error.
499
Note: See TracBrowser for help on using the repository browser.