/
README.MS-Windows
157 lines (112 loc) · 6.19 KB
/
README.MS-Windows
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
-----------------------------------------------------------------------------
INTRODUCTION
Mercury has been ported to Windows using the "Cygwin"
(formerly also known as "Cygwin32" and "gnu-win32") Unix emulation
package. We've tested the port on Windows 2000,
but it should work on Windows 95/98/ME and Windows NT too.
This file documents how to install the binary distribution of
Mercury on Windows and how to build the source distribution
of Mercury on Windows using Cygwin. This installation will use the GNU
C compiler by default. If you want to use the Microsoft Visual C
compiler, please see the file README.MS-VisualC.
(Note: we don't have any plans for a port to Windows 3.1.)
-----------------------------------------------------------------------------
PREPARATION
To use or build Mercury on Windows, you need to first get Cygwin and
install it. Cygwin version 1.3.1 is buggy and should not be used, but
Cygwin 1.1.* or Cygwin 1.3.2 or later should be OK. Recent versions of
Cygwin can be installed directly from:
http://sources.redhat.com/cygwin/setup.exe
This program will download and install the required components.
If you want more information on Cygwin, see the site:
http://sources.redhat.com/cygwin/
If you're going to use a binary distribution of Mercury for Windows,
you need to make sure that you get a version of Cygwin that is
compatible with the one that the binary distribution was compiled
with. This will normally be specified in the filename of the
Mercury binary distribution. For example, if the file name is
mercury-0.9.1.pc-windows-cygwin-1.1.4.tar.gz then you need version
1.1.4 of Cygwin. Later versions may work also, however it is always
possible that compatibility might break at some point. Cygwin will
create a file C:\cygwin\setup.txt that lists the versions of every
package installed.
Before continuing, check that you can run Cygwin and get a command line
shell, and that `gcc' (the GNU C compiler) works.
For more information on Cygwin, see the Cygwin web site mentioned above.
-----------------------------------------------------------------------------
UNPACKING THE SOURCES
After installing Cygwin, you should download the Mercury source or
binary distribution, and unpack it.
You should use Cygwin's tar program to unpack the Mercury distribution.
From a cygwin command shell, use the `cd' command to change directory
to the directory where you saved the source or binary distribution that
you downloaded, and then use `tar zxf <filename>' to unpack it,
where <filename> is the filename that you downloaded, e.g.
mercury-compiler-<version>.tar.gz (for the source distribution), or
mercury-<version>.i686-pc-cygwin-windows.tar.gz (for the binary distribution).
Note that other programs which understand tar.gz files (e.g. WinZip)
may not be able to unpack them in the correct manner for use with Cygwin.
-----------------------------------------------------------------------------
RUNNING CONFIGURE
Use the `cd' command to change directory to the directory that you just
unpacked, and then configure with
sh configure
as described in the INSTALL file.
On Windows 2000, it may start up the "Microsoft Management Console"
program (the autoconfiguration process looks for a program named "mmc").
If so, just close that application, e.g. by selecting "Exit" from
the "Console" menu.
-----------------------------------------------------------------------------
RUNNING MAKE INSTALL
Just type
make install
-----------------------------------------------------------------------------
USING MERCURY
Once you've finished installing, you need to add the appropriate
directory, normally /usr/local/mercury-<VERSION>/bin, to your PATH.
If you are familiar with how to set the PATH for command-line programs
in Windows you can add
C:\cygwin\usr\local\mercury-<VERSION>\bin
to that path.
Otherwise you can just set the path in Cygwin by creating a file called
`.bashrc' in your Cygwin home directory that contains the line:
PATH=/usr/local/mercury-<VERSION>/bin:$PATH
You Cygwin home directory can be found in C:\cygwin\home\username\
if using Windows Explorer (Cygwin will call your home directory
`/home/username' or simply `~').
On Windows 2000, you need to make sure that this directory precedes
the Windows system directory in the PATH, otherwise `mmc' will invoke the
Microsoft Management Console rather than the Melbourne Mercury Compiler.
In this case it might be a good idea to modify your path in your
.bashrc rather than in the Windows PATH environment variable, so as to
not confuse any other programs that might be looking for the Microsoft
Management Console.
You should be able to read the HTML version of the Mercury
documentation, which by default gets installed in
C:\cygwin\usr\local\mercury-<VERSION>\lib\mercury\html, using Netscape
or MS Internet Explorer. Or you can get a copy of GNU Emacs
for NT and use it to browse the INFO version.
If you use mmake files named `Mmake' rather than `Mmakefile',
there can be some problems with case-insensitive filenames
and the name clash between `mmake' and `Mmake'. If you run into any
such problems, rename your `Mmake' file to `Mmakefile'.
To write Mercury programs, simply create a new .m file in your favourite
editor. Run `mmc <filename>.m' on the Cygwin command line to compile
small programs, or use `mmake' to handle larger systems. See the
Mercury Users Guide for more information about the command line tools.
There is currently no GUI for editing and compiling Mercury programs,
although it is quite likely you can hook up a sophisticated editor to
run `mmc' and/or `mmake' for you.
-----------------------------------------------------------------------------
OTHER PACKAGES YOU MIGHT NEED
If you want to use the mtags tool from the Mercury distribution, you'll
need to install perl. A binary distribution of Perl is available at the
Cygwin porting project:
http://www.student.uni-koeln.de/cygwin/
If you want to build your own Mercury releases from the CVS sources, you
will need a previously installed Mercury compiler (for example, one of
the recent releases of the day). You will also need GNU autoconf, which
can be downloaded from
ftp://ftp.gnu.org/pub/gnu/autoconf/
Autoconf should configure, build and install directly from the source
package.