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