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

4.104.114.84.95
Last change on this file since ecbba5fc was ecbba5fc, checked in by Joel Sherrill <joel.sherrill@…>, on 10/27/98 at 23:45:52

Version changed.

  • Property mode set to 100644
File size: 13.6 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:        @value{BUILDTOOLS-TAR}
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}
146tar xzf ../archive/@value{BUILDTOOLS-TAR}
147@end example
148
149After the compressed tar files have been unpacked, the following
150directories will have been created under tools.
151
152@itemize @bullet
153@item @value{BINUTILS-UNTAR}
154@item @value{GCC-UNTAR}
155@item @value{GNAT-UNTAR}
156@item @value{NEWLIB-UNTAR}
157@end itemize
158
159There will also be a set of scripts in the current directory
160which aid in building the tools and RTEMS.  They are:
161
162@itemize @bullet
163@item bit_ada
164@item bit_gdb
165@item bit_rtems
166@item common.sh
167@item user.cfg
168@end itemize
169
170When the @code{bit_ada} script is executed later in this process,
171it will automatically create two other subdirectories:
172
173@itemize @bullet
174@item src
175@item build-$@{CPU@}-tools
176@end itemize
177
178Similarly, the @code{bit_gdb} script will create the
179subdirectory @code{build-$@{CPU@}-gdb} and
180the @code{bit_rtems} script will create the
181subdirectory @code{build-$@{CPU@}-rtems}.
182
183The directory tree should look something like the following figure:
184
185@example
186@group
187/whatever/prefix/you/choose/
188        archive/
189            @value{GCC-TAR}
190            @value{GNAT-TAR}
191            @value{BINUTILS-TAR}
192            @value{NEWLIB-TAR}
193            @value{RTEMS-TAR}
194            @value{BUILDTOOLS-TAR}
195@ifset GCC-RTEMSPATCH
196            @value{GCC-RTEMSPATCH}
197@end ifset
198@ifset BINUTILS-RTEMSPATCH
199            @value{BINUTILS-RTEMSPATCH}
200@end ifset
201@ifset NEWLIB-RTEMSPATCH
202            @value{NEWLIB-RTEMSPATCH}
203@end ifset
204@ifset GNAT-RTEMSPATCH
205            @value{GNAT-RTEMSPATCH}
206@end ifset
207            hello_world_ada.tgz
208            bit_ada
209        tools/
210            @value{BINUTILS-UNTAR}/
211            @value{GCC-UNTAR}/
212            @value{GNAT-UNTAR}/
213            @value{NEWLIB-UNTAR}/
214            @value{RTEMS-UNTAR}/
215            bit_ada
216            bit_gdb
217            bit_rtems
218            common.sh
219            user.cfg
220@end group
221@end example
222
223@c @ifset use-html
224@c @html
225@c <IMG SRC="bit_ada.jpg" WIDTH=816 HEIGHT=267 ALT="Directory Organization">
226@c @end html
227@c @end ifset
228
229@c
230@c  Host Specific Notes
231@c
232
233@section Host Specific Notes
234
235@subsection Solaris 2.x
236
237The build scripts are written in "shell".  The program @code{/bin/sh}
238on Solaris 2.x is not robust enough to execute these scripts.  If you
239are on a Solaris 2.x host, then change the first line of the files
240@code{bit_ada}, @code{bit_gdb}, and @code{bit_rtems} to use the
241@code{/bin/ksh} shell instead.
242
243@c
244@c  Reading the Documentation
245@c
246
247@section Reading the Tools Documentation
248
249Each of the tools in the GNU development suite comes with documentation.
250It is in the reader's and tool maintainers' interest that one read the
251documentation before posting a problem to a mailing list or news group.
252
253
254@c
255@c  GCC patches
256@c
257
258@section Apply RTEMS Patch to GCC
259
260@ifclear GCC-RTEMSPATCH
261No RTEMS specific patches are required for @value{GCC-VERSION} to
262support @value{RTEMS-VERSION}.
263@end ifclear
264
265@ifset GCC-RTEMSPATCH
266
267Apply the patch using the following command sequence:
268
269@example
270cd tools/@value{GCC-UNTAR}
271zcat ../../archive/@value{GCC-RTEMSPATCH} | patch -p1
272@end example
273
274Check to see if any of these patches have been rejected using the following
275sequence:
276
277@example
278cd tools/@value{GCC-UNTAR}
279find . -name "*.rej" -print
280@end example
281
282If any files are found with the .rej extension, a patch has been rejected.
283This should not happen with a good patch file which is properly applied.
284
285@end ifset
286
287@c
288@c  BINUTILS patches
289@c
290
291@section Apply RTEMS Patch to binutils
292
293@ifclear BINUTILS-RTEMSPATCH
294No RTEMS specific patches are required for @value{BINUTILS-VERSION} to
295support @value{RTEMS-VERSION}.
296@end ifclear
297
298@ifset BINUTILS-RTEMSPATCH
299Apply the patch using the following command sequence:
300
301@example
302cd tools/@value{BINUTILS-UNTAR}
303zcat ../../archive/@value{BINUTILS-RTEMSPATCH} | patch -p1
304@end example
305
306Check to see if any of these patches have been rejected using the following
307sequence:
308
309@example
310cd tools/@value{BINUTILS-UNTAR}
311find . -name "*.rej" -print
312@end example
313
314If any files are found with the .rej extension, a patch has been rejected.
315This should not happen with a good patch file which is properly applied.
316
317@end ifset
318
319@c
320@c  Newlib patches
321@c
322
323@section Apply RTEMS Patch to newlib
324
325@ifclear NEWLIB-RTEMSPATCH
326No RTEMS specific patches are required for @value{NEWLIB-VERSION} to
327support @value{RTEMS-VERSION}.
328@end ifclear
329
330@ifset NEWLIB-RTEMSPATCH
331
332Apply the patch using the following command sequence:
333
334@example
335cd tools/@value{NEWLIB-UNTAR}
336zcat ../../archive/@value{NEWLIB-RTEMSPATCH} | patch -p1
337@end example
338
339Check to see if any of these patches have been rejected using the following
340sequence:
341
342@example
343cd tools/@value{NEWLIB-UNTAR}
344find . -name "*.rej" -print
345@end example
346
347If any files are found with the .rej extension, a patch has been rejected.
348This should not happen with a good patch file which is properly applied.
349
350@end ifset
351
352@c 
353@c  GNAT patches
354@c
355
356@section Apply RTEMS Patch to GNAT
357
358@ifclear GNAT-RTEMSPATCH
359No RTEMS specific patches are required for @value{GNAT-VERSION} to
360support @value{RTEMS-VERSION}.
361@end ifclear
362
363@ifset GNAT-RTEMSPATCH
364
365Apply the patch using the following command sequence:
366
367@example
368cd tools/@value{GNAT-UNTAR}
369zcat ../../archive/@value{GNAT-RTEMSPATCH} | patch -p1
370@end example
371
372Check to see if any of these patches have been rejected using the following
373sequence:
374
375@example
376cd tools/@value{GNAT-UNTAR}
377find . -name "*.rej" -print
378@end example
379
380If any files are found with the .rej extension, a patch has been rejected.
381This should not happen with a good patch file which is properly applied.
382
383@end ifset
384
385@c
386@c  Copy the ada directory
387@c
388
389
390@section Copy the ada Subdirectory to the GCC Source Tree
391
392Copy the ada subtree in the patched subtree of
393tools/@value{GNAT-UNTAR}/src to the
394tools/@value{GCC-UNTAR} directory:
395
396@example
397cd tools/@value{GNAT-UNTAR}/src
398cp -r ada ../../@value{GCC-UNTAR}
399@end example
400
401@c
402@c  Localizing the Configuration
403@c
404
405@section Localizing the Configuration
406
407Edit the @code{user.cfg} file to alter the settings of various
408variables which are used to tailor the build process.
409Each of the variables set in @code{user.cfg} may be modified
410as 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@b{WARNING}: The @code{INSTALL_POINT} should not be a subdirectory
420under the build directory.  The build directory will be removed
421automatically upon successful completion of the build procedure.
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
439Note that the gnat version is not needed because the gnat source
440is built as part of building gcc.
441
442@item NEWLIB
443is the directory under tools that contains @value{NEWLIB-UNTAR}.
444For example:
445
446@example
447NEWLIB=@value{NEWLIB-UNTAR}
448@end example
449
450@item BUILD_DOCS
451is set to "yes" if you want to install documentation.
452For example:
453
454@example
455BUILD_DOCS=yes
456@end example
457
458@item BUILD_OTHER_LANGUAGES
459is set to "yes" if you want to build languages other than C and C++.  At
460the current time, this enables Fortan and Objective-C.
461For example:
462
463@example
464BUILD_OTHER_LANGUAGES=yes
465@end example
466
467@item RTEMS
468is the directory under tools that contails @value{RTEMS-UNTAR}.
469
470@item ENABLE_RTEMS_POSIX
471is set to "yes" if you want to enable the RTEMS POSIX API support.
472At this time, this feature is not supported by the UNIX ports of RTEMS
473and is forced to "no" for those targets.  This corresponds to the
474@code{configure} option @code{--enable-posix}.
475
476This must be enabled to support the GNAT/RTEMS run-time.
477
478@item ENABLE_RTEMS_TESTS
479is set to "yes" if you want to build the RTEMS Test Suite.  If this
480is set to "no", then only the Sample Tests will be built.
481This corresponds to the @code{configure} option @code{--enable-tests}.
482
483@item ENABLE_RTEMS_TCPIP
484is set to "yes" if you want to build the RTEMS TCP/IP Stack.  If a
485particular BSP does not support TCP/IP, then this feature is automatically
486disabled.  This corresponds to the @code{configure} option
487@code{--enable-tcpip}.
488
489@item ENABLE_RTEMS_CXX
490is set to "yes" if you want to build the RTEMS C++ support including
491the C++ Wrapper for the Classic API.  This corresponds to the
492@code{configure} option @code{--enable-cxx}.
493@end table
494
495@section Running the bit_ada Script
496
497After the @code{bit_ada} script has been modified to reflect the
498local installation, the modified @code{bit_ada} script is run
499using the following sequence:
500
501@example
502cd tools
503./bit_ada <target configuration>
504@end example
505
506Where <target configuration> is one of the following:
507
508@itemize @bullet
509@item hppa1.1
510@item i386
511@item i386-elf
512@item i386-go32
513@item i960
514@item m68k
515@item mips64orion
516@item powerpc
517@item sh
518@item sparc
519@end itemize
520
521NOTE:  The above list of target configurations is the list of RTEMS supported
522targets.  Only a subset of these have been tested with GNAT/RTEMS.  For more
523information, contact your GNAT/RTEMS representative.
524
525If no errors are encountered, the @code{bit_ada} script will conclude by
526printing messages similar to the following:
527
528@example
529
530The src and build-i386-tools subdirectory may now be removed.
531
532Started:  Fri Apr 10 10:14:07 CDT 1998
533Finished: Fri Apr 10 12:01:33 CDT 1998
534@end example
535
536If the @code{bit_ada} script successfully completes, then the
537GNU C/C++ cross compilation tools are installed.
538
539If the @code{bit_ada} script does not successfully complete, then investigation
540will be required to determine the source of the error.
541
Note: See TracBrowser for help on using the repository browser.