[m-rev.] for review: port Mercury to MSYS (MinGW)
Julien Fischer
juliensf at cs.mu.OZ.AU
Tue Oct 4 17:03:39 AEST 2005
On Tue, 4 Oct 2005, Ian MacLarty wrote:
> For review by anyone.
>
> Estimated hours taken: 7
> Branches: main and 0.12
>
> README.Cygwin:
> README.MS-Windows:
> README.MinGW:
> Move most of README.MS-Windows to README.Cygwin and make
> README.MS-Windows refer the user to README.Cygwin, README.MinGW or
> README.MS-VisualC.
> README.MinGW describes how to install the source distribution under
> MSYS.
>
> configure.in:
> Configure Mercury for MinGW. Most of the options are the same as
> Cygwin.
>
> boehm_gc/Makefile:
> Add a workaround to a problem with cp not working properly just
> after a file is created on MinGW.
> If cygpath is not present (which it isn't on MSYS), then use
> /bin/sh to invoke the C compiler.
>
> scripts/mmc.in:
> Do not use exec to invoke mercury_compile under MinGW. exec
> doesn't seem to understand Windows like paths with a drive
> letter in front.
>
> Index: README.Cygwin
> ===================================================================
> RCS file: README.Cygwin
> diff -N README.Cygwin
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ README.Cygwin 4 Oct 2005 05:55:50 -0000
> @@ -0,0 +1,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 XP SP2,
> +but it should work on Windows 95, 98, ME, 2000 and NT.
> +
> +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.
> +
> +-----------------------------------------------------------------------------
> +
> +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
> +
Is this URL still current?
...
> Index: README.MinGW
> ===================================================================
> RCS file: README.MinGW
> diff -N README.MinGW
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ README.MinGW 4 Oct 2005 06:12:03 -0000
> @@ -0,0 +1,72 @@
> +-----------------------------------------------------------------------------
> +
> +BUILDING WITH MINGW
> +
> +It is possible to build the Mercury compiler using the MinGW version of GCC.
> +The advantage of using MinGW is that the generated executables will run
> +natively on Windows without the need for any support environments like Cygwin.
> +
> +A Unix like environment is however still require to build the Mercury compiler.
> +MSYS or Cygwin can be used for this purpose.
> +
> +-----------------------------------------------------------------------------
> +
> +BUILDING A MINGW COMPILER UNDER MSYS
> +
> +To build the source distribution under MSYS follow these steps:
> +
> +1. Download and install MinGW and MSYS (available from www.mingw.org).
> + For MinGW install "the minimal set of packages required to build C/C++" and
> + "the full set of utility packages".
> +
> +2. Open an MSYS session and unpack the source distribution with a command
> + like:
> + tar -xvzf mercury-compiler-rotd-2005-09-29-unstable.tar.gz
> +
> +3. cd into the new directory and run configure:
> +
> + ./configure --prefix=c:/mercury
> +
> + It is important to specify the installation prefix as a full windows
> + path with a drive letter (except use `/' instead of `\').
> + Do not use a path like `/mercury', because that
> + will be interpretted differently by the MSYS shell than by the generated
s/interpretted/interpreted/
> + executables, resulting in a broken installation.
> + On Windows 2000 or XP, you may get a dialog from the
> + "Micrsoft Management Console" with the message "The selected file cannot
> + be found.". This is because configure looks for a program called "mmc".
> + Simply dismiss the dialog by clicking OK.
> +
> +4. run: `make' and then `make install'.
> +
> +Add /c/mercury/bin (or whatever path you installed Mercury to) to the MSYS
> +PATH (you cannot add `c:/mercury/bin' to the MSYS PATH because `:' is used to
> +separate directories in the MSYS PATH).
> +
> +NOTE TO DEVELOPERS: The tools/bootcheck script does not work properly
> +on MSYS at the moment -- it will build stage 3, but will not run the tests
> +correctly. To run the tests you should first install the compiler and add
> +it to the PATH. Next set the DIFF_OPTS environment variable to "-c -b". This
> +will cause the test scripts to ignore the extra carriage return character that
> +gets added to the end of each line under MinGW. Then run mmake from the tests
> +directory.
> +
> +-----------------------------------------------------------------------------
> +
> +BUILDING A CYGWIN COMPILER WHICH TARGETS MINGW
> +
> +To build a compiler which targets MinGW from Cygwin do the following:
> +
> +- First, install the Cygwin version of Mercury, and put it in your PATH.
> +- Second, configure the source distribution of Mercury using
> + --with-cc="gcc -mno-cygwin".
> +- Third, run "make" and "make install".
> +- Fourth, replace the following files in the installed Mingw Mercury
> + directories with copies of the corresponding file from the installed
> + Cygwin Mercury directories:
> + mercury_compile.exe (in <prefix>/lib/mercury/bin/<config>)
> + mercury_profile.exe (in <prefix>/lib/mercury/bin/<config>)
> + mdemangle.exe (in <prefix>/bin)
> + mkinit.exe (in <prefix>/bin)
Looks good otherwise.
Cheers,
Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list