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
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 GNU C/C++ 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 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
69@section Get All the Pieces
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}
80@ifset use-html
81    URL:         @href{Download @value{GCC-VERSION},,,ftp://@value{GCC-FTPSITE}@value{GCC-FTPDIR}/@value{GCC-TAR}}
82@end ifset
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}
90@ifset use-html
91    URL:         @href{Download @value{BINUTILS-VERSION},,,ftp://@value{BINUTILS-FTPSITE}@value{BINUTILS-FTPDIR}/@value{BINUTILS-TAR}}
92@end ifset
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}
100@ifset use-html
101    URL:         @href{Download @value{NEWLIB-VERSION},,,ftp://@value{NEWLIB-FTPSITE}@value{NEWLIB-FTPDIR}/@value{NEWLIB-TAR}}
102@end ifset
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}
110@ifset use-html
111    URL:         @href{Download RTEMS components,,,ftp://@value{RTEMS-FTPSITE}@value{RTEMS-FTPDIR}}
112@end ifset
113@end example
114
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
126@example
127    FTP Site:    @value{RTEMS-FTPSITE}
128    Directory:   @value{RTEMS-FTPDIR}/c_tools
129    File:        bit
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
139@ifset use-html
140    URL:         @href{Download RTEMS Patches and Scripts,,,ftp://@value{RTEMS-FTPSITE}@value{RTEMS-FTPDIR}/c_tools}
141@end ifset
142@end example
143
144@section Unarchiving the Tools
145
146While in the @code{tools} directory, unpack the compressed
147tar files using the following command sequence:
148
149@example
150cd tools
151tar xzf ../arc/@value{GCC-TAR}
152tar xzf ../arc/@value{BINUTILS-TAR}
153tar xzf ../arc/@value{NEWLIB-TAR}
154@end example
155
156After the compressed tar files have been unpacked, the following
157directories will have been created under tools.
158
159@itemize @bullet
160@item @value{BINUTILS-UNTAR}
161@item @value{GCC-UNTAR}
162@item @value{NEWLIB-UNTAR}
163@end itemize
164
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:
174
175@ifset use-ascii
176@example
177@group
178                       tools
179                         |    bit (script)
180                         +
181 +---------+-------------+------------+----------------+
182 |         |             |            |                |
183src   binutils-2.9   egcs-1.0.2  newlib-1.8.0  build-$@{CPU@}-tools
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
193                       tools
194                         |    bit (script)
195                         +
196 +---------+-------------+------------+----------------+
197 |         |             |            |                |
198src   binutils-2.9   egcs-1.0.2  newlib-1.8.0  build-${CPU}-tools
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
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
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
264
265@ifset BINUTILS-RTEMSPATCH
266Apply the patch using the following command sequence:
267
268@example
269cd tools/@value{BINUTILS-UNTAR}
270zcat arc/@value{BINUTILS-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{BINUTILS-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
284@end ifset
285
286@c
287@c  Newlib patches
288@c
289
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:
300
301@example
302cd tools/@value{NEWLIB-UNTAR}
303zcat arc/@value{NEWLIB-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{NEWLIB-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.
316
317@end ifset
318
319@c
320@c  Modify the bit script
321@c
322
323@section Modify the bit Script
324
325Copy the @code{bit} script from arc to the tools directory.
326
327Edit the @code{bit} file to alter the following environmental variables:
328
329@itemize @bullet
330@item INSTALL_POINT
331@item BINUTILS
332@item NEWLIB
333@item GCC
334@item BUILD_DOCS
335@item BUILD_OTHER_LANGUAGES
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.
353#   BUILD_OTHER_LANGUAGES:
354#                 Set to "yes" if you want to build Fortran and Objective-C
355#
356BINUTILS=@value{BINUTILS-UNTAR}
357GCC=@value{GCC-UNTAR}
358NEWLIB=@value{NEWLIB-UNTAR}
359BUILD_DOCS=yes
360BUILD_OTHER_LANGUAGES=yes
361INSTALL_POINT=/home/joel/$@{GCC@}/$@{target@}
362
363# USERCHANGE - uncomment this if you want to watch the commands.
364@end example
365
366Where each of the variables which may be modified is described below:
367
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
376is the directory under tools that contains @value{BINUTILS-UNTAR}.
377For example:
378
379@example
380BINUTILS=@value{BINUTILS-UNTAR}
381@end example
382
383@item GCC
384is the directory under tools that contains @value{GCC-UNTAR}.
385For example,
386
387@example
388GCC=@value{GCC-UNTAR}
389@end example
390
391@item NEWLIB
392is the directory under tools that contains @value{NEWLIB-UNTAR}.
393For example:
394
395@example
396NEWLIB=@value{NEWLIB-UNTAR}
397@end example
398
399@item BUILD_DOCS
400is set to "yes" if you want to install documentation.
401For example:
402
403@example
404BUILD_DOCS=yes
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.
410For example:
411
412@example
413BUILD_OTHER_LANGUAGES=yes
414@end example
415
416@end table
417
418@section Running the bit Script
419
420After the @code{bit} script has been modified to reflect the
421local installation, the modified @code{bit} script is run
422using the following sequence:
423
424@example
425cd tools
426./bit <target configuration>
427@end example
428
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
443
444If no errors are encountered, the @code{bit} script will conclude by
445printing messages similar to the following:
446
447@example
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
453@end example
454
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.
460
Note: See TracBrowser for help on using the repository browser.