source: rtems/doc/started/buildc.t @ dff0a57c

4.104.114.84.95
Last change on this file since dff0a57c was dff0a57c, checked in by Joel Sherrill <joel.sherrill@…>, on 04/14/98 at 15:32:28

Now builds for all formats and includes urls

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