|Building and Installing the Glasgow Functional Programming Tools Suite|
This section summarises how to get the utilities you need on your Win95/98/NT/2000 machine to use CVS and build GHC. Similar notes for installing and running GHC may be found in the user guide. In general, Win95/Win98 behave the same, and WinNT/Win2k behave the same. It is based largely on detailed advice from Sigbjørn Finne.
Extract the whole of the ssh archive into your C:\ directory, and use the ``All files'' and ``User folder names'' options in WinZip extract dialogue box. This populates your C:\usr\local tree.
Extract cygwinb19.dll into /usr/local/bin. The current version of Cywin is b20, but this version of ssh was compiled with b19.
On a Win2k machine, open up a bash and do
foo$ cd /etc foo$ mkpasswd -l > passwd
Check that your login entry is on the first line of that file. If not, move it to the top. It's OK for 'Administrator' to be the first entry, assuming you are one.
However, Win9x doesn't support the calls that mkpasswd relies on (e.g., NetUserEnum). If you run mkpasswd you get errors like:
linked to missing export netapi32.dll:NetUserEnum
The passwd file is used by ssh in a fairly rudimentary manner, so I'd simply synthesise/copy an existing Unix /etc/passwd, i.e., create an /etc/passwd file containing the line
where <login> is your login id.
Generate a key, by running c:/user/local/bin/ssh-keygen1. This generates a public key in .ssh/identity.pub, and a private key in .ssh/identity
In response to the 'Enter passphrase' question, just hit return (i.e. use an empty passphrase). The passphrase is a password that protects your private key. But it's a pain to type this passphrase everytime you use ssh, so the best thing to do is simply to protect your .ssh directory, and .ssh/identity from access by anyone else. To do this right-click your .ssh directory, and select Properties. If you are not on the access control list, add yourself, and give yourself full permissions (the second panel). Remove everyone else from the access control list. (Don't leave them there but deny them access, because 'they' may be a list that includes you!)
If you have problems running ssh-keygen1 from within bash, start up cmd.exe and run it as follows:
c:\tmp> set CYGWIN32=tty c:\tmp> c:/user/local/bin/ssh-keygen1
If you don't have an account on cvs.haskell.org, send your .ssh/identity.pub to the CVS repository administrator (currently Jeff Lewis <firstname.lastname@example.org>). He will set up your account.
If you do have an account on cvs.haskell.org, use TeraTerm to logon to it. Once in, copy the key that ssh-keygen1 deposited in /.ssh/identity.pub into your ~/.ssh/authorized_keys. Make sure that the new version of authorized_keys still has 600 file permission.
Unpack CVS and, following the instructions in the README, copy the appropriate files into /usr/local/bin.
From the System control panel, set the following user environment variables (see the GHC user guide)
HOME: points to your home directory. This is where CVS will look for its .cvsrc file.
CVSROOT: :ext:email@example.com:/home/cvs/root, where username is your userid
CVSEDITOR: bin/gnuclient.exe if you want to use an Emacs buffer for typing in those long commit messages.
Put the following in $HOME/.cvsrc:
checkout -P release -d update -P diff -u
These are the default options for the specified CVS commands, and represent better defaults than the usual ones. (Feel free to change them.)
Filenames starting with "." were illegal in the 8.3 DOS filesystem, but that restriction should have been lifted by now (i.e., you're using VFAT or later filesystems.) If you're still having problems creating it, don't worry; .cvsrc is entirely optional.
Try doing cvs co fpconfig. All being well, bytes should start to trickle through, leaving a directory fptools in your current directory. (You can rm it if you don't want to keep it.) The following messages appear to be harmless:
setsockopt IPTOS_LOWDELAY: Invalid argument setsockopt IPTOS_THROUGHPUT: Invalid argument
At this point I found that CVS tried to invoke a little dialogue with me (along the lines of `do you want to talk to this host'), but somehow bombed out. This was from a bash shell running in emacs. I solved this by invoking a Cygnus shell, and running CVS from there. Once things are dialogue free, it seems to work OK from within emacs.
If you want to check out part of large tree, proceed as follows:
cvs -f checkout -l papers cd papers cvs update cpr
This sequence checks out the papers module, but none of its sub-directories. The "-l" flag says not to check out sub-directories. The "-f" flag says not to read the .cvsrc file whose -P default (don't check out empty directories) is in this case bogus.
The cvs update command sucks in a named sub-directory.
There is a very nice graphical front-end to CVS for Win32 platforms, with a UI that people will be familiar with, at wincvs.org. I have not tried it yet.
Only required if you are doing builds from GHC's sources checked out from the CVS tree.
Fetch the (standard, Unix) autoconf distribution from ftp.gnu.org.
Unpack it into an arbitrary directory.
Make sure that the directory /usr/local/bin exists.
Now make install. This should put autoheader and autoconf in /usr/local/bin.
autoheader doesn't seem to work, but you don't need it for GHC.
In the ./configure output, ignore "checking whether #! works in shell scripts... ./configure: ./conftest: No such file or directory", and "not updating unwritable cache ./config.cache". Nobody knows why these happen, but they seem to be harmless.
You have to 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 need ghc to be in your PATH before you run configure. The default GHC InstallShield creates only ghc-4.05, so you may need to duplicate this file as ghc in the same directory, in order that configure will see it (or just rename ghc-4.05 to ghc. And make sure that the directory is in your path.
Compile happy and ghc with -static. To do this, set
in your build.mk file. [Actually, I successfully compiled Happy without -static on Win2k, but not GHC.]