source: rtems/doc/started_ada/buildada.t @ a6aa8a91

4.104.114.84.95
Last change on this file since a6aa8a91 was a6aa8a91, checked in by Joel Sherrill <joel.sherrill@…>, on 04/14/98 at 21:19:25

"arc" renamed to "archive".

Pictures now in ASCII for maintenance purposes.

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