source: rtems/doc/started/nt.t @ 874f9ed2

4.104.114.84.95
Last change on this file since 874f9ed2 was 14bf83e, checked in by Joel Sherrill <joel.sherrill@…>, on 05/09/00 at 17:59:57

Updated NT editor information to update status on PFE and add
pointers to emacs and vim.

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