source: rtems/doc/started/nt.t @ 0660b4f8

4.104.114.84.95
Last change on this file since 0660b4f8 was 0660b4f8, checked in by Joel Sherrill <joel.sherrill@…>, on 11/16/99 at 19:50:56

Changed copyright date to 1999.

  • Property mode set to 100644
File size: 9.1 KB
Line 
1@c
2@c  COPYRIGHT (c) 1988-1999.
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@set CYGWIN-FTP http://www.cygnus.com/misc/gnu-win32/
11@set CYGWIN-COOLVIEW http://www.lexa.ru/sos/
12@set DOS2UNIX-FTP ftp://ftp.micros.hensa.ac.uk/platforms/ibm-pc/ms-dos/simtelnet/txtutl/dos2unix.zip
13@set PFE-FTP http://www.lancs.ac.uk/people/cpaap/pfe/
14
15@chapter Using MS-Windows as a Development Host
16
17This chapter discusses the installation of the GNU tool chain
18on a computer running the Microsoft Windows NT operating system.
19
20This chapter is based on a draft provided by
21Geoffroy Montel <g_montel@@yahoo.com>.  Geoffroy's
22procedure was based on information from
23David Fiddes <D.J@@fiddes.surfaid.org>.
24Their input and feedback is greatly appreciated.
25
26@b{STATUS:}  This chapter should be considered preliminary.
27Please be careful when following these instructions.
28
29@section Version Information
30
31This installation process works well under Windows NT.
32Using Windows 95 or 98 is not recommended although it
33should be possible with version 3.77 of gmake and an updated
34cygwinb19.dll.
35
36This procedure should also work with newer version of
37the tool versions listed in this chapter, but this has
38not been verified.  If you have success with a particular
39version of the toolset or notice problems in this chapter,
40please let the RTEMS maintainers know so they can be
41addressed in future revisions of this document.
42
43@section MS-Windows Host Specific Requirements
44
45This section details the components required to install
46and build a Windows hosted GNU cross development toolset.
47
48@subsection Unzipping Archives
49
50You will have to uncompress many archives during this
51process.  You must @b{NOT} use @code{WinZip} or
52@code{PKZip}.  Instead the un-archiving process uses
53the GNU @code{zip} and @code{tar} programs as shown below:
54
55@example
56tar -xzvf archive.tgz
57@end example
58
59@code{tar} is provided with Cygwin32.
60
61@subsection Text Editor
62
63You absolutely have to use a text editor which can
64save files with Unix format (so don't use Notepad
65nor Wordpad). If you do not have an appropriate
66text editor, try @b{Programmers File Editor}, it is
67free and very convenient.  This editor may be downloaded
68from:
69
70@uref{@value{PFE-FTP},@value{PFE-FTP}}
71
72@subsection Bug in Patch Utility
73
74There is a bug in the @code{patch} utility
75provided in Cygwin32 B19. The files modified end up
76having MS-DOS style line termination. They must have
77Unix format, so a @code{dos2unix}-like command must
78be used to put them back into Unix format as shown below:
79
80@example
81$ dos2unix XYZ
82Dos2Unix: Cleaning file XYZ ...
83@end example
84
85The dos2unix utility may be downloaded from:
86
87@uref{@value{DOS2UNIX-FTP},@value{DOS2UNIX-FTP}}
88
89You @b{must} change the format of every patched file
90for the toolset build to work correctly.
91
92@subsection Files Needed
93
94This section lists the files required to build and install
95a Windows hosted GNU cross development toolset and their
96home WWW site.  In addition to the sources required
97for the cross environment listed earlier in @ref{Get All the Pieces},
98you will need to  download the following
99files from their respective sites using your favorite
100Web browser or ftp client.
101
102@table @b
103
104@item cdk.exe
105@uref{@value{CYGWIN-FTP},@value{CYGWIN-FTP}}
106
107@item coolview.tar.gz
108@uref{@value{CYGWIN-COOLVIEW},@value{CYGWIN-COOLVIEW}}
109
110@end table
111
112@subsection System Requirements
113
114Although the finished cross-compiler is fairly easy on resources,
115building it can take a significant amount of processing power and
116disk space. The recommended build system spec is:
117
118@enumerate
119
120@item An AMD K6-300, Pentium II-300 or better processor. GNU C and Cygwin32 are
121@b{very} CPU hungry.
122
123@item At least 64MB of RAM.
124
125@item At least 400MB of FAT16 disk space or 250MB if you have an NTFS partition.
126
127@end enumerate
128
129Even with this spec of machine expect the full suite to take over 2 hours to
130build with a further half an hour for RTEMS itself.
131
132
133@section Installing Cygwin32 B19
134
135This section describes the process of installing the
136version @value{CYGWIN-VERSION} of the Cygwin32 environment.  It assumes
137that this toolset is installed in a directory
138referred to as @code{<RTOS>}.
139
140@enumerate
141
142@item Execute cdk.exe. These instructions assume that you
143install Cygwin32 under the <RTOS>\cygnus\b19 directory.
144
145@item Execute Cygwin.bat (either on the start menu or
146under <RTOS>\cygnus\b19).
147
148@item At this point, you are at the command line of @code{bash},
149a Unix-like shell. You have to mount the "/" directory. Type:
150
151@example
152umount /
153mount -b <RTOS> /
154@end example
155
156For example, the following sequence mounts the @code{E:\unix} as the
157root directory for the Cygwin32 environment. Note the use of two @code{\}s
158when specifying DOS paths in bash:
159
160@example
161umount /
162mount -b e:\\unix /
163@end example
164
165@item Create the /bin, /tmp, /source and /build directories.
166
167@example
168mkdir /bin
169mkdir /tmp
170mkdir /source
171mkdir /build
172mkdir /build/binutils
173mkdir /build/egcs
174@end example
175
176@item The light Bourne shell provided with Cygwin B19 is buggy.
177You should copy it to a fake name and copy @code{bash.exe} to @code{sh.exe}:
178
179@example
180cd <RTOS>/cygnus/b19/H-i386-cygwin32/bin
181mv sh.exe old_sh.exe
182cp bash.exe sh.exe
183@end example
184
185The Bourne shell has to be present in /bin directory to run shell scripts properly:
186
187@example
188cp <RTOS>/cygnus/b19/H-i386-cygwin32/bin/sh.exe /bin
189cp <RTOS>/cygnus/b19/H-i386-cygwin32/bin/bash.exe /bin
190@end example
191
192
193@item Open the file
194@code{/cygnus/b19/H-i386-cygwin32/lib/gcc-lib/i386-cygwin32/2.7-b19/specs},
195and change the following line:
196
197@example
198-lcygwin %@{mwindows:-luser32 -lgdi32 -lcomdlg32@} -lkernel32
199@end example
200
201to:
202
203@example
204-lcygwin %@{mwindows:-luser32 -lgdi32 -lcomdlg32@} -lkernel32 -ladvapi32
205@end example
206
207@end enumerate
208
209At this point, you have a native installation of Cygwin32 and
210are ready to proceed to building a cross-compiler.
211
212@c
213@c  BINUTILS
214@c
215
216@section Installing binutils
217
218@enumerate
219
220@item Unarchive @value{BINUTILS-TAR} following the
221instructions in @ref{Unarchiving the Tools} into the /source directory.
222Apply the appropriate RTEMS specific patch as detailed in
223@ref{Apply RTEMS Patch to binutils}.
224
225@item In the @code{/build/binutils} directory, execute the following
226command to configure @value{BINUTILS-VERSION}:
227
228@example
229/source/@value{BINUTILS-UNTAR}/configure --verbose --target=m68k-rtems \
230    --prefix=/gcc-m68k-rtems --with-gnu-as --with-gnu-ld
231@end example
232
233Replace @code{m68k-rtems} with the target configuration
234of your choice.  See @ref{Running the bit Script} for a
235list of the targets available.
236
237@item Execute the following command to compile the toolset:
238
239@example
240make
241@end example
242
243@item Install the full package with the following command:
244
245@example
246make -k install
247@end example
248
249There is a problem with the gnu info package which will cause an
250error during installation. Telling make to keep going with -k allows
251the install to complete.
252
253@item In the @code{cygnus.bat} file, add the directory
254containing the cross-compiler executables to your search path
255by inserting the following line:
256
257@example
258PATH=E:\unix\gcc-m68k-rtems\bin;%PATH%
259@end example
260
261@item You can erase the /build/binutils directory content if
262disk space is tight.
263
264@item Exit bash and run @code{cygnus.bat} to restart
265the Cygwin32 environment with the new path.
266
267@end enumerate
268
269@c
270@c  EGCS
271@c
272
273@section Installing EGCS AND NEWLIB
274
275@enumerate
276@item Unarchive and patch @value{EGCS-TAR} and @value{NEWLIB-TAR}
277following the instructions in @ref{Unarchiving the Tools}.
278Apply the appropriate RTEMS specific patches as detailed in
279@ref{Apply RTEMS Patch to EGCS} and @ref{Apply RTEMS Patch to newlib}.
280
281@b{NOTE}: See @ref{Bug in Patch Utility}.
282
283@item Remove the following directories (we cannot use Fortran
284or Objective-C as Cygwin32 cross-compilers):
285
286@example
287/source/@value{GCC-UNTAR}/libf2c
288/source/@value{GCC-UNTAR}/gcc/objc
289/source/@value{GCC-UNTAR}/gcc/f
290@end example
291
292@b{NOTE}: See @ref{Bug in Patch Utility}.
293
294@item Link the following directories from Newlib to the main EGCS directory,
295/source/@value{GCC-UNTAR}/ :
296
297@itemize @bullet
298@item ln -s ../@value{NEWLIB-UNTAR}/newlib newlib
299@item ln -s ../@value{NEWLIB-UNTAR}/libgloss libgloss
300@end itemize
301
302@item Change to the /build/egcs directory to configure the compiler:
303
304@example
305/source/@value{GCC-UNTAR}/configure --verbose --target=m68k-rtems \
306    --prefix=/gcc-m68k --with-gnu-as --with-gnu-ld \
307    --with-newlib
308@end example
309
310Replace @code{m68k-rtems} with the target configuration
311of your choice.  See @ref{Running the bit Script} for a
312list of the targets available.
313
314@item Compile the toolset as follows:
315
316@example
317make cross
318@end example
319
320You must do a @code{make cross} (not a simple @code{make})
321to insure that the different packages are built in the correct
322order.   Making the compiler can take several hours even on
323fairly fast machines, beware.
324
325@item Install with the following command:
326
327@example
328make -k install
329@end example
330
331@item Just as with binutils package, a problem with the gnu
332info package not building correctly requires that you use -k to
333keep going.
334
335@example
336make -k install
337@end example
338
339@end enumerate
340
341With any luck, at this point you having a working cross-compiler.  So
342as Geoffroy said:
343
344@center @b{That's it! Celebrate!}
345
Note: See TracBrowser for help on using the repository browser.