mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-14 21:35:49 +00:00
Estimated hours taken: 1 README.ms-windows: A few minor changes. Include a work-around for the broken system() command in gnu-win32.
226 lines
6.8 KiB
Plaintext
226 lines
6.8 KiB
Plaintext
-----------------------------------------------------------------------------
|
|
|
|
INTRODUCTION
|
|
|
|
Mecury has been ported to Windows 95 and Windows NT
|
|
using the gnu-win32 Unix emulation package from Cygnus.
|
|
|
|
This file documents how to build the source distribution
|
|
of Mercury on Windows 95 or Windows NT using gnu-win32.
|
|
|
|
(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 gnu-win32
|
|
from Cygnus, and install it.
|
|
|
|
(If you're going to use a binary distribution of Mercury for Windows,
|
|
you need to make sure that you get the same version of gnu-win32 that
|
|
the binary distribution was compiled with.)
|
|
|
|
You can download gnu-win32 from <ftp://ftp.cygnus.com/pub/gnu-win32>.
|
|
|
|
To install gnu-win32, make a directory say D:\CYGNUS on a file
|
|
system that supports long file names, and unpack the archives
|
|
there. Make sure that you have C:\tmp and C:\bin directories.
|
|
Copy sh.exe from D:\CYGNUS\H-i386-cygnus\bin to C:\bin.
|
|
Make sure C:\bin is first in your PATH and D:\CYGNUS\H-i386-cygnus\bin
|
|
is second. Make sure that "." is last in your path.
|
|
Also set these environment variables:
|
|
|
|
GCC_EXEC_PREFIX=//D/CYGNUS/H-i386-cygnus/lib/gcc-lib
|
|
C_INCLUDE_PATH=//D/CYGNUS/H-i386-cygnus/i386-cygwin32/include
|
|
|
|
Before continuing, check that `bash' and `gcc' work.
|
|
|
|
For more information on gnu-win32, see <ftp://ftp.cygnus.com/pub/gnu-win32>
|
|
or <http://www.cygnus.com/misc/gnu-win32/>.
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
RUNNING CONFIGURE
|
|
|
|
Configure as follows (from the bash prompt):
|
|
|
|
CC="gcc -Wl,--force-exe-suffix" sh configure i386-ms-win95
|
|
|
|
I don't think the CC="gcc -Wl,--force-exe-suffix" bit is needed on NT,
|
|
so configuring with just
|
|
|
|
sh configure i386-ms-winnt
|
|
|
|
should work on NT -- but I haven't tested it.
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
RUNNING MAKE
|
|
|
|
Due to bugs in gnu-win32 version b16, you need to apply the
|
|
patches which are listed at the end of this file:
|
|
|
|
patch < README.ms-windows
|
|
|
|
Also, the datestamps seem to get screwed up by gnu-win32;
|
|
to avoid errors about `mercury_compile: Command not found',
|
|
or `makeinfo: Command not found', you need to do the following:
|
|
|
|
touch configure
|
|
make touch_files
|
|
|
|
Then do
|
|
|
|
make
|
|
|
|
Apparently the gnu-win32 gcc for Windows NT is a bit buggier than the
|
|
Linux gcc; it may crash on a few files if you use the default -O2.
|
|
If you run into this problem, put the line `EXTRA_CFLAGS=-O1' in the
|
|
file `Mmake.params'.
|
|
|
|
You may get a lot of spurious error messages, but so long as it keeps
|
|
going, you should ignore them.
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
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.
|
|
But be careful where you add it: it is still important to make sure
|
|
that C:\bin is first in your PATH, and that "." is last in your PATH.
|
|
|
|
You should be able to read the HTML version of the Mercury documentation,
|
|
which by default gets installed in /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.
|
|
|
|
The system() function in gnu-win32 version beta-16 is broken, which
|
|
means that compiling programs by invoking `mc' directly, rather than
|
|
via `mmake', will fail. Just use mmake.
|
|
|
|
There may still be some problems with case-insensitive filenames
|
|
and the nameclash between `mmake' and `Mmake'. If you run into any
|
|
such problems, rename the `Mmake' file in each subdirectory to `Mmakefile'.
|
|
|
|
-----------------------------------------------------------------------------
|
|
-----------------------------------------------------------------------------
|
|
|
|
Index: Mmake
|
|
===================================================================
|
|
RCS file: /home/staff/zs/imp/mercury/Mmake,v
|
|
retrieving revision 1.62
|
|
diff -u -r1.62 Mmake
|
|
--- Mmake 1996/12/05 19:25:00 1.62
|
|
+++ Mmake 1996/12/11 17:39:16
|
|
@@ -17,7 +17,9 @@
|
|
|
|
SUBDIRS = scripts util boehm_gc runtime library compiler doc profiler
|
|
|
|
-SUBDIR_MMAKE = PATH=../scripts:../util:$$PATH \
|
|
+# The `/bin:' below is a work-around for a bug in gnu-win32 version b16,
|
|
+# which *requires* `/bin' to be first in the PATH.
|
|
+SUBDIR_MMAKE = PATH=/bin:../scripts:../util:$$PATH \
|
|
MMAKE_VPATH=. \
|
|
MMAKE_DIR=../scripts \
|
|
../scripts/mmake $(MMAKEFLAGS)
|
|
@@ -162,7 +164,7 @@
|
|
cd profiler && $(SUBDIR_MMAKE) depend
|
|
cd profiler && $(SUBDIR_MMAKE) ints cs tags
|
|
cd doc && $(SUBDIR_MMAKE) info html dvi
|
|
- cd bindist && $(SUBDIR_MMAKE) bindist.configure bindist.build_vars
|
|
+ cd bindist && $(SUBDIR_MMAKE) bindist.configure
|
|
# clean up
|
|
cd scripts && mmake realclean
|
|
cd util && mmake realclean
|
|
@@ -183,7 +185,38 @@
|
|
.PHONY: install
|
|
install: all install_scripts install_util install_runtime install_boehm_gc \
|
|
install_library install_compiler install_profiler install_doc \
|
|
+ hack_for_win95 \
|
|
install_grades
|
|
+
|
|
+# `make touch_files' is a work-around for the broken gnu-win32 `tar'
|
|
+# that loses all the file dates.
|
|
+.PHONY: touch_files
|
|
+touch_files:
|
|
+ touch library/*.date*
|
|
+ touch library/*.optdate
|
|
+ chmod +w library/*.dep
|
|
+ touch library/*.dep
|
|
+ touch compiler/*.date*
|
|
+ chmod +w compiler/*.dep
|
|
+ touch compiler/*.dep
|
|
+ touch profiler/*.date*
|
|
+ chmod +w profiler/*.dep
|
|
+ touch profiler/*.dep
|
|
+ touch doc/*.texi
|
|
+ sleep 1
|
|
+ touch library/*.c
|
|
+ touch compiler/*.c
|
|
+ touch profiler/*.c
|
|
+ touch doc/*.info doc/*.dvi doc/*.html
|
|
+
|
|
+# another work-around for gnu-win32 on Windows 95:
|
|
+# the executable files need `.exe' filenames, otherwise they won't work.
|
|
+.PHONY: hack_for_win95
|
|
+hack_for_win95:
|
|
+ cd $(INSTALL_MERC_BIN_DIR) && mv mercury_compile mercury_compile.exe
|
|
+ cd $(INSTALL_MERC_BIN_DIR) && mv mercury_profile mercury_profile.exe
|
|
+ cd $(INSTALL_BINDIR) && mv mkinit mkinit.exe
|
|
+ cd $(INSTALL_BINDIR) && mv mdemangle mdemangle.exe
|
|
|
|
.PHONY: install_scripts
|
|
install_scripts: scripts
|
|
Index: scripts/Mmake.rules
|
|
===================================================================
|
|
RCS file: /home/staff/zs/imp/mercury/scripts/Mmake.rules,v
|
|
retrieving revision 1.39
|
|
diff -u -r1.39 Mmake.rules
|
|
--- Mmake.rules 1996/11/06 01:38:47 1.39
|
|
+++ Mmake.rules 1996/12/13 05:36:53
|
|
@@ -49,27 +49,26 @@
|
|
@touch $@
|
|
|
|
.m.date:
|
|
- $(MCI) $(MCIFLAGS) $<
|
|
+ -$(MCI) $(MCIFLAGS) $<
|
|
|
|
.m.date3:
|
|
- $(MCSI) $(MCSIFLAGS) $<
|
|
+ -$(MCSI) $(MCSIFLAGS) $<
|
|
|
|
.m.optdate:
|
|
- $(MCOI) $(MCOIFLAGS) $<
|
|
+ -$(MCOI) $(MCOIFLAGS) $<
|
|
|
|
-# do not remove the whitespace in the following four rules!
|
|
|
|
.date.int:
|
|
-
|
|
+ mercury_update_interface $@
|
|
|
|
.date.int2:
|
|
-
|
|
+ mercury_update_interface $@
|
|
|
|
.date3.int3:
|
|
-
|
|
+ mercury_update_interface $@
|
|
|
|
.optdate.opt:
|
|
-
|
|
+ mercury_update_interface $@
|
|
|
|
|
|
.m.garb:
|