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

4.104.114.84.95
Last change on this file since fffe9266 was fffe9266, checked in by Joel Sherrill <joel.sherrill@…>, on 04/14/98 at 13:48:33

Suggestions from Eric Norum

  • Property mode set to 100644
File size: 11.1 KB
RevLine 
[8e8676da]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
[6d3d425d]9@chapter Building the GNAT Cross Compiler Toolset
[8e8676da]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
[fffe9266]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
[6d3d425d]69@section Get all the Pieces
70
[fffe9266]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.
[8e8676da]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
[6d3d425d]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
[8e8676da]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}
[6d3d425d]108    File:        bit_ada
[fffe9266]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
[6d3d425d]116@ifset BINUTILS-RTEMSPATCH
[8e8676da]117    File:        @value{BINUTILS-RTEMSPATCH}
[6d3d425d]118@end ifset
119@ifset NEWLIB-RTEMSPATCH
[8e8676da]120    File:        @value{NEWLIB-RTEMSPATCH}
[6d3d425d]121@end ifset
122@ifset GCC-RTEMSPATCH
[8e8676da]123    File:        @value{GCC-RTEMSPATCH}
[6d3d425d]124@end ifset
125@ifset GNAT-RTEMSPATCH
126    File:        @value{GNAT-RTEMSPATCH}
127@end ifset
[fffe9266]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.
[4aa6b64]134@end ifset
135@end ifset
136@end ifset
[fffe9266]137@end ifset
138@end example
[4aa6b64]139
[6e3c36b7]140@section Unarchiving the Tools
[8e8676da]141
[4aa6b64]142While in the @code{tools} directory, unpack the compressed
143tar files using the following command sequence:
[8e8676da]144
145@example
146cd tools
147tar xzf ../arc/@value{GCC-TAR}
[6d3d425d]148tar xzf ../arc/@value{GNAT-TAR}
[8e8676da]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}
[6d3d425d]159@item @value{GNAT-UNTAR}
[8e8676da]160@item @value{NEWLIB-UNTAR}
161@end itemize
162
[6e3c36b7]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:
[4aa6b64]172
173@ifset use-ascii
174@example
175@group
[6e3c36b7]176                       tools
177                         |    bit_ada (script)
178                         +
179 +---------+-------------+-----------+----------------+
180 |         |             |           |                |
181src   binutils-2.9   gcc-2.8.1  newlib-1.8.0  build-$@{CPU@}-tools
[4aa6b64]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
[6e3c36b7]191                       tools
192                         |    bit_ada (script)
193                         +
194 +---------+-------------+-----------+----------------+
195 |         |             |           |                |
196src   binutils-2.9   gcc-2.8.1  newlib-1.8.0  build-${CPU}-tools
[4aa6b64]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
[8e8676da]210@c
[6d3d425d]211@c  GCC patches
[8e8676da]212@c
213
[6d3d425d]214@section Apply RTEMS Patch to GCC
[8e8676da]215
216@ifclear GCC-RTEMSPATCH
217No RTEMS specific patches are required for @value{GCC-VERSION} to
218support @value{RTEMS-VERSION}.
219@end ifclear
220
221@ifset GCC-RTEMSPATCH
222
223Apply the patch using the following command sequence:
224
225@example
226cd tools/@value{GCC-UNTAR}
227zcat arc/@value{GCC-RTEMSPATCH} | patch -p1
228@end example
229
230Check to see if any of these patches have been rejected using the following
231sequence:
232
233@example
234cd tools/@value{GCC-UNTAR}
235find . -name "*.rej" -print
236@end example
237
238If any files are found with the .rej extension, a patch has been rejected.
239This should not happen with a good patch file.
240
241@end ifset
242
243@c
244@c  BINUTILS patches
245@c
246
247@section Apply RTEMS Patch to binutils
248
249@ifclear BINUTILS-RTEMSPATCH
250No RTEMS specific patches are required for @value{BINUTILS-VERSION} to
251support @value{RTEMS-VERSION}.
252@end ifclear
253
254@ifset BINUTILS-RTEMSPATCH
255Apply the patch using the following command sequence:
256
257@example
258cd tools/@value{BINUTILS-UNTAR}
259zcat arc/@value{BINUTILS-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{BINUTILS-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
273@end ifset
274
275@c
276@c  Newlib patches
277@c
278
279@section Apply RTEMS Patch to newlib
280
281@ifclear NEWLIB-RTEMSPATCH
282No RTEMS specific patches are required for @value{NEWLIB-VERSION} to
283support @value{RTEMS-VERSION}.
284@end ifclear
285
286@ifset NEWLIB-RTEMSPATCH
287
288Apply the patch using the following command sequence:
289
290@example
291cd tools/@value{NEWLIB-UNTAR}
292zcat arc/@value{NEWLIB-RTEMSPATCH} | patch -p1
293@end example
294
295Check to see if any of these patches have been rejected using the following
296sequence:
297
298@example
299cd tools/@value{NEWLIB-UNTAR}
300find . -name "*.rej" -print
301@end example
302
303If any files are found with the .rej extension, a patch has been rejected.
304This should not happen with a good patch file.
305
306@end ifset
307
[6d3d425d]308@c 
309@c  GNAT patches
[8e8676da]310@c
[6d3d425d]311
312@section Apply RTEMS Patch to GNAT
313
314@ifclear GNAT-RTEMSPATCH
315No RTEMS specific patches are required for @value{GNAT-VERSION} to
316support @value{RTEMS-VERSION}.
317@end ifclear
318
319@ifset GNAT-RTEMSPATCH
320
321Apply the patch using the following command sequence:
322
323@example
324cd tools/@value{GNAT-UNTAR}
325zcat arc/@value{GNAT-RTEMSPATCH} | patch -p1
326@end example
327
328Check to see if any of these patches have been rejected using the following
329sequence:
330
331@example
332cd tools/@value{GNAT-UNTAR}
333find . -name "*.rej" -print
334@end example
335
336If any files are found with the .rej extension, a patch has been rejected.
337This should not happen with a good patch file.
338
339@end ifset
340
341@c
342@c  Copy the ada directory
343@c
344
345
346@section Copy the ada Subdirectory to the GCC Source Tree
347
348Copy the ada subtree in the patched subtree of
349tools/@value{GNAT-UNTAR}/src to the
350tools/@value{GCC-UNTAR} directory:
351
352@example
353cd tools/@value{GNAT-UNTAR}/src
354cp -r ada ../../../@value{GCC-UNTAR}
355@end example
356
357@c
358@c  Modify the bit_ada script
[8e8676da]359@c
360
[6d3d425d]361@section Modify the bit_ada Script
[8e8676da]362
[6d3d425d]363Copy the @code{bit_ada} script from arc to the tools directory.
[8e8676da]364
[6d3d425d]365Edit the @code{bit_ada} file to alter the following environmental variables:
[8e8676da]366
367@itemize @bullet
368@item INSTALL_POINT
369@item BINUTILS
370@item NEWLIB
371@item GCC
372@item BUILD_DOCS
373@end itemize
374
375These variables are located in the script section that resembles the
376extract below:
377
378
379@example
380# USERCHANGE -- localize these.
381#
382#  INSTALL_POINT: Directory tools are installed into.
383#      Recommended installation point for various OS's:
384#         Linux:    /usr/local/rtems
385#         Solaris:  /opt/gnu/rtems
386#   BINUTILS:     Binutils source directory
387#   NEWLIB:       Newlib source directory
388#   GCC:          Newlib source directory
389#   BUILD_DOCS:   Set to "yes" if you want to install documentation.
390#
391BINUTILS=@value{BINUTILS-UNTAR}
392GCC=@value{GCC-UNTAR}
393NEWLIB=@value{NEWLIB-UNTAR}
394BUILD_DOCS=yes
395INSTALL_POINT=/home/joel/$@{GCC@}/$@{target@}
396
397# USERCHANGE - uncomment this if you want to watch the commands.
398@end example
399
400Where each of the variables which may be modified is described below:
401
402@table @code
403@item INSTALL_POINT
404is the location where you wish the GNU C/C++ cross compilation tools for
405RTEMS to be built. It is recommended that the directory chosen to receive
406these tools be named so that it is clear from which egcs distribution it
407was generated and for which target system the tools are to produce code for.
408
409@item BINUTILS
410is the directory under tools that contains @value{BINUTILS-UNTAR}.
[fdd6a26]411For example:
[8e8676da]412
413@example
[fdd6a26]414BINUTILS=@value{BINUTILS-UNTAR}
[8e8676da]415@end example
416
417@item GCC
418is the directory under tools that contains @value{GCC-UNTAR}.
[fdd6a26]419For example:
[8e8676da]420
421@example
[fdd6a26]422GCC=@value{GCC-UNTAR}
[8e8676da]423@end example
424
425@item NEWLIB
426is the directory under tools that contains @value{NEWLIB-UNTAR}.
[fdd6a26]427For example:
[8e8676da]428
429@example
[fdd6a26]430NEWLIB=@value{NEWLIB-UNTAR}
[8e8676da]431@end example
432
433@item BUILD_DOCS
434is set to "yes" if you want to install documentation.
[fdd6a26]435For example:
[8e8676da]436
437@example
438BUILD_DOCS=yes
439@end example
440
441@end table
442
[6d3d425d]443@section Running the bit_ada Script
[8e8676da]444
[6d3d425d]445After the @code{bit_ada} script has been modified to reflect the
446local installation, the modified @code{bit_ada} script is run
[8e8676da]447using the following sequence:
448
449@example
450cd tools
[6d3d425d]451./bit_ada <target configuration>
[8e8676da]452@end example
453
454Where <target configuration> is one of the following:
455
456@itemize @bullet
457@item hppa1.1
458@item i386
459@item i386-elf
460@item i386-go32
461@item i960
462@item m68k
463@item mips64orion
464@item powerpc
465@item sh
466@item sparc
467@end itemize
468
[6d3d425d]469NOTE:  The above list of target configurations is the list of RTEMS supported
470targets.  Only a subset of these have been tested with GNAT/RTEMS.  For more
471information, contact your GNAT/RTEMS representative.
472
473If no errors are encountered, the @code{bit_ada} script will conclude by
[8e8676da]474printing messages similar to the following:
475
476@example
477
478The src and build-i386-tools subdirectory may now be removed.
479
480Started:  Fri Apr 10 10:14:07 CDT 1998
481Finished: Fri Apr 10 12:01:33 CDT 1998
482@end example
483
[6d3d425d]484If the @code{bit_ada} script successfully completes, then the
[8e8676da]485GNU C/C++ cross compilation tools are installed.
486
[6d3d425d]487If the @code{bit_ada} script does not successfully complete, then investigation
[8e8676da]488will be required to determine the source of the error.
489
Note: See TracBrowser for help on using the repository browser.