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

4.104.114.84.95
Last change on this file since cdf30aba was cdf30aba, checked in by Joel Sherrill <joel.sherrill@…>, on 10/27/98 at 19:28:20

Update from David Fiddes.

  • Property mode set to 100644
File size: 9.5 KB
RevLine 
[4c7cf3a]1@c
[fdd6a26]2@c  COPYRIGHT (c) 1988-1998.
3@c  On-Line Applications Research Corporation (OAR).
4@c  All rights reserved.
5@c
[4c7cf3a]6@c  $Id$
7@c
8
9@set CYGWIN-VERSION B19
[cdf30aba]10@set CYGWIN-FTP http://www.cygnus.com/misc/gnu-win32/
11@set CYGWIN-COOLVIEW http://www.lexa.ru/sos/
[7137f8f7]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/
[4c7cf3a]14
15@chapter Using MS-Windows as a Development Host
16
17This chapter discusses the installation of the GNU tool chain
[cdf30aba]18on a computer running the Microsoft Windows NT operating system.
[4c7cf3a]19
20This chapter is based on a draft provided by
21Geoffroy Montel <g_montel@@yahoo.com>.  Geoffroy's
22procedure was based on information from
[cdf30aba]23David Fiddes <D.J@@fiddes.surfaid.org>.
[4c7cf3a]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.
[cdf30aba]32Using Windows 95 or 98 is not recommended although it
33should be possible with version 3.77 of gmake and an updated
34cygwinb19.dll.
[4c7cf3a]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
[cdf30aba]52@code{PKZip}.  Instead the un-archiving process uses
[4c7cf3a]53the GNU @code{zip} and @code{tar} programs as shown below:
54
55@example
56tar -xzvf archive.gzip
57@end example
58
[7137f8f7]59@code{tar} is provided with Cygwin32.
[4c7cf3a]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
[7137f8f7]67free and very convenient.  This editor may be downloaded
[dff0a57c]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
[4c7cf3a]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
[dff0a57c]86$ dos2unix XYZ
87Dos2Unix: Cleaning file XYZ ...
[4c7cf3a]88@end example
89
[7137f8f7]90The dos2unix utility may be downloaded from:
91
[dff0a57c]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
[cdf30aba]99You @b{must} change the format of every patched file
100for the toolset build to work correctly.
[7137f8f7]101
[4c7cf3a]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
[dff0a57c]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
[4c7cf3a]121
[cdf30aba]122@item coolview.tar.gz
[dff0a57c]123@ifset use-html
[cdf30aba]124@href{@value{CYGWIN-COOLVIEW},,@value{CYGWIN-COOLVIEW}}
[dff0a57c]125@end ifset
126@ifclear use-html
[cdf30aba]127@value{CYGWIN-COOLVIEW}
[dff0a57c]128@end ifclear
[4c7cf3a]129
130@end table
131
[cdf30aba]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@itemize @bullet
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 itemize
148
149Even with this spec of machine expect the full suite to take over 2 hours to
150build with a further hour for RTEMS itself.
151
152
[4c7cf3a]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
[cdf30aba]163install Cygwin32 under the <RTOS>\cygnus\b19 directory.
[4c7cf3a]164
165@item Execute Cygwin.bat (either on the start menu or
[cdf30aba]166under <RTOS>\cygnus\b19).
[4c7cf3a]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
[cdf30aba]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:
[4c7cf3a]179
180@example
181umount /
[cdf30aba]182mount -b e:\\unix /
[4c7cf3a]183@end example
184
[cdf30aba]185@item Create the /bin, /tmp, /source and /build directories.
[4c7cf3a]186
187@example
188mkdir /bin
189mkdir /tmp
[cdf30aba]190mkdir /source
[4c7cf3a]191mkdir /build
[cdf30aba]192mkdir /build/binutils
193mkdir /build/egcs
[4c7cf3a]194@end example
195
[7137f8f7]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
[cdf30aba]200cd <RTOS>/cygnus/b19/H-i386-cygwin32/bin
[7137f8f7]201mv sh.exe old_sh.exe
202cp bash.exe sh.exe
203@end example
204
[cdf30aba]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
[4c7cf3a]212
213@item Open the file
[cdf30aba]214@code{/cygnus/b19/H-i386-cygwin32/lib/gcc-lib/i386-cygwin32/2.7-b19/specs},
[4c7cf3a]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
[cdf30aba]241instructions in @ref{Unarchiving the Tools} into the /source directory.
242Apply the appropriate RTEMS specific patch as detailed in
[4c7cf3a]243@ref{Apply RTEMS Patch to binutils}.
244
245@b{NOTE}: See @ref{Bug in Patch Utility}.
246
[cdf30aba]247@item In the @code{/build/binutils} directory, execute the following
[4c7cf3a]248command to configure @value{BINUTILS-VERSION}:
249
250@example
[cdf30aba]251/source/@value{BINUTILS-UNTAR}/configure --verbose --target=m68k-rtems \
252    --prefix=/gcc-m68k-rtems --with-gnu-as --with-gnu-ld
[4c7cf3a]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
[cdf30aba]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.
[4c7cf3a]274
275@item In the @code{cygnus.bat} file, add the directory
[cdf30aba]276containing the cross-compiler executables to your search path
277by inserting the following line:
[4c7cf3a]278
279@example
[cdf30aba]280PATH=E:\unix\gcc-m68k-rtems\bin;%PATH%
[4c7cf3a]281@end example
282
[cdf30aba]283@item You can erase the /build/binutils directory content if
284disk space is tight.
[4c7cf3a]285
286@item Exit bash and run @code{cygnus.bat} to restart
[cdf30aba]287the Cygwin32 environment with the new path.
[4c7cf3a]288
289@end enumerate
290
291@c
292@c  EGCS
293@c
294
295@section Installing EGCS AND NEWLIB
296
297@enumerate
298@item Unarchive and patch @value{EGCS-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 EGCS} and @ref{Apply RTEMS Patch to newlib}.
302
303@b{NOTE}: See @ref{Bug in Patch Utility}.
304
[cdf30aba]305@item Remove the following directories (we cannot use Fortran
306or Objective-C as Cygwin32 cross-compilers):
[4c7cf3a]307
308@example
[cdf30aba]309/source/@value{GCC-UNTAR}/libf2c
310/source/@value{GCC-UNTAR}/gcc/objc
311/source/@value{GCC-UNTAR}/gcc/f
[4c7cf3a]312@end example
313
314@b{NOTE}: See @ref{Bug in Patch Utility}.
315
[cdf30aba]316@item Link the following directories from Newlib to the main EGCS directory,
317/source/@value{GCC-UNTAR}/ :
[4c7cf3a]318
319@itemize @bullet
[cdf30aba]320@item ln -s ../@value{NEWLIB-UNTAR}/newlib newlib
321@item ln -s ../@value{NEWLIB-UNTAR}/libgloss libgloss
[4c7cf3a]322@end itemize
323
[cdf30aba]324@item Change to the /build/egcs directory to configure the compiler:
[4c7cf3a]325
326@example
[cdf30aba]327/source/@value{GCC-UNTAR}/configure --verbose --target=m68k-rtems \
[4c7cf3a]328    --prefix=/gcc-m68k --with-gnu-as --with-gnu-ld \
[cdf30aba]329    --with-newlib
[4c7cf3a]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
[cdf30aba]344order.   Making the compiler can take several hours even on
345fairly fast machines, beware
[4c7cf3a]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
[cdf30aba]354info package not building correctly requires that you use -k to
355keep going.
[4c7cf3a]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.