mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-10 11:23:15 +00:00
Estimated hours taken: 0.25 Branches: main Changes suggested by fjh review comments. README.MS-VisualC: Document TMPDIR better. trace/mercury_trace_source.c: Change the loop counter from int to a long, just in case we one day target a 16bit system.
86 lines
3.0 KiB
Plaintext
86 lines
3.0 KiB
Plaintext
-----------------------------------------------------------------------------
|
|
|
|
INTRODUCTION
|
|
|
|
Mercury has been ported to use the Microsoft Visual C++ compiler. It
|
|
has been tested with both version 6.0 and 7.0. However not all
|
|
dependencies on Cygwin have been removed and cygwin is still required
|
|
for installation (see README.MS-Windows).
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
CONFIGURATION
|
|
|
|
To use MSVC to build the compiler issue the following configure command.
|
|
|
|
CC='CL /nologo' CPP='CL /nologo /E' ./configure
|
|
|
|
Also ensure that the environment variable TMPDIR exists and is set to
|
|
".". This avoids problems with mixing cygwin and windows paths.
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
SOURCE INSTALLATION
|
|
|
|
In order to save time in compilation the source distribution comes with
|
|
prebuilt C files. These C files are generated using the asm_fast grade
|
|
which is incompatible with hlc.gc. In order to alleviate this problem:
|
|
|
|
1. Install cygwin (avoid the bug in sscanf with 1.3.1-1)
|
|
|
|
2. Install an asm_fast grade version of the compiler which uses gcc as
|
|
the C compiler. This can be done from a source or binary
|
|
distribution. Follow standard instructions. I suggest:
|
|
|
|
a) configure --prefix /usr/local/mercury-0.10.1
|
|
b) make install
|
|
|
|
Ensure your path has been modified so you can see the new mmc once it
|
|
is built. For example:
|
|
|
|
a) edit /etc/profile and add /usr/local/mercury-0.10.1 to PATH
|
|
|
|
3. To build a version of the mercury compiler with MSVC++ instead of
|
|
gcc, remotely check out a fresh version of the compiler, eg.
|
|
|
|
a) cvs -d :pserver:guest@cvs.mercury.cs.mu.oz.au:/home/mercury1/repository login
|
|
(password is guest)
|
|
b) cvs -d :pserver:guest@cvs.mercury.cs.mu.oz.au:/home/mercury1/repository co -r version-0_10_1 mercury
|
|
|
|
Then to use MSVC++ to build the compiler issue the following configure
|
|
command. (You must be able to run MSVC++ from command line):
|
|
|
|
CC='CL /nologo' CPP='CL /nologo /E' configure --prefix /usr/local/msmercury
|
|
(configure defaults to using the hlc.gc grade as this is the only
|
|
grade currently supported).
|
|
|
|
4. make install
|
|
|
|
DO NOT USE THE SOURCE DISTRIBUTION TO BUILD THE MS-VisualC VERSION OF
|
|
THE COMPILER!! CONFIGURE DOES NOT DETERMINE THAT THE PRE-BUILT C
|
|
FILES ARE INCOMPATIBLE IT JUST TRIES TO USE THEM ANYWAY.
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
INSTALLING ON NETWORK DRIVES
|
|
|
|
If you want to install on the machine, foo, in the directory \usr\local
|
|
you need to add `--prefix //foo/usr/local' as an option to configure.
|
|
|
|
Then ensure that the directory that you wish to install into is mounted
|
|
somewhere, ie
|
|
|
|
mount //foo/usr/local /temp_mount_point
|
|
|
|
and then use that mount point as the location to install into
|
|
|
|
make install INSTALL_PREFIX=/temp_mount_point
|
|
|
|
This avoids the problem that
|
|
|
|
mkdir -p //foo/usr/local/xxx
|
|
|
|
fails.
|
|
|
|
-----------------------------------------------------------------------------
|