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 | |
---|
11 | This chapter discusses the installation of the GNU tool chain |
---|
12 | on a computer running the Microsoft Windows operating system. |
---|
13 | |
---|
14 | This chapter was originally written by |
---|
15 | @uref{mailto:g_montel@@yahoo.com, Geoffroy Montel <g_montel@@yahoo.com>} |
---|
16 | with input from |
---|
17 | @uref{mailto:<D.J@@fiddes.surfaid.org>, David Fiddes <D.J@@fiddes.surfaid.org>}. |
---|
18 | It was based upon his successful but unnecessarily |
---|
19 | painful efforts with Cygwin beta versions. |
---|
20 | Cygwin and this chapter have been updated multiple times since |
---|
21 | those early days although their pioneering efforts |
---|
22 | and input is still greatly appreciated. |
---|
23 | |
---|
24 | @section Microsoft Windows Version Requirements |
---|
25 | |
---|
26 | RTEMS users report fewer problems when using Microsoft |
---|
27 | Windows NT, 2000, or XP. Although, the open source tools |
---|
28 | that are used in RTEMS development do execute on Windows 95, |
---|
29 | 98, or ME, they tend to be more stable when used with |
---|
30 | the modern Windows variants. |
---|
31 | |
---|
32 | @section Cygwin |
---|
33 | |
---|
34 | For RTEMS development, the recommended approach is to use |
---|
35 | Cygwin 1.0 or later. Cygwin is available from |
---|
36 | @uref{http://sources.redhat.com/cygwin, http://sources.redhat.com/cygwin} |
---|
37 | Recent versions of Cygwin are vastly improved over the beta |
---|
38 | versions. Most of the oddities, instabilities, and performance |
---|
39 | problems have been resolved. The installation procedure |
---|
40 | is much simpler. However, there are a handful of issues |
---|
41 | that remain to successfully use Cygwin as an RTEMS development |
---|
42 | environment. |
---|
43 | |
---|
44 | @itemize @bullet |
---|
45 | |
---|
46 | @item There is no @code{cc} program by default. The GNU configure |
---|
47 | scripts used by RTEMS require this to be present to work properly. |
---|
48 | The solution is to link @code{gcc.exe} to @code{cc.exe} as follows: |
---|
49 | |
---|
50 | @example |
---|
51 | ln -s /bin/gcc.exe /bin/cc.exe |
---|
52 | @end example |
---|
53 | |
---|
54 | @item Make sure @code{/bin/sh.exe} is GNU Bash. Some Cygwin |
---|
55 | versions provide a light Bourne shell which is insufficient to build |
---|
56 | RTEMS. To see which shell is installed as @code{/bin/sh.exe}, execute |
---|
57 | the command @code{/bin/sh --version}. If it looks similar to |
---|
58 | the following, then it is GNU Bash and you are OK: |
---|
59 | |
---|
60 | @example |
---|
61 | GNU bash, version 2.04.5(12)-release (i686-pc-cygwin) |
---|
62 | Copyright 1999 Free Software Foundation, Inc. |
---|
63 | @end example |
---|
64 | |
---|
65 | If you get an error or it claims to be any other shell, you need |
---|
66 | to copy it to a fake name and copy |
---|
67 | @code{/bin/bash.exe} to @code{/bin/sh.exe}: |
---|
68 | |
---|
69 | @example |
---|
70 | cd /bin |
---|
71 | mv sh.exe old_sh.exe |
---|
72 | cp bash.exe sh.exe |
---|
73 | @end example |
---|
74 | |
---|
75 | The Bourne shell has to be present in @code{/bin} directory to run |
---|
76 | shell scripts properly. |
---|
77 | |
---|
78 | @item Make sure you unarchive and build in a binary mounted |
---|
79 | filesystem (e.g. mounted with the @code{-b} option). Otherwise, |
---|
80 | many confusing errors will result. |
---|
81 | |
---|
82 | @item A user has reported that they needed |
---|
83 | to set CYGWIN=ntsec for chmod to work correctly, but had to set |
---|
84 | CYGWIN=nontsec for compile to work properly (otherwise there were |
---|
85 | complaints about permissions on a temporary file). |
---|
86 | |
---|
87 | @item If you want to build the tools from source, you have the |
---|
88 | same options as UNIX users. |
---|
89 | |
---|
90 | @item You may have to uncompress archives during this |
---|
91 | process. You must @b{NOT} use @code{WinZip} or |
---|
92 | @code{PKZip}. Instead the un-archiving process uses |
---|
93 | the GNU @code{zip} and @code{tar} programs as shown below: |
---|
94 | |
---|
95 | @example |
---|
96 | tar -xzvf archive.tgz |
---|
97 | @end example |
---|
98 | |
---|
99 | @code{tar} is provided with Cygwin. |
---|
100 | |
---|
101 | @end itemize |
---|
102 | |
---|
103 | @section Text Editor |
---|
104 | |
---|
105 | You absolutely have to use a text editor which can |
---|
106 | save files with Unix format. So do @b{NOT} use Notepad |
---|
107 | or Wordpad! There are a number of editors |
---|
108 | freely available that can be used. |
---|
109 | |
---|
110 | @itemize @bullet |
---|
111 | @item @b{VIM} (@b{Vi IMproved}) is available from |
---|
112 | @uref{http://www.vim.org/,http://www.vim.org/}. |
---|
113 | This editor has the very handy ability to easily |
---|
114 | read and write files in either DOS or UNIX style. |
---|
115 | |
---|
116 | @item @b{GNU Emacs} is available for many platforms |
---|
117 | including MS-Windows. The official homepage |
---|
118 | is @uref{http://www.gnu.org/software/emacs/emacs.html, |
---|
119 | http://www.gnu.org/software/emacs/emacs.html}. |
---|
120 | The GNU Emacs on Windows NT and Windows 95/98 FAQ is at |
---|
121 | @uref{http://www.gnu.org/software/emacs/windows/ntemacs.html, |
---|
122 | http://www.gnu.org/software/emacs/windows/ntemacs.html}. |
---|
123 | |
---|
124 | @end itemize |
---|
125 | |
---|
126 | If you do accidentally end up with files |
---|
127 | having MS-DOS style line termination, then you |
---|
128 | may have to convert them to Unix format for some |
---|
129 | Cygwin programs to operate on them properly. The |
---|
130 | program @code{dos2unix} can be used to put them |
---|
131 | back into Unix format as shown below: |
---|
132 | |
---|
133 | @example |
---|
134 | $ dos2unix XYZ |
---|
135 | Dos2Unix: Cleaning file XYZ ... |
---|
136 | @end example |
---|
137 | |
---|
138 | @section System Requirements |
---|
139 | |
---|
140 | Although the finished cross-compiler is fairly easy on resources, |
---|
141 | building it can take a significant amount of processing power and |
---|
142 | disk space. |
---|
143 | |
---|
144 | @itemize @bullet |
---|
145 | |
---|
146 | @item The faster the CPU, the better. The tools and Cygwin can be |
---|
147 | @b{very} CPU hungry. |
---|
148 | |
---|
149 | @item The more RAM, the better. Reports are that when building GCC |
---|
150 | and GDB, peak memory usage can exceed 256 megabytes. |
---|
151 | |
---|
152 | @item The more disk space, the better. You need more if you are building |
---|
153 | the GNU tools and the amount of disk space for binaries is obviously |
---|
154 | directly dependent upon the number of CPUs you have cross toolsets |
---|
155 | installed for. |
---|
156 | |
---|
157 | @end itemize |
---|
158 | |
---|