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 | |
---|
11 | @section Get all the pieces |
---|
12 | |
---|
13 | The tree structure in the figure below is assumed to be present in the |
---|
14 | following discussions: |
---|
15 | |
---|
16 | Gather the components that will be required for the installation and place |
---|
17 | them in an archive directory. Call this directory arc. Be sure that there |
---|
18 | is sufficient space to hold all necessary information. This will amount to |
---|
19 | approximately 20 megabytes. |
---|
20 | |
---|
21 | @example |
---|
22 | egcs 1.0.2 |
---|
23 | FTP Site: egcs.cygnus.com |
---|
24 | Directory: /pub/egcs/releases/egcs-1.0.2 |
---|
25 | File: egcs-1.0.2-980309-prerelease.tar.gz |
---|
26 | |
---|
27 | binutils 2.8.1 |
---|
28 | FTP Site: ftp.gnu.org |
---|
29 | Directory: /pub/gnu |
---|
30 | File: binutils-2.8.1.tar.gz |
---|
31 | |
---|
32 | newlib 1.8.0 |
---|
33 | FTP Site: ftp.cygnus.com |
---|
34 | Directory: /pub/newlib |
---|
35 | File: newlib-1.8.0.tar.gz |
---|
36 | |
---|
37 | RTEMS @value{version} |
---|
38 | FTP Site: ftp.oarcorp.com |
---|
39 | Directory: /oarcorp/private/snapshots |
---|
40 | File: rtems-980219.tgz |
---|
41 | File: bit |
---|
42 | File: binutils-2.8.1-rtems-diff-971221.gz |
---|
43 | File: newlib-1.8.0-diff.980120.gz |
---|
44 | File: simple_app.tgz |
---|
45 | @end example |
---|
46 | |
---|
47 | |
---|
48 | @section Create the tools directory |
---|
49 | |
---|
50 | Create a directory called tools that will serve as a working directory to |
---|
51 | perform the build of the cross compiler tools. |
---|
52 | |
---|
53 | Unpack the compressed tar files using the following command sequence: |
---|
54 | |
---|
55 | @example |
---|
56 | cd tools |
---|
57 | tar xzf ../arc/egcs-1.0.2-980309-prerelease.tar.gz |
---|
58 | tar xzf ../arc/binutls-2.8.1.tar.gz |
---|
59 | tar xzf ../arc/newlib-1.8.0.tar.gz |
---|
60 | @end example |
---|
61 | |
---|
62 | After the compressed tar files have been unpacked, the following |
---|
63 | directories will have been created under tools. |
---|
64 | |
---|
65 | @itemize @bullet |
---|
66 | @item binutils-2.8.1 |
---|
67 | @item egcs-1.0.2 |
---|
68 | @item newlib-1.8.0 |
---|
69 | @end itemize |
---|
70 | |
---|
71 | @section Apply patches for newlib |
---|
72 | |
---|
73 | Apply the patches using the following command sequence: |
---|
74 | |
---|
75 | @example |
---|
76 | cd tools/newlib-1.8.0 |
---|
77 | zcat arc/newlib-1.8.0-diff.980120.gz|patch -p1 |
---|
78 | @end example |
---|
79 | |
---|
80 | Check to see if any of these patches have been rejected using the following |
---|
81 | sequence: |
---|
82 | |
---|
83 | @example |
---|
84 | cd tools/newlib-1.8.0 |
---|
85 | find . -name "*.rej" -print |
---|
86 | @end example |
---|
87 | |
---|
88 | If any files are found with the .rej extension, a patch has been rejected. |
---|
89 | This should not happen with a good patch file. |
---|
90 | |
---|
91 | To see the files that have been modified use the sequence: |
---|
92 | |
---|
93 | @example |
---|
94 | cd tools/newlib-1.8.0 |
---|
95 | find . -name "*.orig" -print |
---|
96 | @end example |
---|
97 | |
---|
98 | The files that are found, have been modified by the patch file. |
---|
99 | |
---|
100 | |
---|
101 | @section Apply patches for binutils |
---|
102 | |
---|
103 | Apply the patches using the following command sequence: |
---|
104 | |
---|
105 | @example |
---|
106 | cd tools/binutils-2.8.1 |
---|
107 | zcat arc/binutils-2.8.1-rtems-diff-971221.gz|patch -p1 |
---|
108 | @end example |
---|
109 | |
---|
110 | Check to see if any of these patches have been rejected using the following |
---|
111 | sequence: |
---|
112 | |
---|
113 | @example |
---|
114 | cd tools/binutils-2.8.1 |
---|
115 | find . -name "*.rej" -print |
---|
116 | @end example |
---|
117 | |
---|
118 | If any files are found with the .rej extension, a patch has been rejected. |
---|
119 | This should not happen with a good patch file. |
---|
120 | |
---|
121 | To see the files that have been modified use the sequence: |
---|
122 | |
---|
123 | @example |
---|
124 | cd tools/binutils-2.8.1 |
---|
125 | find . -name "*.orig" -print |
---|
126 | @end example |
---|
127 | |
---|
128 | The files that are found, have been modified by the patch file. |
---|
129 | |
---|
130 | @section Modify the bit script |
---|
131 | |
---|
132 | Copy the bit file from arc to the tools directory. |
---|
133 | |
---|
134 | Edit the bit file to alter the following environmental variables: |
---|
135 | |
---|
136 | @itemize @bullet |
---|
137 | @item INSTALL_POINT |
---|
138 | @item BINUTILS |
---|
139 | @item NEWLIB |
---|
140 | @item GCC |
---|
141 | @item BUILD_DOCS |
---|
142 | @end itemize |
---|
143 | |
---|
144 | These variables are located in the script section that resembles the |
---|
145 | extract below: |
---|
146 | |
---|
147 | |
---|
148 | @example |
---|
149 | # USERCHANGE -- localize these. |
---|
150 | # |
---|
151 | # INSTALL_POINT: Directory tools are installed into. |
---|
152 | # Recommended installation point for various OS's: |
---|
153 | # Linux: /usr/local/rtems |
---|
154 | # Solaris: /opt/gnu/rtems |
---|
155 | # BINUTILS: Binutils source directory |
---|
156 | # NEWLIB: Newlib source directory |
---|
157 | # GCC: Newlib source directory |
---|
158 | # BUILD_DOCS: Set to "yes" if you want to install documentation. |
---|
159 | # |
---|
160 | BINUTILS=gas-971208 |
---|
161 | GCC=egcs-1.0.1 |
---|
162 | NEWLIB=newlib-1.8.0 |
---|
163 | BUILD_DOCS=yes |
---|
164 | INSTALL_POINT=/home/joel/$@{GCC@}/$@{target@} |
---|
165 | |
---|
166 | # USERCHANGE - uncomment this if you want to watch the commands. |
---|
167 | @end example |
---|
168 | |
---|
169 | |
---|
170 | Where: |
---|
171 | |
---|
172 | @table @code |
---|
173 | @item INSTALL_POINT |
---|
174 | is the location where you wish the GNU C/C++ cross compilation tools for |
---|
175 | RTEMS to be built. It is recommended that the directory chosen to receive |
---|
176 | these tools be named so that it is clear from which egcs distribution it |
---|
177 | was generated and for which target system the tools are to produce code for. |
---|
178 | |
---|
179 | @item BINUTILS |
---|
180 | is the directory under tools that contains binutils-2.8.1. |
---|
181 | BINUTILS=binutils-2.8.1 |
---|
182 | |
---|
183 | @item GCC |
---|
184 | is the directory under tools that contains egcs-1.0.1. |
---|
185 | GCC=egcs-1.0.2-980309-prerelease |
---|
186 | |
---|
187 | @item NEWLIB |
---|
188 | is the directory under tools that contains newlib-1.8.0. |
---|
189 | NEWLIB=newlib-1.8.0 |
---|
190 | |
---|
191 | @item BUILD_DOCS |
---|
192 | is set to "yes" if you want to install documentation. |
---|
193 | BUILD_DOCS=yes |
---|
194 | |
---|
195 | @end table |
---|
196 | |
---|
197 | @section Running the bit script |
---|
198 | |
---|
199 | Run the modified bit script using the following sequence: |
---|
200 | |
---|
201 | @example |
---|
202 | cd tools |
---|
203 | ./bit <target configuration> |
---|
204 | @end example |
---|
205 | |
---|
206 | Where: |
---|
207 | |
---|
208 | <target configuration> is one of the following: |
---|
209 | |
---|
210 | @example |
---|
211 | hppa1.1 |
---|
212 | i386 |
---|
213 | i386-elf |
---|
214 | i386-go32 |
---|
215 | i960 |
---|
216 | m68k |
---|
217 | mips64orion |
---|
218 | powerpc |
---|
219 | sh |
---|
220 | sparc |
---|
221 | @end example |
---|
222 | |
---|
223 | @section GNU C/C++ cross compiler toolset complete |
---|
224 | |
---|
225 | At this point the GNU C/C++ cross compile tools should be built. |
---|
226 | |
---|