source: rtems/doc/started/nt.t @ 88cd4ab

4.104.114.84.95
Last change on this file since 88cd4ab was 4a675a5c, checked in by Joel Sherrill <joel.sherrill@…>, on 11/13/02 at 20:20:29

2002-11-13 Joel Sherrill <joel@…>

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