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

4.104.114.84.95
Last change on this file since bdec2709 was bdec2709, checked in by Joel Sherrill <joel.sherrill@…>, on 04/10/98 at 16:03:26

In texinfo nicely with all version dependent information
now in variables and some updates already in place.

  • Property mode set to 100644
File size: 8.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 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 Get all the pieces
17
18The tree structure in the figure below is assumed to be present in the
19following discussions:
20
21@center @b{XXX directory tree figure goes here}
22
23Gather the components that will be required for the installation and place
24them in an archive directory. Call this directory arc. Be sure that there
25is sufficient space to hold all necessary information. This will amount to
26approximately 20 megabytes.
27
28@subheading @value{GCC-VERSION}
29@example
30    FTP Site:    @value{GCC-FTPSITE}
31    Directory:   @value{GCC-FTPDIR}
32    File:        @value{GCC-TAR}
33@end example
34
35@subheading @value{BINUTILS-VERSION}
36@example
37    FTP Site:    @value{BINUTILS-FTPSITE}
38    Directory:   @value{BINUTILS-FTPDIR}
39    File:        @value{BINUTILS-TAR}
40@end example
41
42@subheading @value{NEWLIB-VERSION}
43@example
44    FTP Site:    @value{NEWLIB-FTPSITE}
45    Directory:   @value{NEWLIB-FTPDIR}
46    File:        @value{NEWLIB-TAR}
47@end example
48
49@subheading @value{RTEMS-VERSION}
50@example
51    FTP Site:    @value{RTEMS-FTPSITE}
52    Directory:   @value{RTEMS-FTPDIR}
53    File:        @value{RTEMS-TAR}
54    File:        bit
55    File:        @value{BINUTILS-RTEMSPATCH}
56    File:        @value{NEWLIB-RTEMSPATCH}
57    File:        @value{GCC-RTEMSPATCH}
58    File:        hello_world_c.tgz
59@end example
60
61
62@section Create the tools directory
63
64Create a directory called tools that will serve as a working directory to
65perform the build of the cross compiler tools.
66
67Unpack the compressed tar files using the following command sequence:
68
69@example
70cd tools
71tar xzf ../arc/@value{GCC-TAR}
72tar xzf ../arc/@value{BINUTILS-TAR}
73tar xzf ../arc/@value{NEWLIB-TAR}
74@end example
75
76After the compressed tar files have been unpacked, the following
77directories will have been created under tools.
78
79@itemize @bullet
80@item @value{BINUTILS-UNTAR}
81@item @value{GCC-UNTAR}
82@item @value{NEWLIB-UNTAR}
83@end itemize
84
85@c
86@c  EGCS patches
87@c
88
89@section Apply RTEMS Patch to EGCS
90
91@ifclear GCC-RTEMSPATCH
92No RTEMS specific patches are required for @value{GCC-VERSION} to
93support @value{RTEMS-VERSION}.
94@end ifclear
95
96@ifset GCC-RTEMSPATCH
97
98Apply the patch using the following command sequence:
99
100@example
101cd tools/@value{GCC-UNTAR}
102zcat arc/@value{GCC-RTEMSPATCH} | patch -p1
103@end example
104
105Check to see if any of these patches have been rejected using the following
106sequence:
107
108@example
109cd tools/@value{GCC-UNTAR}
110find . -name "*.rej" -print
111@end example
112
113If any files are found with the .rej extension, a patch has been rejected.
114This should not happen with a good patch file.
115
116To see the files that have been modified use the sequence:
117
118@example
119cd tools/@value{GCC-UNTAR}
120find . -name "*.orig" -print
121@end example
122
123The files that are found, have been modified by the patch file.
124
125@end ifset
126
127@c
128@c  BINUTILS patches
129@c
130
131@section Apply RTEMS Patch to binutils
132
133@ifclear BINUTILS-RTEMSPATCH
134No RTEMS specific patches are required for @value{BINUTILS-VERSION} to
135support @value{RTEMS-VERSION}.
136@end ifclear
137
138@ifset BINUTILS-RTEMSPATCH
139Apply the patch using the following command sequence:
140
141@example
142cd tools/@value{BINUTILS-UNTAR}
143zcat arc/@value{BINUTILS-RTEMSPATCH} | patch -p1
144@end example
145
146Check to see if any of these patches have been rejected using the following
147sequence:
148
149@example
150cd tools/@value{BINUTILS-UNTAR}
151find . -name "*.rej" -print
152@end example
153
154If any files are found with the .rej extension, a patch has been rejected.
155This should not happen with a good patch file.
156
157To see the files that have been modified use the sequence:
158
159@example
160cd tools/@value{BINUTILS-UNTAR}
161find . -name "*.orig" -print
162@end example
163
164The files that are found, have been modified by the patch file.
165
166@end ifset
167
168@c
169@c  Newlib patches
170@c
171
172@section Apply RTEMS Patch to newlib
173
174@ifclear NEWLIB-RTEMSPATCH
175No RTEMS specific patches are required for @value{NEWLIB-VERSION} to
176support @value{RTEMS-VERSION}.
177@end ifclear
178
179@ifset NEWLIB-RTEMSPATCH
180
181Apply the patch using the following command sequence:
182
183@example
184cd tools/@value{NEWLIB-UNTAR}
185zcat arc/@value{NEWLIB-RTEMSPATCH} | patch -p1
186@end example
187
188Check to see if any of these patches have been rejected using the following
189sequence:
190
191@example
192cd tools/@value{NEWLIB-UNTAR}
193find . -name "*.rej" -print
194@end example
195
196If any files are found with the .rej extension, a patch has been rejected.
197This should not happen with a good patch file.
198
199To see the files that have been modified use the sequence:
200
201@example
202cd tools/@value{NEWLIB-UNTAR}
203find . -name "*.orig" -print
204@end example
205
206The files that are found, have been modified by the patch file.
207
208@end ifset
209
210@c
211@c  Modify the bit script
212@c
213
214@section Modify the bit script
215
216Copy the @code{bit} script from arc to the tools directory.
217
218Edit the @code{bit} file to alter the following environmental variables:
219
220@itemize @bullet
221@item INSTALL_POINT
222@item BINUTILS
223@item NEWLIB
224@item GCC
225@item BUILD_DOCS
226@item BUILD_OTHER_LANGUAGES
227@end itemize
228
229These variables are located in the script section that resembles the
230extract below:
231
232
233@example
234# USERCHANGE -- localize these.
235#
236#  INSTALL_POINT: Directory tools are installed into.
237#      Recommended installation point for various OS's:
238#         Linux:    /usr/local/rtems
239#         Solaris:  /opt/gnu/rtems
240#   BINUTILS:     Binutils source directory
241#   NEWLIB:       Newlib source directory
242#   GCC:          Newlib source directory
243#   BUILD_DOCS:   Set to "yes" if you want to install documentation.
244#   BUILD_OTHER_LANGUAGES:
245#                 Set to "yes" if you want to build Fortran and Objective-C
246#
247BINUTILS=@value{BINUTILS-UNTAR}
248GCC=@value{GCC-UNTAR}
249NEWLIB=@value{NEWLIB-UNTAR}
250BUILD_DOCS=yes
251BUILD_OTHER_LANGUAGES=yes
252INSTALL_POINT=/home/joel/$@{GCC@}/$@{target@}
253
254# USERCHANGE - uncomment this if you want to watch the commands.
255@end example
256
257Where each of the variables which may be modified is described below:
258
259@table @code
260@item INSTALL_POINT
261is the location where you wish the GNU C/C++ cross compilation tools for
262RTEMS to be built. It is recommended that the directory chosen to receive
263these tools be named so that it is clear from which egcs distribution it
264was generated and for which target system the tools are to produce code for.
265
266@item BINUTILS
267is the directory under tools that contains @value{BINUTILS-UNTAR}.
268For example,
269
270@example
271BINUTILS=@value{BINUTILS-UNTAR}.
272@end example
273
274@item GCC
275is the directory under tools that contains @value{GCC-UNTAR}.
276For example,
277
278@example
279GCC=@value{GCC-UNTAR}.
280@end example
281
282@item NEWLIB
283is the directory under tools that contains @value{NEWLIB-UNTAR}.
284For example,
285
286@example
287NEWLIB=@value{NEWLIB-UNTAR}.
288@end example
289
290@item BUILD_DOCS
291is set to "yes" if you want to install documentation.
292For example,
293
294@example
295BUILD_DOCS=yes
296@end example
297
298@item BUILD_OTHER_LANGUAGES
299is set to "yes" if you want to build languages other than C and C++.  At
300the current time, this enables Fortan and Objective-C.
301For example,
302
303@example
304BUILD_OTHER_LANGUAGES=yes
305@end example
306
307@end table
308
309@section Running the bit script
310
311After the @code{bit} script has been modified to reflect the
312local installation, the modified @code{bit} script is run
313using the following sequence:
314
315@example
316cd tools
317./bit <target configuration>
318@end example
319
320Where <target configuration> is one of the following:
321
322@itemize @bullet
323@item hppa1.1
324@item i386
325@item i386-elf
326@item i386-go32
327@item i960
328@item m68k
329@item mips64orion
330@item powerpc
331@item sh
332@item sparc
333@end itemize
334
335If no errors are encountered, the @code{bit} script will conclude by
336printing messages similar to the following:
337
338@example
339
340The src and build-i386-tools subdirectory may now be removed.
341
342Started:  Fri Apr 10 10:14:07 CDT 1998
343Finished: Fri Apr 10 12:01:33 CDT 1998
344@end example
345
346If the @code{bit} script successfully completes, then the
347GNU C/C++ cross compilation tools are installed.
348
349If the @code{bit} script does not successfully complete, then investigation
350will be required to determine the source of the error.
351
Note: See TracBrowser for help on using the repository browser.