-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstallation-windows.html
More file actions
368 lines (345 loc) · 10.4 KB
/
installation-windows.html
File metadata and controls
368 lines (345 loc) · 10.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>CM3 Installation Notes for Windows (x86)</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<META HTTP-EQUIV="Resource-type" CONTENT="document">
<META HTTP-EQUIV="Reply-to" CONTENT="m3-support@elego.de">
<LINK HREF="normal.css" REL="stylesheet" TYPE="text/css">
<META NAME="robots" content="noindex">
</head>
<body bgcolor="#ffffff">
<h1>CM3 Installation Notes for Windows (x86)</h1>
<p>
Skim <a href="installation.html">installation.html</a>, ignoring
anything about cminstall.
</p>
<p>
A Microsoft Visual C++ toolset is required.
Just about any version should work, from 2.0 through 9.0.
You will need the Windows SDK, which is usually included
with Visual C++, but some "express" versions do not include it.
</p>
<p>
Alternative toolsets such as Open Watcom, Digital Mars,
Metrowerks CodeWarrior are not currently supported.
There is support for GNU/Cygwin and GNU/MinGWin, not documented here.
</p>
<p>
Just about any version of 32-bit x86 or 64-bit Windows should work,
from Windows 95 to Server 2008. Modula-3 currently only targets x86
on Windows, however 64-bit Windows can run x86 code.
The bulk of testing occurs on x86 and AMD64 Windows XP.
If anyone is interested in CM3 running on or
targeting any Windows operating system version prior to Windows XP,
send mail to m3devel.
</p>
<p>
A redistributable C runtime update may be needed on the target system,
such as
</p>
<quote>
<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=200b2fd9-ae1a-4a14-984d-389c36f85647"
>http://www.microsoft.com/downloads/details.aspx?FamilyID=200b2fd9-ae1a-4a14-984d-389c36f85647</a>.
<p> or </p>
<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF"
>http://www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF</a>.
</quote>
<p>
Open a command prompt (start.run."cmd", or "command" on Windows 9x)
There is also a shortcut on the start menu to this and you may use
it.
</p>
<p>
Run vcvars32.bat or vsvars32.bat, such as:
</p>
<pre>
C:\msdev\80>dir /s/b v*bat
C:\msdev\80\Common7\Tools\vsvars32.bat <--
C:\msdev\80\VC\vcvarsall.bat
C:\msdev\80\VC\bin\vcvars32.bat
</pre>
<p>
<a name="helloc">Ensure your toolset is working (in the style of
www.linuxfromscratch.org):</a>
</p>
<pre>
echo main() { puts("hello"); } > hello.c
cl -nologo hello.c
.\hello
==> hello
del hello.c hello.exe hello.obj
</pre>
<p>
If you are going to rebuild CM3 from source, ensure you have a working
version of cvs. You can get this from www.cygwin.com.
</p>
<p>
For 5.5.0 or later, <a href="#d550">skip ahead</a>.
</p>
<p>
For <a href="http://modula3.elegosoft.com/cm3/cm3-min-WIN32-NT386-5.2.6.tgz">5.2.6</a> and earlier, do the folowing, making appropriate substitutions:
</p>
<pre>
rem Create and go to an install location of your choice:
mkdir C:\cm3
cd /d C:\cm3
rem Extract the top-level wrapper archive:
tar xvfz <path>\cm3-min-WIN32-NT386-<version>.tar.gz
rem Delete the old install mechanism:
del cminstall.exe tar.exe gzip.exe cygwin.dll
rem read the license:
start wordpad COPYRIGHT-CMASS
rem Extract the real contents:
tar xfz system.tgz
rem Put cm3.exe in %PATH%:
set PATH=C:\cm3\bin;%PATH%
rem Delete old broken .libs:
del /q c:\cm3\lib\*
</pre>
<p>
If you are going to build your own current compiler:
Checkout the current source from CVS. Do not fetch an older release.
</p>
<pre>
mkdir c:\src
cd /d c:\src
cvs -d :pserver:anonymous@modula3.elegosoft.com:/usr/cvs login
</pre>
<p>
There is no password (simply type return). Then you can checkout
everything with
</p>
<pre>
cvs -z4 -d :pserver:anonymous@modula3.elegosoft.com:/usr/cvs checkout cm3
</pre>
<p>
Take the checked in configuration verbatim:
</p>
<pre>
del c:\cm3\bin\cm3.cfg
copy c:\src\cm3\m3-sys\cminstall\src\config\NT386* c:\cm3\bin\cm3.cfg
</pre>
<p>
OR if you are just going to stick with 5.2.6, get a
<a href="http://modula3.elegosoft.com/cgi-bin/cvsweb.cgi/cm3/m3-sys/cminstall/src/config/NT386">current config file</a>;
click where it says "text" next to "download";<br>
save the file to c:\cm3\bin\cm3.cfg, replacing the file that came from system.tgz.
You will also need <a href="http://modula3.elegosoft.com/cgi-bin/cvsweb.cgi/cm3/m3-sys/cminstall/src/config/NT386.common">NT386.common</a>, placed in the same directory.
</p>
<p>
<a name="cm3runs">Make sure your cm3 compiler can run:</a>
</p>
<pre>
cm3 -version
==> Critical Mass Modula-3 version 5.2.6
last updated: 2003-06-27
configuration: cm3.cfg
</pre>
<p>
If this does not work, you probably forgot:
</p>
<pre>
set PATH=C:\cm3\bin;%PATH%
</pre>
<p>
<a name="hellom3">Build a test program:</a>
</p>
<pre>
mkdir \scratch
cd \scratch
echo MODULE Hello EXPORTS Main; > Hello.m3
echo IMPORT IO; >> Hello.m3
echo BEGIN >> Hello.m3
echo IO.Put("Hello"); >> Hello.m3
echo END Hello. >> Hello.m3
cm3
NT386\prog.exe
==> Hello
</pre>
<p>
There can be link erors here.
For example if you forgot to delete \cm3\lib\*.
Or if you don't have a Platform SDK.
These errors will be fixed when we build our own Windows .libs.
For most people though, this should work (remember to delete \cm3\lib\*).
</p>
<p>
If you are just going to use 5.2.6, you are done.
<a name="buildm3"/>If you want to build a current system from source,
continue.
</p>
<pre>
cd /d c:\src\cm3\scripts\win
.\upgrade
</pre>
<p>
Instead of scripts\win\*.cmd, you are STRONGLY encouraged to instead
install Python from
<a href="http://www.python.org">www.python.org</a>
or
<a href="http://www.activestate.com">www.activestate.com</a>
and then:
</p>
<pre>
cd /d c:\src\cm3\scripts\python
.\upgrade.py
</pre>
</p>
<p>
Upgrade does A LOT. It starts with a sanity check of your
environment. Some of what upgrade does will appear to be the same
thing repeated. It might even be. That is ok. In particular,
older compilers cannot build newer Modula-3 runtimes, so the
currently installed compiler is first used to build a current
compiler with the currently installed runtime. Then that compiler
is used to build the new system.
</p>
<p>
When upgrade finishes successfully it should clearly indicate
so, with a message such as, currently:
</p>
<pre>
upgrade : Done.
upgrade : You should now have a current compiler, runtime, and core
upgrade : packages, and be able to build and/or ship "anything" up to and
upgrade : including "standard". i.e. do-cm3-std buildship, or cd around the
upgrade : source tree and cm3 or cm3 -ship.
</pre>
<p>
If you run cm3 -version now, you should get something more recent, such as:
</p>
<pre>
Critical Mass Modula-3 version d5.7.0
last updated: 2008-03-16
configuration: C:\cm3\bin\cm3.cfg
</pre>
<p>
and your C:\cm3 directory should have many more files than previously, if you
started with a "min" archive.
</p>
<p>
<a href="#buildm3current">Now that your system is current</a>, you can
rebuild it more easily/quickly.</a>
</p>
<p>
<a name="d550">For 5.5.0 or later.</a>
In this case, the archive is a bit more ready to go from the start.
cminstall is deleted, the cm3.cfg file is ready to go, and the compiler
is more up to date so there is less motivation to rebuild it from source.
(To be fair, 5.2.6 works fine, it is just not to MY taste.)
</p>
<pre>
tar tf <path>\cm3-min-WIN32-NT386-<version>.tar.bz2 | more
</pre>
<p>
to get a quick feel of the structure -- does it have a version
specific prefix or not.
</p>
<p>
Some versions look like:
</p>
<pre>
cm3/
cm3/bin/
cm3/bin/cm3.cfg
cm3/bin/cm3.exe
cm3/bin/m3.dll
cm3/bin/m3core.dll
cm3/bin/mklib.exe
cm3/COPYRIGHT-CMASS
cm3/lib/
cm3/lib/advapi32.lib
cm3/lib/comctl32.lib
cm3/lib/comdlg32.lib
</pre>
</p>
and some look like:
<p>
<pre>
cm3-min-WIN32-NT386-<version>/
cm3-min-WIN32-NT386-<version>/bin/
cm3-min-WIN32-NT386-<version>/bin/cm3.cfg
cm3-min-WIN32-NT386-<version>/bin/cm3.exe
cm3-min-WIN32-NT386-<version>/bin/m3.dll
cm3-min-WIN32-NT386-<version>/bin/m3core.dll
cm3-min-WIN32-NT386-<version>/bin/mklib.exe
cm3-min-WIN32-NT386-<version>/COPYRIGHT-CMASS
cm3-min-WIN32-NT386-<version>/lib/
cm3-min-WIN32-NT386-<version>/lib/advapi32.lib
cm3-min-WIN32-NT386-<version>/lib/comctl32.lib
cm3-min-WIN32-NT386-<version>/lib/comdlg32.lib
</pre>
<p>
So a good install process is either:
</p>
<pre>
cd /d c:\
rmdir /q/s cm3
tar xf <path>\cm3-min-WIN32-NT386-<version>.tar.bz2
set PATH=C:\cm3\bin;%PATH%
</pre>
</p>
or:
<p>
<pre>
cd /d c:\
rmdir /q/s cm3
tar xf <path>\cm3-min-WIN32-NT386-<version>.tar.bz2
ren cm3-min-WIN32-NT386-<version> cm3
rem or if you like to keep backups
xcopy /fiverdyh cm3-min-WIN32-NT386-<version> cm3
set PATH=C:\cm3\bin;%PATH%
</pre>
<p>
And you are all set.
</p>
<p>
If you are using Visual C++ prior to 6.0, del \cm3\lib\*, checkout source from cvs,
and build in m3-win/imports-libs.
</p>
<p>
You may now optionally continue on to:<br>
<a href="#hellom3">build a test program</a><br>
<a href="#buildm3">rebuild cm3 from source</a><br>
</p>
<p>
<a name="buildm3current"/>
However there are simpler faster ways to rebuild cm3 from source since
you are starting with a newer compiler/runtime. Upgrade.[cmd,py] is pessimistic
in order to support building a new compiler from an old compiler/runtime.
</p>
<p>
You can do something like:
</p>
<pre>
cd /d c:\src\cm3\scripts\win
.\do-cm3-front buildship
rem the compiler cannot "ship" (copy) itself, so:
install-cm3-compiler upgrade
rem see also install-cm3-compiler help
</pre>
<p>
To rebuild clean:
</p>
<pre>
.\do-cm3-front realclean
.\do-cm3-front buildship
</pre>
<p>
Or build specific packages like:
<pre>
set p=m3middle m3front cm3
.\do-pkg realclean %p%
.\do-pkg buildship %p%
</pre>
</p>
<p>
Again, you are strongly encouraged to use the Python programs instead.
</p>
<hr>
<address><a href="mailto:m3-support{at}elego.de">m3-support{at}elego.de</a></address>
<!-- Created: Fri Feb 16 15:27:10 MET 2001 -->
</body>
</html>