Tyson Dowd 2e697fdd3c Split the distribution into
Estimated hours taken: 0.5

Split the distribution into
	mercury-$VERSION.tar.gz		(main distribution)
	mercury-$VERSION-extras.tar.gz 	(extras directory)

Mmakefile:
	Change rule for `tar' target to build
	mercury-$(VERSION)-extras.tar.gz as well, and not put
	extras in the main distribution.

tools/test_mercury:
	Deal with extras tar files when creating stable releases, and
	putting them on the ftp site.
1997-09-18 06:04:12 +00:00
1997-09-11 04:51:30 +00:00
1997-09-12 02:17:13 +00:00
1997-09-18 06:04:12 +00:00
1997-09-18 06:04:12 +00:00
1997-09-11 07:08:13 +00:00
1997-08-13 04:17:18 +00:00

-----------------------------------------------------------------------------

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 a version of gnu-win32 that is
compatible with the one that the binary distribution was compiled with.
Currently we suggest using gnu-win32 version b17.1.)

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 with

	sh configure

as described in the INSTALL file.

-----------------------------------------------------------------------------

RUNNING MAKE

Due to bugs in gnu-win32, you need to apply the 
patches which are listed at the end of this file:

	patch < README.ms-windows

Also, the date-stamps 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.

If you use mmake files named `Mmake' rather than `Mmakefile',
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 your `Mmake' file to `Mmakefile'.

-----------------------------------------------------------------------------
-----------------------------------------------------------------------------

Index: Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/mercury/Mmakefile,v
retrieving revision 1.1
diff -u -r1.1 Mmakefile
--- Mmakefile	1997/02/13 21:38:04	1.1
+++ Mmakefile	1997/04/10 17:46:56
@@ -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
@@ -181,9 +183,52 @@
 #-----------------------------------------------------------------------------#
 
 .PHONY: install
-install: all install_scripts install_util install_runtime install_boehm_gc \
+install: all preinstall_hack_for_win95 \
+		install_scripts install_util install_runtime install_boehm_gc \
 		install_library install_compiler install_profiler install_doc \
+		postinstall_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 boehm_gc/*.c
+	touch runtime/*.c
+	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.
+# But the Mmake files expect them to not have `.exe' filenames.
+
+.PHONY: preinstall_hack_for_win95
+preinstall_hack_for_win95:
+	cd compiler && mv mercury_compile.exe xyzzy && mv xyzzy mercury_compile
+	cd profiler && mv mercury_profile.exe xyzzy && mv xyzzy mercury_profile
+	cd util && mv mkinit.exe xyzzy && mv xyzzy mkinit
+	cd util && mv mdemangle.exe xyzzy && mv xyzzy mdemangle
+
+.PHONY: postinstall_hack_for_win95
+postinstall_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
Description
No description provided
Readme MIT 145 MiB
Languages
Mercury 85.4%
C 8.7%
Shell 1.4%
Makefile 1%
JavaScript 1%
Other 2%