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

4.104.114.84.95
Last change on this file since dff0a57c was dff0a57c, checked in by Joel Sherrill <joel.sherrill@…>, on 04/14/98 at 15:32:28

Now builds for all formats and includes urls

  • Property mode set to 100644
File size: 9.7 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 DOS2UNIX-FTP ftp://ftp.micros.hensa.ac.uk/platforms/ibm-pc/ms-dos/simtelnet/txtutl/dos2unix.zip
12@set PFE-FTP http://www.lancs.ac.uk/people/cpaap/pfe/
13
14@chapter Using MS-Windows as a Development Host
15
16This chapter discusses the installation of the GNU tool chain
17on a computer running either the Microsoft Windows95
18or WindowsNT 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@@hw.ac.uk>.
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.
32It is said to also work under Windows95 (although it
33did not work with B18). Anyway, the resulting code works
34under both NT and 95.
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-achiving process uses
53the GNU @code{zip} and @code{tar} programs as shown below:
54
55@example
56tar -xzvf archive.gzip
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
99
100@subsection Files Needed
101
102This section lists the files required to build and install
103a Windows hosted GNU cross development toolset and their
104home WWW site.  In addition to the sources required
105for the cross environment listed earlier in @ref{Get All the Pieces},
106you will need to  download the following
107files from their respective sites using your favorite
108Web browser or ftp client.
109
110@table @b
111
112@item cdk.exe
113@ifset use-html
114@href{@value{CYGWIN-FTP},,@value{CYGWIN-FTP}}
115@end ifset
116@ifclear use-html
117@value{CYGWIN-FTP}
118@end ifclear
119
120@item usertools.exe
121@ifset use-html
122@href{@value{CYGWIN-FTP},,@value{CYGWIN-FTP}}
123@end ifset
124@ifclear use-html
125@value{CYGWIN-FTP}
126@end ifclear
127
128@end table
129
130@section Installing Cygwin32 B19
131
132This section describes the process of installing the
133version @value{CYGWIN-VERSION} of the Cygwin32 environment.  It assumes
134that this toolset is installed in a directory
135referred to as @code{<RTOS>}.
136
137@enumerate
138
139@item Execute cdk.exe. These instructions assume that you
140install Cygwin32 under the <RTOS>\GnuWin32\b19 directory.
141
142@item Execute usertools.exe.  These instructions assume that you
143install Cygwin32 under the <RTOS>\GnuWin32\b19 directory.
144
145@item Execute Cygwin.bat (either on the start menu or
146under <RTOS>\GnuWin32\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 creates an MS-DOS virtual
157drive @code{O:} using an MS-DOS command window and then mounts
158that virtual drive as the root directory for the Cygwin32 environment:
159
160@example
161subst o: <RTOS>
162umount /
163mount -b o: /
164@end example
165
166@item Create the /bin, /tmp, /build and /usr directories.
167
168@example
169mkdir /bin
170mkdir /tmp
171mkdir /build
172mkdir /usr
173@end example
174
175@item The light Bourne shell provided with Cygwin B19 is buggy.
176You should copy it to a fake name and copy @code{bash.exe} to @code{sh.exe}:
177
178@example
179cd <RTOS>/GnuWin32/b19/bin
180mv sh.exe old_sh.exe
181cp bash.exe sh.exe
182@end example
183
184The Bourne shell often has to be present in /bin directory when installing
185new packages.
186
187@item Open the file
188@code{/gnuwin32/b19/H-i386-cygwin32/lib/gcc-lib/i386-cygwin32/2.7-b19/specs},
189and change the following line:
190
191@example
192-lcygwin %@{mwindows:-luser32 -lgdi32 -lcomdlg32@} -lkernel32
193@end example
194
195to:
196
197@example
198-lcygwin %@{mwindows:-luser32 -lgdi32 -lcomdlg32@} -lkernel32 -ladvapi32
199@end example
200
201@end enumerate
202
203At this point, you have a native installation of Cygwin32 and
204are ready to proceed to building a cross-compiler.
205
206@c
207@c  BINUTILS
208@c
209
210@section Installing binutils
211
212@enumerate
213
214@item Unarchive @value{BINUTILS-TAR} following the
215instructions in @ref{Unarchiving the Tools}.   Apply the
216appropriate RTEMS specific patch as detailed in
217@ref{Apply RTEMS Patch to binutils}.
218
219@b{NOTE}: See @ref{Bug in Patch Utility}.
220
221@item In the @code{/build} directory, execute the following
222command to configure @value{BINUTILS-VERSION}:
223
224@example
225@value{BINUTILS-UNTAR}/configure --verbose --target=m68k-rtems \
226    --prefix=/gcc-m68k-rtems --with-gnu-as \
227    --with-gnu-ld --with-targets=all --with-newlib --with-multilib
228@end example
229
230Replace @code{m68k-rtems} with the target configuration
231of your choice.  See @ref{Running the bit Script} for a
232list of the targets available.
233
234@item Execute the following command to compile the toolset:
235
236@example
237make
238@end example
239
240@item With B19, an error will occur. Remove the ".exe" suffix
241from the tools by finding them all and renaming them
242as shown below:
243
244@example
245find . -name *.exe -print
246mv XXX/gas.exe XXX/gas
247       ....
248@end example
249
250@item Install the full package with the following command:
251
252@example
253make install
254@end example
255
256@item There is a problem with the gnu info package
257which may prevent it from building correctly.  To
258get around this try again with:
259
260@example
261make -k install
262@end example
263
264@item Once the executables are installed,
265you can restore the ".exe" suffix to the files in
266the @code{/gcc-m68k-rtems/bin} and
267@code{/gcc-m68k-rtems/m68k-rtems/bin} directories again.
268
269@item In the @code{cygnus.bat} file, add the directory
270to the cross-compiler executables to your search path
271by adding the following line:
272
273@example
274PATH=O:\gcc-m68k-rtems\bin;%PATH%
275@end example
276
277@item You can erase the /build directory content.
278
279@item Exit bash and run @code{cygnus.bat} to restart
280the Cygwin32 environment.
281
282@end enumerate
283
284@c
285@c  EGCS
286@c
287
288@section Installing EGCS AND NEWLIB
289
290@enumerate
291@item Unarchive and patch @value{EGCS-TAR} and @value{NEWLIB-TAR}
292following the instructions in @ref{Unarchiving the Tools}.
293Apply the appropriate RTEMS specific patches as detailed in
294@ref{Apply RTEMS Patch to EGCS} and @ref{Apply RTEMS Patch to newlib}.
295
296@b{NOTE}: See @ref{Bug in Patch Utility}.
297
298@item Remove the following directories (we do not need Fortran
299or Objective-C):
300
301@example
302· /build/@value{GCC-UNTAR}/libf2c
303· /build/@value{GCC-UNTAR}/gcc/objc
304· /build/@value{GCC-UNTAR}/gcc/f
305@end example
306
307@b{NOTE}: See @ref{Bug in Patch Utility}.
308
309@item Copy to /build/@value{GCC-UNTAR}/ the following directories:
310
311@itemize @bullet
312@item /build/@value{NEWLIB-UNTAR}/newlib
313@item /build/@value{NEWLIB-UNTAR}/libgloss
314@end itemize
315
316@item Go under /build directory and run:
317
318@example
319../@value{GCC-UNTAR}/configure --verbose --target=m68k-rtems \
320    --prefix=/gcc-m68k --with-gnu-as --with-gnu-ld \
321    --with-targets=all --with-newlib --with-multilib
322@end example
323
324Replace @code{m68k-rtems} with the target configuration
325of your choice.  See @ref{Running the bit Script} for a
326list of the targets available.
327
328@item Then run your favourite Unix format compaatible file editor,
329and edit /build/@value{GCC-UNTAR}/gcc/Makefile
330Search for the section:
331
332@example
333# libgcc1-test target (must also be overridable for a target)
334LIBGCC1_TEST = libgcc1-test
335@end example
336
337and change it to read:
338
339@example
340LIBGCC1_TEST =
341@end example
342
343@item Search for the section:
344
345@example
346# Set this to `ld' to enable use of collect2.
347USE_COLLECT2 =
348MAYBE_USE_COLLECT2 =
349# It is convenient for configure to add the assignment at the beginning,
350# so don't override it here.
351USE_COLLECT2 = ld
352@end example
353
354and change it to read:
355
356@example
357USE_COLLECT2 =
358@end example
359
360This changes are needed due to a @code{collect2} problem in B19.
361
362@item Compile the toolset as follows:
363
364@example
365make cross
366@end example
367
368You must do a @code{make cross} (not a simple @code{make})
369to insure that the different packages are built in the correct
370order.   This command could take a long time to run depending on
371the speed of the computer you are using.
372
373@item Install with the following command:
374
375@example
376make -k install
377@end example
378
379@item Just as with binutils package, a problem with the gnu
380info package not building correctly may occur, so try again with:
381
382@example
383make -k install
384@end example
385
386@end enumerate
387
388With any luck, at this point you having a working cross-compiler.  So
389as Geoffroy said:
390
391@center @b{That's it! Celebrate!}
392
Note: See TracBrowser for help on using the repository browser.