From afa56dd5218559dad4503a6db32769c356e7652b Mon Sep 17 00:00:00 2001 From: simonpj Date: Fri, 17 May 2002 08:13:08 +0000 Subject: [PATCH 1/1] [project @ 2002-05-17 08:13:08 by simonpj] Win32 updates from Simon --- docs/building/building.sgml | 186 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 176 insertions(+), 10 deletions(-) diff --git a/docs/building/building.sgml b/docs/building/building.sgml index 80398f3..9dc9f2e 100644 --- a/docs/building/building.sgml +++ b/docs/building/building.sgml @@ -3718,7 +3718,7 @@ Workaround: don't put weird things in string args to cpp macr -Notes for building under Windows +Notes for building under Windows This section summarises how to get the utilities you need on your @@ -3730,21 +3730,133 @@ guide) before continuing to read these notes. -Before you start +Installing and configuring Cygwin +You don't need Cygwin to use GHC, but you do need it to build GHC. + + Install Cygwin from http://www.cygwin.com/. +The installation process is straightforward; we install it in c:/cygwin. +Both cvs and ssh +come with Cygwin, but you'll need them, so make sure you select them when running +the Cygwin installer. + + + Now set the following user environment variables: + + Add c:/cygwin/bin to your +PATH + -Make sure that the user environment variable -MAKE_MODE is set to UNIX. If you +Set MAKE_MODE to UNIX. If you don't do this you get very weird messages when you type -make, such as: +make, such as: /c: /c: No such file or directory + Set SHELL to +c:/cygwin/bin/sh. When you invoke a shell in Emacs, this +SHELL is what you get. + + + Set HOME to point to your +home directory. This is where, for example, +bash will look for your .bashrc +file. Ditto emacs looking for .emacsrc + + + + + +There are a few other things to do: + + + +Some script files used in the make system start with "#!/bin/perl", +(and similarly for bash). Notice the hardwired path! +So you need to ensure that your /bin directory has the following +binaries in it: + + sh + perl + cat + +All these come in Cygwin's bin directory, which you probably have +installed as c:/cygwin/bin. By default Cygwin mounts "/" as +c:/cygwin, so if you just take the defaults it'll all work ok. +(You can discover where your Cygwin +root directory / is by typing mount). +Provided /bin points to the Cygwin bin +directory, there's no need to copy anything. + + + + + +By default, cygwin provides the command shell ash +as sh.exe. It has a couple of 'issues', so +in your /bin directory, make sure that +bash.exe is also provided as sh.exe +(i.e. overwrite the old sh.exe with a copy of +bash.exe). + + + + + +Finally, here are some things to be aware of when using Cygwin: + + Cygwin doesn't deal well with filenames that include +spaces. "Program Files" and "Local files" are +common gotchas. + + + Cygwin implements a symbolic link as a text file with some +magical text in it. So other programs that don't use Cygwin's +I/O libraries won't recognise such files as symlinks. +In particular, programs compiled by GHC are meant to be runnable +without having Cygwin, so they don't use the Cygwin library, so +they don't recognise symlinks. + + + +Win32 has a find command which is not the same as Cygwin's find. +You will probably discover that the Win32 find appears in your PATH +before the Cygwin one, because it's in the system PATH +environment variable, whereas you have probably modified the user PATH +variable. You can always invoke find with an absolute path, or rename it. + + + + + + +Other things you need to install + +You have to install the following other things to build GHC: + + + +Install an executable GHC, from http://www.haskell.org/ghc. +This is what you will use to compile GHC. Add it in your +PATH: the installer tells you the path element +you need to add upon completion. + + + + + +Install an executable Happy, from http://www.haskell.org/happy. +Happy is a parser generator used to compile the Haskell grammar. Add it in your +PATH. + + + + GHC uses the mingw C compiler to generate code, so you have to install that. Just pick up a mingw bundle at @@ -3753,15 +3865,69 @@ We install it in c:/mingw. + + + Finally, check out a copy of GHC sources from +the CVS repository, following the instructions above (). + + + + + + +Building GHC + +OK! +Now go read the documentation above on building from source (); +the bullets below only tell +you about Windows-specific wrinkles. + -Install a version of GHC, and put it in your -PATH (the installer tells you the path element -you need to add upon completion.) +Run autoconf both in fptools +and in fptools/ghc. If you omit the latter step you'll +get an error when you run ./configure: + +...lots of stuff... +creating mk/config.h +mk/config.h is unchanged +configuring in ghc +running /bin/sh ./configure --cache-file=.././config.cache --srcdir=. +./configure: ./configure: No such file or directory +configure: error: ./configure failed for ghc + - - + + + +You either need to add ghc to your +PATH before you invoke +configure, or use the configure +option . + + + + + + After autoconf run ./configure in + fptools/ thus: + + + ./configure --host=i386-unknown-mingw32 --with-gcc=/mingw/bin/gcc + + +Both these options are important! It's possible to get into +trouble using the wrong C compiler! + + + + Do not attempt to build the documentation. +It needs all kinds of wierd Jade stuff that we haven't worked out for +Win32. + + + -- 1.7.10.4