source: rtems/doc/started_ada/buildada.t @ 4aa6b64

4.104.114.84.95
Last change on this file since 4aa6b64 was 4aa6b64, checked in by Joel Sherrill <joel.sherrill@…>, on 04/13/98 at 19:43:30

Updated to include Steve's figures for the first time.

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