source: rtems/doc/started/nt.t @ 0df2ab87

4.104.114.84.95
Last change on this file since 0df2ab87 was 0df2ab87, checked in by Joel Sherrill <joel.sherrill@…>, on 04/13/98 at 19:42:55

Now builds for all formats.

Updated to include Steve's figures for the first time.

  • Property mode set to 100644
File size: 8.7 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@set CYGWIN-VERSION B19
10
11@chapter Using MS-Windows as a Development Host
12
13This chapter discusses the installation of the GNU tool chain
14on a computer running either the Microsoft Windows95
15or WindowsNT operating system.
16
17This chapter is based on a draft provided by
18Geoffroy Montel <g_montel@@yahoo.com>.  Geoffroy's
19procedure was based on information from
20David Fiddes <D.J.Fiddes@@hw.ac.uk>.
21Their input and feedback is greatly appreciated.
22
23@b{STATUS:}  This chapter should be considered preliminary.
24Please be careful when following these instructions.
25
26@section Version Information
27
28This installation process works well under Windows NT.
29It is said to also work under Windows95 (although it
30did not work with B18). Anyway, the resulting code works
31under both NT and 95.
32
33This procedure should also work with newer version of
34the tool versions listed in this chapter, but this has
35not been verified.  If you have success with a particular
36version of the toolset or notice problems in this chapter,
37please let the RTEMS maintainers know so they can be
38addressed in future revisions of this document.
39
40@section MS-Windows Host Specific Requirements
41
42This section details the components required to install
43and build a Windows hosted GNU cross development toolset.
44
45@subsection Unzipping Archives
46
47You will have to uncompress many archives during this
48process.  You must @b{NOT} use @code{WinZip} or
49@code{PKZip}.  Instead the un-achiving process uses
50the GNU @code{zip} and @code{tar} programs as shown below:
51
52@example
53tar -xzvf archive.gzip
54@end example
55
56XXX Is tar provided with Cygwin32?  If not, recommend a url.
57
58@subsection Text Editor
59
60You absolutely have to use a text editor which can
61save files with Unix format (so don't use Notepad
62nor Wordpad). If you do not have an appropriate
63text editor, try @b{Programmers File Editor}, it is
64free and very convenient (see
65http://www.lancs.ac.uk/people/cpaap/pfe/).
66
67@subsection Bug in Patch Utility
68
69There is a bug in the @code{patch} utility
70provided in Cygwin32 B19. The files modified end up
71having MS-DOS style line termination. They must have
72Unix format, so a @code{dos2unix}-like command must
73be used to put them back into Unix format as shown below:
74
75@example
76dos2unix XXX
77@end example
78
79@subsection Files Needed
80
81This section lists the files required to build and install
82a Windows hosted GNU cross development toolset and their
83home WWW site.  In addition to the sources required
84for the cross environment listed earlier in @ref{Get All the Pieces},
85you will need to  download the following
86files from their respective sites using your favorite
87Web browser or ftp client.
88
89@table @b
90
91@item cdk.exe
92http://www.cygnus.com/misc/gnu-win32
93
94@item usertools.exe
95http://www.cygnus.com/misc/gnu-win32
96
97@end table
98
99@section Installing Cygwin32 B19
100
101This section describes the process of installing the
102version @value{CYGWIN-VERSION} of the Cygwin32 environment.  It assumes
103that this toolset is installed in a directory
104referred to as @code{<RTOS>}.
105
106@enumerate
107
108@item Execute cdk.exe. These instructions assume that you
109install Cygwin32 under the <RTOS>\GnuWin32\b19 directory.
110
111@item Execute usertools.exe.  These instructions assume that you
112install Cygwin32 under the <RTOS>\GnuWin32\b19 directory.
113
114@item Execute Cygwin.bat (either on the start menu or
115under <RTOS>\GnuWin32\b19).
116
117@item At this point, you are at the command line of @code{bash},
118a Unix-like shell. You have to mount the "/" directory. Type:
119
120@example
121umount /
122mount -b <RTOS> /
123@end example
124
125For example, the following sequence creates an MS-DOS virtual
126drive @code{O:} using an MS-DOS command window and then mounts
127that virtual drive as the root directory for the Cygwin32 environment:
128
129@example
130subst o: <RTOS>
131umount /
132mount -b o: /
133@end example
134
135@item Create the /bin, /tmp, /build and /usr directories.
136
137@example
138mkdir /bin
139mkdir /tmp
140mkdir /build
141mkdir /usr
142@end example
143
144@item Copy "sh.exe" in /bin. @b{XXX to where, WHY?}
145
146@item Open the file
147@code{/gnuwin32/b19/H-i386-cygwin32/lib/gcc-lib/i386-cygwin32/2.7-b19/specs},
148and change the following line:
149
150@example
151-lcygwin %@{mwindows:-luser32 -lgdi32 -lcomdlg32@} -lkernel32
152@end example
153
154to:
155
156@example
157-lcygwin %@{mwindows:-luser32 -lgdi32 -lcomdlg32@} -lkernel32 -ladvapi32
158@end example
159
160@end enumerate
161
162At this point, you have a native installation of Cygwin32 and
163are ready to proceed to building a cross-compiler.
164
165@c
166@c  BINUTILS
167@c
168
169@section Installing binutils
170
171@enumerate
172
173@item Unarchive @value{BINUTILS-TAR} following the
174instructions in @ref{Unarchiving the Tools}.   Apply the
175appropriate RTEMS specific patch as detailed in
176@ref{Apply RTEMS Patch to binutils}.
177
178@b{NOTE}: See @ref{Bug in Patch Utility}.
179
180@item In the @code{/build} directory, execute the following
181command to configure @value{BINUTILS-VERSION}:
182
183@example
184@value{BINUTILS-UNTAR}/configure --verbose --target=m68k-rtems \
185    --prefix=/gcc-m68k-rtems --with-gnu-as \
186    --with-gnu-ld --with-targets=all --with-newlib
187@end example
188
189Replace @code{m68k-rtems} with the target configuration
190of your choice.  See @ref{Running the bit Script} for a
191list of the targets available.
192
193@item Execute the following command to compile the toolset:
194
195@example
196make
197@end example
198
199@item With B19, an error will occur. Remove the ".exe" suffix
200from the tools by finding them all and renaming them
201as shown below:
202
203@example
204find . -name *.exe -print
205mv XXX/gas.exe XXX/gas
206       ....
207@end example
208
209@item Install the full package with the following command:
210
211@example
212make install
213@end example
214
215@item There is a problem with the gnu info package
216which may prevent it from building correctly.  To
217get around this try again with:
218
219@example
220make -k install
221@end example
222
223@item Once the executables are installed,
224you can restore the ".exe" suffix to the files in
225the @code{/gcc-m68k-rtems/bin} and
226@code{/gcc-m68k-rtems/m68k-rtems/bin} directories again.
227
228@item In the @code{cygnus.bat} file, add the directory
229to the cross-compiler executables to your search path
230by adding the following line:
231
232@example
233PATH=\gcc-m68k-rtems\bin;%PATH%
234@end example
235
236@item You can erase the /build directory content.
237
238@item Exit bash and run @code{cygnus.bat} to restart
239the Cygwin32 environment.
240
241@end enumerate
242
243@c
244@c  EGCS
245@c
246
247@section Installing EGCS AND NEWLIB
248
249@enumerate
250@item Unarchive and patch @value{EGCS-TAR} and @value{NEWLIB-TAR}
251following the instructions in @ref{Unarchiving the Tools}.
252Apply the appropriate RTEMS specific patches as detailed in
253@ref{Apply RTEMS Patch to EGCS} and @ref{Apply RTEMS Patch to newlib}.
254
255@b{NOTE}: See @ref{Bug in Patch Utility}.
256
257@item Remove the following directories (we do not need Fortran
258or Objective-C):
259
260@example
261· /build/@value{GCC-UNTAR}/libf2c
262· /build/@value{GCC-UNTAR}/gcc/objc
263· /build/@value{GCC-UNTAR}/gcc/f
264@end example
265
266@b{NOTE}: See @ref{Bug in Patch Utility}.
267
268@item Copy to /build/@value{GCC-UNTAR}/ the following directories:
269
270@itemize @bullet
271@item /build/@value{NEWLIB-UNTAR}/newlib
272@item /build/@value{NEWLIB-UNTAR}/libgloss
273@end itemize
274
275@item Go under /build directory and run:
276
277@example
278../@value{GCC-UNTAR}/configure --verbose --target=m68k-rtems \
279    --prefix=/gcc-m68k --with-gnu-as --with-gnu-ld \
280    --with-targets=all --with-newlib
281@end example
282
283Replace @code{m68k-rtems} with the target configuration
284of your choice.  See @ref{Running the bit Script} for a
285list of the targets available.
286
287@item Then run your favourite Unix format compaatible file editor,
288and edit /build/@value{GCC-UNTAR}/gcc/Makefile
289Search for the section:
290
291@example
292# libgcc1-test target (must also be overridable for a target)
293LIBGCC1_TEST = libgcc1-test
294@end example
295
296and change it to read:
297
298@example
299LIBGCC1_TEST =
300@end example
301
302@item Search for the section:
303
304@example
305# Set this to `ld' to enable use of collect2.
306USE_COLLECT2 =
307MAYBE_USE_COLLECT2 =
308# It is convenient for configure to add the assignment at the beginning,
309# so don't override it here.
310USE_COLLECT2 = ld
311@end example
312
313and change it to read:
314
315@example
316USE_COLLECT2 =
317@end example
318
319This changes are needed due to a @code{collect2} problem in B19.
320
321@item Compile the toolset as follows:
322
323@example
324make cross
325@end example
326
327You must do a @code{make cross} (not a simple @code{make})
328to insure that the different packages are built in the correct
329order.   This command could take a long time to run depending on
330the speed of the computer you are using.
331
332@item Install with the following command:
333
334@example
335make -k install
336@end example
337
338@item Just as with binutils package, a problem with the gnu
339info package not building correctly may occur, so try again with:
340
341@example
342make -k install
343@end example
344
345@end enumerate
346
347With any luck, at this point you having a working cross-compiler.  So
348as Geoffroy said:
349
350@center @b{That's it! Celebrate!}
351
Note: See TracBrowser for help on using the repository browser.