Building Hugs on Win32 platforms
================================

Building from a source snapshot
-------------------------------

As the _build_ environment is Unix-slanted, you first need to have
the following toolchains installed on your Windows platform:

    * Install a recent version of Cygwin (a full set of Unix
      tools) from

        http://www.cygwin.com/

    * Install the MinGW compiler toolkit:

        http://www.mingw.org/

    * Arrange for the mingw/bin directory to appear before
      the cygwin directories in your PATH.  (That gets you the
      MinGW compiler instead of the Cygwin one, so the binaries
      you build won't require extra libraries to run.)

The following alternatives might work, but are untried:
 - Cygwin by itself, if don't mind Cygwin-dependent binaries.
 - MinGW with MSYS and msysDTK (a lighter weight alternative
   to Cygwin).

0) Get a tarball from http://cvs.haskell.org/Hugs/downloads/snapshots/
   and unpack it using tar.

1) cd into the toplevel hugs98 directory.

2) Build the interpreter and libraries with

     foo$ make EXTRA_CONFIGURE_OPTS=--build=i386-unknown-mingw32

   Other configure options you might add are listed in unix.txt.

3) Test the bits:

     foo$ export HUGSDIR=/path/to/hugs98/hugsdir
     foo$ src/hugs

Building from CVS
-----------------

This is more flexible, but in addition to the environment above,
you will need a Happy installation and an Internet connection.
(Happy is the Happy parser generator available from
http://www.haskell.org/happy/ -- you can also get by without it by getting
the file fptools/libraries/haskell-src/Language/Haskell/Parser.hs from
a source snapshot.)

0) Check out the Hugs sources following instructions
   at http://cvs.haskell.org/

1) if 'happy' is not available via your PATH setting,
   you need to tell the build system where it is:

     foo$ export happy=/path/to/happy

2) Proceed from step 1 of the above procedure for building from
   snapshots.  When you start from CVS, the make command will also
   check out the fptools library code, and do extra preprocessing
   that is prebaked in snapshots.

Using Microsoft Visual C++
--------------------------

Building the libraries needs a Unix-like environment, as described
above, but once you've done that you can build the interpreter and
WinHugs using MSVC.

* Building the Hugs interpreter using MSVC

- To compile the interpreter using an MS VC++ compiler, you need
  to copy msc/{config,options,platform}.h into the src/ directory:

    foo$ cd /path/to/hugs98/src/
    foo$ cp msc/config.h msc/options.h msc/platform.h .
    foo$ nmake -f msc/Makefile

  (Using 'make' would also work.)

* Building WinHugs using MSVC

- Same deal as when compiling Hugs using MSVC, but this time
  use the winhugs/ subdirectory:

    foo$ cd /path/to/hugs98/src/
    foo$ cp winhugs/config.h winhugs/options.h winhugs/platform.h .
    foo$ nmake -f winhugs/Makefile

  (Using 'make' would also work.)

