summaryrefslogtreecommitdiffstats
path: root/doc/started/buildc.t
blob: f5aa5f42987a3521b142808b03c3bcbc3eb38bea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
@c
@c  COPYRIGHT (c) 1988-1998.
@c  On-Line Applications Research Corporation (OAR).
@c  All rights reserved.
@c
@c  $Id$
@c

@chapter Building the GNU C/C++ Cross Compiler Toolset

@section Get all the pieces 

The tree structure in the figure below is assumed to be present in the
following discussions: 

Gather the components that will be required for the installation and place
them in an archive directory. Call this directory arc. Be sure that there
is sufficient space to hold all necessary information. This will amount to
approximately 20 megabytes. 

@example
egcs 1.0.2
    FTP Site:    egcs.cygnus.com
    Directory:   /pub/egcs/releases/egcs-1.0.2
    File:        egcs-1.0.2-980309-prerelease.tar.gz 

binutils 2.8.1
    FTP Site:    ftp.gnu.org
    Directory:   /pub/gnu
    File:        binutils-2.8.1.tar.gz

newlib 1.8.0
    FTP Site:    ftp.cygnus.com
    Directory:   /pub/newlib
    File:        newlib-1.8.0.tar.gz

RTEMS @value{version}
FTP Site:        ftp.oarcorp.com
    Directory:   /oarcorp/private/snapshots
    File:        rtems-980219.tgz
    File:        bit
    File:        binutils-2.8.1-rtems-diff-971221.gz
    File:        newlib-1.8.0-diff.980120.gz
    File:        simple_app.tgz
@end example


@section Create the tools directory

Create a directory called tools that will serve as a working directory to
perform the build of the cross compiler tools.

Unpack the compressed tar files using the following command sequence: 

@example
cd tools
tar xzf ../arc/egcs-1.0.2-980309-prerelease.tar.gz
tar xzf ../arc/binutls-2.8.1.tar.gz
tar xzf ../arc/newlib-1.8.0.tar.gz
@end example

After the compressed tar files have been unpacked, the following
directories will have been created under tools. 

@itemize @bullet
@item binutils-2.8.1
@item egcs-1.0.2
@item newlib-1.8.0
@end itemize

@section Apply patches for newlib

Apply the patches using the following command sequence:

@example
cd tools/newlib-1.8.0
zcat arc/newlib-1.8.0-diff.980120.gz|patch -p1
@end example

Check to see if any of these patches have been rejected using the following
sequence: 

@example
cd tools/newlib-1.8.0
find . -name "*.rej" -print
@end example

If any files are found with the .rej extension, a patch has been rejected.
This should not happen with a good patch file. 

To see the files that have been modified use the sequence:

@example
cd tools/newlib-1.8.0
find . -name "*.orig" -print
@end example

The files that are found, have been modified by the patch file. 


@section Apply patches for binutils

Apply the patches using the following command sequence:

@example
cd tools/binutils-2.8.1
zcat arc/binutils-2.8.1-rtems-diff-971221.gz|patch -p1
@end example

Check to see if any of these patches have been rejected using the following
sequence: 

@example
cd tools/binutils-2.8.1
find . -name "*.rej" -print
@end example

If any files are found with the .rej extension, a patch has been rejected.
This should not happen with a good patch file. 

To see the files that have been modified use the sequence:

@example
cd tools/binutils-2.8.1
find . -name "*.orig" -print
@end example

The files that are found, have been modified by the patch file. 

@section Modify the bit script

Copy the bit file from arc to the tools directory.

Edit the bit file to alter the following environmental variables:

@itemize @bullet
@item INSTALL_POINT
@item BINUTILS
@item NEWLIB
@item GCC
@item BUILD_DOCS
@end itemize

These variables are located in the script section that resembles the
extract below: 


@example
# USERCHANGE -- localize these.
#
#  INSTALL_POINT: Directory tools are installed into.
#      Recommended installation point for various OS's:
#         Linux:    /usr/local/rtems
#         Solaris:  /opt/gnu/rtems
#   BINUTILS:     Binutils source directory
#   NEWLIB:       Newlib source directory
#   GCC:          Newlib source directory
#   BUILD_DOCS:   Set to "yes" if you want to install documentation.
#
BINUTILS=gas-971208
GCC=egcs-1.0.1
NEWLIB=newlib-1.8.0
BUILD_DOCS=yes
INSTALL_POINT=/home/joel/$@{GCC@}/$@{target@}

# USERCHANGE - uncomment this if you want to watch the commands.
@end example


Where:

@table @code
@item INSTALL_POINT
is the location where you wish the GNU C/C++ cross compilation tools for
RTEMS to be built. It is recommended that the directory chosen to receive
these tools be named so that it is clear from which egcs distribution it
was generated and for which target system the tools are to produce code for.

@item BINUTILS
is the directory under tools that contains binutils-2.8.1. 
BINUTILS=binutils-2.8.1

@item GCC
is the directory under tools that contains egcs-1.0.1. 
GCC=egcs-1.0.2-980309-prerelease

@item NEWLIB
is the directory under tools that contains newlib-1.8.0.
NEWLIB=newlib-1.8.0

@item BUILD_DOCS
is set to "yes" if you want to install documentation.
BUILD_DOCS=yes

@end table

@section Running the bit script

Run the modified bit script using the following sequence:

@example
cd tools
./bit <target configuration>
@end example

Where:

<target configuration> is one of the following:

@example
hppa1.1
i386
i386-elf
i386-go32
i960
m68k
mips64orion
powerpc
sh
sparc
@end example

@section GNU C/C++ cross compiler toolset complete
 
At this point the GNU C/C++ cross compile tools should be built.