source: rtems/doc/started/nt.t @ ecbba5fc

4.104.114.84.95
Last change on this file since ecbba5fc was b4bbd1e, checked in by Joel Sherrill <joel.sherrill@…>, on 10/27/98 at 23:34:52

fixes from David Fiddes

  • Property mode set to 100644
File size: 9.4 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@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@ifset use-html
71@href{@value{PFE-FTP},,@value{PFE-FTP}}
72@end ifset
73@ifclear use-html
74@value{PFE-FTP}
75@end ifclear
76
77@subsection Bug in Patch Utility
78
79There is a bug in the @code{patch} utility
80provided in Cygwin32 B19. The files modified end up
81having MS-DOS style line termination. They must have
82Unix format, so a @code{dos2unix}-like command must
83be used to put them back into Unix format as shown below:
84
85@example
86$ dos2unix XYZ
87Dos2Unix: Cleaning file XYZ ...
88@end example
89
90The dos2unix utility may be downloaded from:
91
92@ifset use-html
93@href{@value{DOS2UNIX-FTP},,,@value{DOS2UNIX-FTP}}
94@end ifset
95@ifclear use-html
96@value{DOS2UNIX-FTP}
97@end ifclear
98
99You @b{must} change the format of every patched file
100for the toolset build to work correctly.
101
102@subsection Files Needed
103
104This section lists the files required to build and install
105a Windows hosted GNU cross development toolset and their
106home WWW site.  In addition to the sources required
107for the cross environment listed earlier in @ref{Get All the Pieces},
108you will need to  download the following
109files from their respective sites using your favorite
110Web browser or ftp client.
111
112@table @b
113
114@item cdk.exe
115@ifset use-html
116@href{@value{CYGWIN-FTP},,@value{CYGWIN-FTP}}
117@end ifset
118@ifclear use-html
119@value{CYGWIN-FTP}
120@end ifclear
121
122@item coolview.tar.gz
123@ifset use-html
124@href{@value{CYGWIN-COOLVIEW},,@value{CYGWIN-COOLVIEW}}
125@end ifset
126@ifclear use-html
127@value{CYGWIN-COOLVIEW}
128@end ifclear
129
130@end table
131
132@subsection System Requirements
133
134Although the finished cross-compiler is fairly easy on resources,
135building it can take a significant amount of processing power and
136disk space. The recommended build system spec is:
137
138@enumerate
139
140@item An AMD K6-300, Pentium II-300 or better processor. GNU C and Cygwin32 are
141@b{very} CPU hungry.
142
143@item At least 64MB of RAM.
144
145@item At least 400MB of FAT16 disk space or 250MB if you have an NTFS partition.
146
147@end enumerate
148
149Even with this spec of machine expect the full suite to take over 2 hours to
150build with a further half an hour for RTEMS itself.
151
152
153@section Installing Cygwin32 B19
154
155This section describes the process of installing the
156version @value{CYGWIN-VERSION} of the Cygwin32 environment.  It assumes
157that this toolset is installed in a directory
158referred to as @code{<RTOS>}.
159
160@enumerate
161
162@item Execute cdk.exe. These instructions assume that you
163install Cygwin32 under the <RTOS>\cygnus\b19 directory.
164
165@item Execute Cygwin.bat (either on the start menu or
166under <RTOS>\cygnus\b19).
167
168@item At this point, you are at the command line of @code{bash},
169a Unix-like shell. You have to mount the "/" directory. Type:
170
171@example
172umount /
173mount -b <RTOS> /
174@end example
175
176For example, the following sequence mounts the @code{E:\unix} as the
177root directory for the Cygwin32 environment. Note the use of two @code{\}s
178when specifying DOS paths in bash:
179
180@example
181umount /
182mount -b e:\\unix /
183@end example
184
185@item Create the /bin, /tmp, /source and /build directories.
186
187@example
188mkdir /bin
189mkdir /tmp
190mkdir /source
191mkdir /build
192mkdir /build/binutils
193mkdir /build/egcs
194@end example
195
196@item The light Bourne shell provided with Cygwin B19 is buggy.
197You should copy it to a fake name and copy @code{bash.exe} to @code{sh.exe}:
198
199@example
200cd <RTOS>/cygnus/b19/H-i386-cygwin32/bin
201mv sh.exe old_sh.exe
202cp bash.exe sh.exe
203@end example
204
205The Bourne shell has to be present in /bin directory to run shell scripts properly:
206
207@example
208cp <RTOS>/cygnus/b19/H-i386-cygwin32/bin/sh.exe /bin
209cp <RTOS>/cygnus/b19/H-i386-cygwin32/bin/bash.exe /bin
210@end example
211
212
213@item Open the file
214@code{/cygnus/b19/H-i386-cygwin32/lib/gcc-lib/i386-cygwin32/2.7-b19/specs},
215and change the following line:
216
217@example
218-lcygwin %@{mwindows:-luser32 -lgdi32 -lcomdlg32@} -lkernel32
219@end example
220
221to:
222
223@example
224-lcygwin %@{mwindows:-luser32 -lgdi32 -lcomdlg32@} -lkernel32 -ladvapi32
225@end example
226
227@end enumerate
228
229At this point, you have a native installation of Cygwin32 and
230are ready to proceed to building a cross-compiler.
231
232@c
233@c  BINUTILS
234@c
235
236@section Installing binutils
237
238@enumerate
239
240@item Unarchive @value{BINUTILS-TAR} following the
241instructions in @ref{Unarchiving the Tools} into the /source directory.
242Apply the appropriate RTEMS specific patch as detailed in
243@ref{Apply RTEMS Patch to binutils}.
244
245@item In the @code{/build/binutils} directory, execute the following
246command to configure @value{BINUTILS-VERSION}:
247
248@example
249/source/@value{BINUTILS-UNTAR}/configure --verbose --target=m68k-rtems \
250    --prefix=/gcc-m68k-rtems --with-gnu-as --with-gnu-ld
251@end example
252
253Replace @code{m68k-rtems} with the target configuration
254of your choice.  See @ref{Running the bit Script} for a
255list of the targets available.
256
257@item Execute the following command to compile the toolset:
258
259@example
260make
261@end example
262
263@item Install the full package with the following command:
264
265@example
266make -k install
267@end example
268
269There is a problem with the gnu info package which will cause an
270error during installation. Telling make to keep going with -k allows
271the install to complete.
272
273@item In the @code{cygnus.bat} file, add the directory
274containing the cross-compiler executables to your search path
275by inserting the following line:
276
277@example
278PATH=E:\unix\gcc-m68k-rtems\bin;%PATH%
279@end example
280
281@item You can erase the /build/binutils directory content if
282disk space is tight.
283
284@item Exit bash and run @code{cygnus.bat} to restart
285the Cygwin32 environment with the new path.
286
287@end enumerate
288
289@c
290@c  EGCS
291@c
292
293@section Installing EGCS AND NEWLIB
294
295@enumerate
296@item Unarchive and patch @value{EGCS-TAR} and @value{NEWLIB-TAR}
297following the instructions in @ref{Unarchiving the Tools}.
298Apply the appropriate RTEMS specific patches as detailed in
299@ref{Apply RTEMS Patch to EGCS} and @ref{Apply RTEMS Patch to newlib}.
300
301@b{NOTE}: See @ref{Bug in Patch Utility}.
302
303@item Remove the following directories (we cannot use Fortran
304or Objective-C as Cygwin32 cross-compilers):
305
306@example
307/source/@value{GCC-UNTAR}/libf2c
308/source/@value{GCC-UNTAR}/gcc/objc
309/source/@value{GCC-UNTAR}/gcc/f
310@end example
311
312@b{NOTE}: See @ref{Bug in Patch Utility}.
313
314@item Link the following directories from Newlib to the main EGCS directory,
315/source/@value{GCC-UNTAR}/ :
316
317@itemize @bullet
318@item ln -s ../@value{NEWLIB-UNTAR}/newlib newlib
319@item ln -s ../@value{NEWLIB-UNTAR}/libgloss libgloss
320@end itemize
321
322@item Change to the /build/egcs directory to configure the compiler:
323
324@example
325/source/@value{GCC-UNTAR}/configure --verbose --target=m68k-rtems \
326    --prefix=/gcc-m68k --with-gnu-as --with-gnu-ld \
327    --with-newlib
328@end example
329
330Replace @code{m68k-rtems} with the target configuration
331of your choice.  See @ref{Running the bit Script} for a
332list of the targets available.
333
334@item Compile the toolset as follows:
335
336@example
337make cross
338@end example
339
340You must do a @code{make cross} (not a simple @code{make})
341to insure that the different packages are built in the correct
342order.   Making the compiler can take several hours even on
343fairly fast machines, beware.
344
345@item Install with the following command:
346
347@example
348make -k install
349@end example
350
351@item Just as with binutils package, a problem with the gnu
352info package not building correctly requires that you use -k to
353keep going.
354
355@example
356make -k install
357@end example
358
359@end enumerate
360
361With any luck, at this point you having a working cross-compiler.  So
362as Geoffroy said:
363
364@center @b{That's it! Celebrate!}
365
Note: See TracBrowser for help on using the repository browser.