[project @ 2002-04-10 09:49:47 by simonmar]
[ghc-hetmet.git] / docs / building / building.sgml
index 46f2a0d..650596b 100644 (file)
@@ -7,48 +7,46 @@
 <Title>Building the Glasgow Functional Programming Tools Suite</Title>
 <Author><OtherName>The GHC Team</OtherName></Author>
 <Address><Email>glasgow-haskell-&lcub;users,bugs&rcub;@haskell.org</Email></Address>
-<PubDate>January 2000</PubDate>
+<PubDate>November 2001</PubDate>
 
-<Abstract>
+    <abstract>
+      <para>The Glasgow fptools suite is a collection of Functional
+      Programming related tools, including the Glasgow Haskell
+      Compiler (GHC).  The source code for the whole suite is kept in
+      a single CVS repository and shares a common build and
+      installation system.</para>
 
-<para>
-This guide is intended for people who want to build or modify
-programs from the Glasgow <Literal>fptools</Literal> suite (as distinct from those
-who merely want to <Emphasis>run</Emphasis> them). Installation instructions are now provided in the user guide.
-</para>
-
-<para>
-The bulk of this guide applies to building on Unix systems; see <XRef LinkEnd="winbuild"> for Windows notes.
-</para>
+      <para>This guide is intended for people who want to build or
+      modify programs from the Glasgow <Literal>fptools</Literal>
+      suite (as distinct from those who merely want to
+      <Emphasis>run</Emphasis> them). Installation instructions are
+      now provided in the user guide.</para>
 
-</Abstract>
+      <para>The bulk of this guide applies to building on Unix
+      systems; see <XRef LinkEnd="winbuild"> for Windows notes.</para>
+    </abstract>
 
-</ArtHeader>
+  </artheader>
 
 
-<Sect1 id="sec-getting">
-<Title>Getting the Glasgow <Literal>fptools</Literal> suite
-</Title>
+  <sect1 id="sec-getting">
+    <title>Getting the Glasgow <Literal>fptools</Literal> suite</title>
 
-<para>
-Building the Glasgow tools <Emphasis>can</Emphasis> be complicated, mostly because
-there are so many permutations of what/why/how, e.g., ``Build Happy
-with HBC, everything else with GHC, leave out profiling, and test it
-all on the `real' NoFib programs.''  Yeeps!
-</para>
+    <para>Building the Glasgow tools <Emphasis>can</Emphasis> be
+    complicated, mostly because there are so many permutations of
+    what/why/how, e.g., ``Build Happy with HBC, everything else with
+    GHC, leave out profiling, and test it all on the `real' NoFib
+    programs.''  Yeeps!</para>
 
-<para>
-Happily, such complications don't apply to most people.  A few common
-``strategies'' serve most purposes.  Pick one and proceed
-as suggested:
-</para>
+    <para>Happily, such complications don't apply to most people.  A
+    few common ``strategies'' serve most purposes.  Pick one and
+    proceed as suggested:</para>
 
-<para>
 <VariableList>
 
 <VarListEntry>
-<Term><IndexTerm><Primary>Binary distribution</Primary></IndexTerm>Binary distribution.</Term>
-<ListItem>
+<term><indexterm><primary>Binary distribution</primary></indexterm>Binary distribution.</term>
+<listitem>
 <para>
 If your only purpose is to install some of the
 <Literal>fptools</Literal> suite then the easiest thing to do is to
@@ -72,10 +70,10 @@ off.
 The second reason a binary distribution may not be what you want is
 if you want to read or modify the souce code.
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 <VarListEntry>
-<Term><IndexTerm><Primary>Source distribution</Primary></IndexTerm>Source distribution.</Term>
-<ListItem>
+<term><indexterm><primary>Source distribution</primary></indexterm>Source distribution.</term>
+<listitem>
 <para>
 You have a supported
 platform, but (a)&nbsp;you like the warm fuzzy feeling of compiling things
@@ -89,7 +87,7 @@ A source distribution contains complete sources for one or more
 projects in the <Literal>fptools</Literal> suite.  Not only that, but
 the more awkward machine-independent steps are done for you.  For
 example, if you don't have
-<Command>happy</Command><IndexTerm><Primary>happy</Primary></IndexTerm>
+<Command>happy</Command><indexterm><primary>happy</primary></indexterm>
 you'll find it convenient that the source distribution contains the
 result of running <Command>happy</Command> on the parser
 specifications.  If you don't want to alter the parser then this saves
@@ -98,143 +96,878 @@ still need a working version of GHC (preferably version 4.08+) on your
 machine in order to compile (most of) the sources, however.
 </para>
 
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term>Build GHC from intermediate C <Filename>.hc</Filename> files<IndexTerm><Primary>hc files</Primary></IndexTerm>:</Term>
-<ListItem>
-<para>
-You
-need a working GHC to use a source distribution. What if you don't
-have a working GHC? Then you have no choice but to ``bootstrap'' up
-from the intermediate C (<Filename>.hc</Filename>) files that we provide.  Building GHC
-on an unsupported platform falls into this category.  Please see
-<Xref LinkEnd="sec-booting-from-C">.
-</para>
+</listitem></VarListEntry>
+
+      <varlistentry>
+       <term>The CVS repository.</term>
+       <indexterm><primary>CVS repository</primary>
+       </indexterm>
+       <listitem>
+         <para>We make releases infrequently.  If you want more
+          up-to-the minute (but less tested) source code then you need
+          to get access to our CVS repository.</para>
+
+         <para>All the <Literal>fptools</Literal> source code is held
+          in a CVS repository. CVS is a pretty good source-code
+          control system, and best of all it works over the
+          network.</para>
+
+         <para>The repository holds source code only. It holds no
+          mechanically generated files at all.  So if you check out a
+          source tree from CVS you will need to install every utility
+          so that you can build all the derived files from
+          scratch.</para>
+
+         <para>More information about our CVS repository can be found
+          in <xref linkend="sec-cvs">.</para>
+
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>Build GHC from intermediate C <Filename>.hc</Filename> files<indexterm><primary>hc files</primary></indexterm>:</term>
+       <listitem>
+         <para><emphasis>NOTE: GHC version 5.xx is significantly
+         harder to bootstrap from C than previous versions.  We
+         recommend starting from version 4.08.2 if you need to
+         bootstrap in this way.</emphasis></para>
+
+         <para>You need a working GHC to use a source distribution.
+          What if you don't have a working GHC? Then you may be able
+          to bootstrap up from the intermediate C
+          (<filename>.hc</filename>) files that we provide.  Building
+          GHC on an unsupported platform falls into this category.
+          Beware: this route is not for the faint hearted!  Please see
+          <Xref LinkEnd="sec-booting-from-C">.</para>
+
+         <para>Once you have built GHC, you can build the other
+          Glasgow tools with it.</para>
+
+         <para>In theory, you can (could?) build GHC with another
+          Haskell compiler (e.g., HBC). We haven't tried to do this
+          for ages and it almost certainly doesn't work any more (for
+          tedious reasons).</para>
+       </listitem>
+      </varlistentry>
+    </variablelist>
+
+    <para>If you are going to do any building from sources (either
+    from a source distribution or the CVS repository) then you need to
+    read all of this manual in detail.</para>
+  </sect1>
+
+  <sect1 id="sec-cvs">
+    <title>Using the CVS repository</title>
+
+    <para>We use <ulink url="http://www.cvshome.org/">CVS</ulink> (Concurrent Version System) to keep track of our
+    sources for various software projects. CVS lets several people
+    work on the same software at the same time, allowing changes to be
+    checked in incrementally. </para>
+
+    <para>This section is a set of guidelines for how to use our CVS
+    repository, and will probably evolve in time. The main thing to
+    remember is that most mistakes can be undone, but if there's
+    anything you're not sure about feel free to bug the local CVS
+    meister (namely Jeff Lewis
+    <email>jlewis@galconn.com</email>). </para>
+
+    <sect2 id="cvs-access">
+      <title>Getting access to the CVS Repository</title>
+
+      <para>You can access the repository in one of two ways:
+      read-only (<xref linkend="cvs-read-only">), or read-write (<xref
+      linkend="cvs-read-write">).</para>
+
+      <sect3 id="cvs-read-only">
+       <title>Remote Read-only CVS Access</title>
+
+       <para>Read-only access is available to anyone - there's no
+        need to ask us first.  With read-only CVS access you can do
+        anything except commit changes to the repository.  You can
+        make changes to your local tree, and still use CVS's merge
+        facility to keep your tree up to date, and you can generate
+        patches using 'cvs diff' in order to send to us for
+        inclusion. </para>
+
+       <para>To get read-only access to the repository:</para>
+
+       <orderedlist>
+         <listitem>
+           <para>Make sure that <application>cvs</application> is
+            installed on your machine.</para>
+         </listitem>
+         <listitem>
+           <para>Set your <literal>$CVSROOT</literal> environment variable to
+            <literal>:pserver:anoncvs@glass.cse.ogi.edu:/cvs</literal></para>
+         </listitem>
+         <listitem>
+            <para>Run the command</para>
+<programlisting>
+    $ cvs login
+</programlisting>
+           <para>The password is simply <literal>cvs</literal>.  This
+            sets up a file in your home directory called
+            <literal>.cvspass</literal>, which squirrels away the
+            dummy password, so you only need to do this step once.</para>
+         </listitem>
+
+         <listitem>
+           <para>Now go to <xref linkend="cvs-first">.</para>
+         </listitem>
+       </orderedlist>
+      </sect3>
 
-<para>
-Once you have built GHC, you can build the other Glasgow tools with
-it.
-</para>
+      <sect3 id="cvs-read-write">
+       <title>Remote Read-Write CVS Access</title>
+
+       <para>We generally supply read-write access to folk doing
+        serious development on some part of the source tree, when
+        going through us would be a pain. If you're developing some
+        feature, or think you have the time and inclination to fix
+        bugs in our sources, feel free to ask for read-write
+        access. There is a certain amount of responsibility that goes
+        with commit privileges; we are more likely to grant you access
+        if you've demonstrated your competence by sending us patches
+        via mail in the past.</para>
+
+       <para>To get remote read-write CVS access, you need to do the
+       following steps.</para>
+
+       <orderedlist>
+         <listitem>
+           <para>Make sure that <literal>cvs</literal> and
+            <literal>ssh</literal> are both installed on your
+            machine.</para>
+         </listitem>
+
+         <listitem>
+           <para>Generate a DSA private-key/public-key pair, thus:</para>
+<screen>
+     $ ssh-keygen -d
+</screen>
+           <para>(<literal>ssh-keygen</literal> comes with
+            <literal>ssh</literal>.)  Running <literal>ssh-keygen
+            -d</literal> creates the private and public keys in
+            <literal>$HOME/.ssh/id_dsa</literal> and
+            <literal>$HOME/.ssh/id_dsa.pub</literal> respectively
+            (assuming you accept the standard defaults).</para>
+
+           <para><literal>ssh-keygen -d</literal> will only work if
+            you have Version 2 <literal>ssh</literal> installed; it
+            will fail harmlessly otherwise.  If you only have Version
+            1 you can instead generate an RSA key pair using plain</para>
+<screen>
+    $ ssh-keygen
+</screen>
 
-<para>
-In theory, you can (could?) build GHC with another Haskell compiler
-(e.g., HBC). We haven't tried to do this for ages and it almost
-certainly doesn't work any more (for tedious reasons).
-</para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term>The CVS repository.</Term>
-<ListItem>
-<para>
-We make releases infrequently.  If you want more up-to-the minute (but
-less tested) source code then you need to get access to our CVS
-repository.
-</para>
+           <para>Doing so creates the private and public RSA keys in
+            <literal>$HOME/.ssh/identity</literal> and
+            <literal>$HOME/.ssh/identity.pub</literal>
+            respectively.</para>
 
-<para>All the <Literal>fptools</Literal> source code is held in a CVS
-repository. CVS is a pretty good source-code control system, and best
-of all it works over the network.</para>
+            <para>[Deprecated.]  Incidentally, you can force a Version
+            2 <literal>ssh</literal> to use the Version 1 protocol by
+            creating <literal>$HOME/config</literal> with the
+            following in it:</para>
+<screen>
+   BatchMode Yes
 
-<para>The repository holds source code only. It holds no mechanically
-generated files at all.  So if you check out a source tree from CVS
-you will need to install every utility so that you can build all the
-derived files from scratch.</para>
+   Host cvs.haskell.org
+   Protocol 1
+</screen>
 
-<para>More information about our CVS repository is available in the
-<ULink URL="http://www.haskell.org/ghc/cvs-cheat-sheet.html">fptools
-CVS Cheat Sheet</ULink>.</para>
+           <para>In both cases, <literal>ssh-keygen</literal> will
+            ask for a <firstterm>passphrase</firstterm>.  The
+            passphrase is a password that protects your private key.
+            In response to the 'Enter passphrase' question, you can
+            either:</para>
+           <itemizedlist>
+             <listitem>
+               <para>[Recommended.]  Enter a passphrase, which you
+                will quote each time you use CVS.
+                <literal>ssh-agent</literal> makes this entirely
+                un-tiresome.</para>
+             </listitem>
+             <listitem>
+               <para>[Deprecated.] Just hit return (i.e. use an empty
+                passphrase); then you won't need to quote the
+                passphrase when using CVS.  The downside is that
+                anyone who can see into your <literal>.ssh</literal>
+                directory, and thereby get your private key, can mess
+                up the repository.  So you must keep the
+                <literal>.ssh</literal> directory with draconian
+                no-access permissions.</para>
+             </listitem>
+           </itemizedlist>
+
+
+       <para>
+       [Windows users.] The programs <command>ssh-keygen1</command>, <command>ssh1</command>, and <command>cvs</command>,
+       seem to lock up <command>bash</command> entirely if they try to get user input (e.g. if
+       they ask for a password).  To solve this, start up <filename>cmd.exe</filename> 
+       and run it as follows:
+       <Screen>
+       c:\tmp> set CYGWIN32=tty
+       c:\tmp> c:/user/local/bin/ssh-keygen1
+       </Screen> </para>
+
+           <para>[Windows users.] To protect your
+            <literal>.ssh</literal> from access by anyone else,
+            right-click your <literal>.ssh</literal> directory, and
+            select <literal>Properties</literal>.  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!</para>
+         </listitem>
+
+         <listitem>
+           <para>Send a message to to the CVS repository
+            administrator (currently Jeff Lewis
+            <email>jeff@galconn.com</email>), containing:</para>
+           <itemizedlist>
+             <listitem>
+               <para>Your desired user-name.</para>
+             </listitem>
+             <listitem>
+               <para>Your <literal>.ssh/id_dsa.pub</literal> (or
+                <literal>.ssh/identity.pub</literal>).</para>
+             </listitem>
+           </itemizedlist>
+           <para>He will set up your account.</para>
+         </listitem>
+
+         <listitem>
+           <para>Set the following environment variables:</para>
+          <ItemizedList>
+          <listitem>
+          <para>
+          <constant>$HOME</constant>: points to your home directory.  This is where CVS
+          will look for its <filename>.cvsrc</filename> file.
+          </para>
+          </listitem>
+
+          <listitem>
+          <para>
+          <constant>$CVS_RSH</constant> to <filename>ssh</filename>
+          </para>
+          <para>[Windows users.] Setting your <literal>CVS_RSH</literal> to
+            <literal>ssh</literal> assumes that your CVS client
+            understands how to execute shell script
+            (&quot;#!&quot;s,really), which is what
+            <literal>ssh</literal> is. This may not be the case on
+            Win32 platforms, so in that case set <literal>CVS_RSH</literal> to
+            <literal>ssh1</literal>.</para>
+          </listitem>
+
+             <listitem>
+               <para><literal>$CVSROOT</literal> to
+               <literal>:ext:</literal><replaceable>your-username</replaceable>
+                <literal>@cvs.haskell.org:/home/cvs/root</literal>
+               where <replaceable>your-username</replaceable> is your user name on
+               <literal>cvs.haskell.org</literal>.
+               </para>
+       <para>The <literal>CVSROOT</literal> environment variable will
+        be recorded in the checked-out tree, so you don't need to set
+        this every time. </para>
+
+            </listitem>
+
+       <listitem>
+       <para>
+       <constant>$CVSEDITOR</constant>: <filename>bin/gnuclient.exe</filename> 
+       if you want to use an Emacs buffer for typing in those long commit messages.
+       </para>
+       </listitem>
 
-</ListItem></VarListEntry>
-</VariableList>
-</para>
+       <listitem>
+       <para>
+       <constant>$SHELL</constant>: To use bash as the shell in Emacs, you need to
+       set this to point to <Filename>bash.exe</Filename>.
+       </para>
+       </listitem>
 
-<para>If you are going to do any building from sources (either from a
-source distribution or the CVS repository) then you need to read all
-of this manual in detail.</para>
+       </ItemizedList>
 
-</Sect1>
 
-<Sect1 id="sec-build-checks">
-<Title>Things to check before you start</Title>
+         </listitem>
 
-<para>
-Here's a list of things to check before you get started.
+         <listitem>
+         <para>
+         Put the following in <filename>$HOME/.cvsrc</filename>:
+         </para>
+         
+         <ProgramListing>
+         checkout -P
+         release -d
+         update -P
+         diff -u
+         </ProgramListing>
+         
+         <para>
+         These are the default options for the specified CVS commands,
+         and represent better defaults than the usual ones.  (Feel
+         free to change them.)
+         </para>
+         
+         <para>
+         [Windows users.]  Filenames starting with <filename>.</filename> 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; <filename>.cvsrc</filename> is entirely
+         optional.
+         </para>
+         </listitem>
+
+       </orderedlist>
+
+
+       <para>[Experts.]  Once your account is set up, you can get
+        access from other machines without bothering Jeff, thus:</para>
+       <orderedlist>
+         <listitem>
+           <para>Generate a public/private key pair on the new
+            machine.</para>
+         </listitem>
+         <listitem>
+           <para>Use ssh to log in to
+            <literal>cvs.haskell.org</literal>, from your old
+            machine.</para>
+         </listitem>
+         <listitem>
+           <para>Add the public key for the new machine to the file
+            <literal>$HOME/ssh/authorized_keys</literal> on
+            <literal>cvs.haskell.org</literal>.
+            (<literal>authorized_keys2</literal>, I think, for Version
+            2 protocol.)</para>
+         </listitem>
+         <listitem>
+           <para>Make sure that the new version of
+            <literal>authorized_keys</literal> still has 600 file
+            permissions.</para>
+         </listitem>
+       </orderedlist>
+      </sect3>
+    </sect2>
 
-<OrderedList>
-<ListItem>
 
-<para>
-<IndexTerm><Primary>Disk space needed</Primary></IndexTerm>
-Disk space needed: About 40MB (one tenth of one hamburger's worth) of disk
-space for the most basic binary distribution of GHC; more for some
-platforms, e.g., Alphas.  An extra ``bundle'' (e.g., concurrent Haskell
-libraries) might take you to up to one fifth of a hamburger. You'll need
-over 100MB (say, one fifth a hamburger's worth) if you need to build the
-basic stuff from scratch. All of the above are
-<Emphasis>estimates</Emphasis> of disk-space needs. (Note: our benchmark hamburger is a standard Double Whopper with Cheese, with an RRP of UKP2.99.)
-</para>
-</ListItem>
-<ListItem>
 
-<para>
-Use an appropriate machine, compilers, and things.  SPARC boxes, and
-PCs running Linux, BSD (any variant), or Solaris are all fully
-supported.  Win32 and HP boxes are in pretty good shape.  DEC Alphas
-running OSF/1, Linux or some BSD variant, MIPS and AIX boxes will need
-some minimal porting effort before they work (as of 4.06).  <Xref
-LinkEnd="sec-port-info"> gives the full run-down on ports or lack
-thereof.
-</para>
-</ListItem>
-<ListItem>
+    <sect2 id="cvs-first">
+      <title>Checking Out a Source Tree</title>
 
-<para>
- Be sure that the ``pre-supposed'' utilities are installed.
-<Xref LinkEnd="sec-pre-supposed"> elaborates.
+      <itemizedlist>
+       <listitem>
+         <para>Make sure you set your <literal>CVSROOT</literal>
+          environment variable according to either of the remote
+          methods above. The Approved Way to check out a source tree
+          is as follows:</para>
+
+<screen>
+    $ cvs checkout fpconfig
+</screen>
+
+         <para>At this point you have a new directory called
+          <literal>fptools</literal> which contains the basic stuff
+          for the fptools suite, including the configuration files and
+          some other junk. </para>
 
+<para>[Windows users.]  The following messages appear to be harmless:
+<Screen>
+setsockopt IPTOS_LOWDELAY: Invalid argument
+setsockopt IPTOS_THROUGHPUT: Invalid argument
+</Screen>
 </para>
-</ListItem>
-<ListItem>
 
-<para>
- If you have any problem when building or installing the Glasgow
-tools, please check the ``known pitfalls'' (<Xref
-LinkEnd="sec-build-pitfalls">).  Also check the FAQ for the version
-you're building, which should be available from the relevant download
-page on the <ULink URL="http://www.haskell.org/ghc/" >GHC web
-site</ULink>.
 
-<IndexTerm><Primary>known bugs</Primary></IndexTerm>
-<IndexTerm><Primary>bugs, known</Primary></IndexTerm>
+         <para>You can call the fptools directory whatever you like,
+          CVS won't mind: </para>
+         
+<screen>
+    $ mv fptools <replaceable>directory</replaceable>
+</screen>
 
-If you feel there is still some shortcoming in our procedure or
-instructions, please report it.
+         <para> NB: after you've read the CVS manual you might be
+          tempted to try</para>
+<screen>
+    $ cvs checkout -d <replaceable>directory</replaceable> fpconfig
+</screen>
 
-For GHC, please see the bug-reporting section of the GHC Users' Guide
-(separate document), to maximise the usefulness of your report.
-<IndexTerm><Primary>bugs, reporting</Primary></IndexTerm>
+         <para>instead of checking out <literal>fpconfig</literal>
+          and then renaming it.  But this doesn't work, and will
+          result in checking out the entire repository instead of just
+          the <literal>fpconfig</literal> bit.</para>
+<screen>
+    $ cd <replaceable>directory</replaceable>
+    $ cvs checkout ghc hslibs
+</screen>
 
-If in doubt, please send a message to
-<Email>glasgow-haskell-bugs@haskell.org</Email>.
-<IndexTerm><Primary>bugs, mailing list</Primary></IndexTerm>
-</para>
-</ListItem>
+         <para>The second command here checks out the relevant
+          modules you want to work on. For a GHC build, for instance,
+          you need at least the <literal>ghc</literal> and
+          <literal>hslibs</literal> modules (for a full list of the
+          projects available, see <xref linkend="projects">).</para>
+       </listitem>
+      </itemizedlist>
+    </sect2>
 
-</OrderedList>
+    <sect2 id="cvs-committing">
+      <title>Committing Changes</title>
+
+      <para>This is only if you have read-write access to the
+      repository. For anoncvs users, CVS will issue a &quot;read-only
+      repository&quot; error if you try to commit changes.</para>
+
+      <itemizedlist>
+       <listitem>
+         <para>Build the software, if necessary. Unless you're just
+          working on documentation, you'll probably want to build the
+          software in order to test any changes you make.</para>
+       </listitem>
+
+       <listitem>
+         <para>Make changes. Preferably small ones first.</para>
+       </listitem>
+
+       <listitem>
+         <para>Test them. You can see exactly what changes you've
+          made by using the <literal>cvs diff</literal> command:</para>
+<screen>
+$ cvs diff
+</screen>
+         <para>lists all the changes (using the
+          <literal>diff</literal> command) in and below the current
+          directory. In emacs, <literal>C-c C-v =</literal> runs
+          <literal>cvs diff</literal> on the current buffer and shows
+          you the results.</para>
+       </listitem>
+
+      <listitem>
+         <para>Before checking in a change, you need to update your
+          source tree:</para>
+
+<screen>
+$ cd fptools
+$ cvs update
+</screen>
+         <para>This pulls in any changes that other people have made,
+          and merges them with yours. If there are any conflicts, CVS
+          will tell you, and you'll have to resolve them before you
+          can check your changes in. The documentation describes what
+          to do in the event of a conflict.</para>
+
+         <para>It's not always necessary to do a full cvs update
+          before checking in a change, since CVS will always tell you
+          if you try to check in a file that someone else has changed.
+          However, you should still update at regular intervals to
+          avoid making changes that don't work in conjuction with
+          changes that someone else made. Keeping an eye on what goes
+          by on the mailing list can help here.</para>
+       </listitem>
+
+       <listitem>
+         <para>When you're happy that your change isn't going to
+          break anything, check it in. For a one-file change:</para>
+
+<screen>
+$ cvs commit <replaceable>filename</replaceable>
+</screen>
 
-</para>
+         <para>CVS will then pop up an editor for you to enter a
+          &quot;commit message&quot;, this is just a short description
+          of what your change does, and will be kept in the history of
+          the file.</para>
 
-</Sect1>
+         <para>If you're using emacs, simply load up the file into a
+          buffer and type <literal>C-x C-q</literal>, and emacs will
+          prompt for a commit message and then check in the file for
+          you.</para>
+
+         <para>For a multiple-file change, things are a bit
+          trickier. There are several ways to do this, but this is the
+          way I find easiest. First type the commit message into a
+          temporary file. Then either</para>
+
+<screen>
+$ cvs commit -F <replaceable>commit-message</replaceable> <replaceable>file_1</replaceable> .... <replaceable>file_n</replaceable>
+</screen>
+
+         <para>or, if nothing else has changed in this part of the
+          source tree, </para>
+
+<screen>
+$ cvs commit -F <replaceable>commit-message</replaceable> <replaceable>directory</replaceable>
+</screen>
+
+          <para>where <replaceable>directory</replaceable> is a common
+          parent directory for all your changes, and
+          <replaceable>commit-message</replaceable> is the name of the
+          file containing the commit message.</para>
+
+         <para>Shortly afterwards, you'll get some mail from the
+          relevant mailing list saying which files changed, and giving
+          the commit message. For a multiple-file change, you should
+          still get only <emphasis>one</emphasis> message.</para>
+       </listitem>
+      </itemizedlist>
+    </sect2>
+
+    <sect2 id="cvs-update">
+      <title>Updating Your Source Tree</title>
+
+      <para>It can be tempting to cvs update just part of a source
+      tree to bring in some changes that someone else has made, or
+      before committing your own changes. This is NOT RECOMMENDED!
+      Quite often changes in one part of the tree are dependent on
+      changes in another part of the tree (the
+      <literal>mk/*.mk</literal> files are a good example where
+      problems crop up quite often). Having an inconsistent tree is a
+      major cause of headaches. </para>
+
+      <para>So, to avoid a lot of hassle, follow this recipe for
+      updating your tree: </para>
+
+<screen>
+$ cd fptools
+$ cvs update -Pd 2&gt;&amp;1 | tee log</screen>
+
+      <para>Look at the log file, and fix any conflicts (denoted by a
+      <quote>C</quote> in the first column). If you're using multiple
+      build trees, then for every build tree you have pointing at this
+      source tree, you need to update the links in case any new files
+      have appeared: </para>
+
+<screen>
+$ cd <replaceable>build-tree</replaceable>
+$ lndir <replaceable>source-tree</replaceable>
+</screen>
+
+      <para>Some files might have been removed, so you need to remove
+      the links pointing to these non-existent files:</para>
+
+<screen>
+$ find . -xtype l -exec rm '{}' \;
+</screen>
+
+      <para>To be <emphasis>really</emphasis> safe, you should do
+      </para>
+
+<screen>$ gmake all</screen>
+
+      <para>from the top-level, to update the dependencies and build
+      any changed files. </para>
+    </sect2>
+
+    <sect2 id="cvs-tags">
+      <title>GHC Tag Policy</title>
+
+      <para>If you want to check out a particular version of GHC,
+      you'll need to know how we tag versions in the repository.  The
+      policy (as of 4.04) is:</para>
+
+      <itemizedlist>
+       <listitem>
+         <para>The tree is branched before every major release.  The
+          branch tag is <literal>ghc-x-xx-branch</literal>, where
+          <literal>x-xx</literal> is the version number of the release
+          with the <literal>'.'</literal> replaced by a
+          <literal>'-'</literal>.  For example, the 4.04 release lives
+          on <literal>ghc-4-04-branch</literal>.</para>
+       </listitem>
+
+       <listitem>
+         <para>The release itself is tagged with
+          <literal>ghc-x-xx</literal> (on the branch).  eg. 4.06 is
+          called <literal>ghc-4-06</literal>.</para>
+       </listitem>
+
+       <listitem>
+         <para>We didn't always follow these guidelines, so to see
+          what tags there are for previous versions, do <literal>cvs
+          log</literal> on a file that's been around for a while (like
+          <literal>fptools/ghc/README</literal>).</para>
+       </listitem>
+      </itemizedlist>
+
+      <para>So, to check out a fresh GHC 4.06 tree you would
+      do:</para>
+
+<screen>
+     $ cvs co -r ghc-4-06 fpconfig
+     $ cd fptools
+     $ cvs co -r ghc-4-06 ghc hslibs
+</screen>
+    </sect2>
+
+    <sect2 id="cvs-hints">
+      <title>General Hints</title>
+
+      <itemizedlist>
+       <listitem>
+         <para>As a general rule: commit changes in small units,
+          preferably addressing one issue or implementing a single
+          feature.  Provide a descriptive log message so that the
+          repository records exactly which changes were required to
+          implement a given feature/fix a bug. I've found this
+          <emphasis>very</emphasis> useful in the past for finding out
+          when a particular bug was introduced: you can just wind back
+          the CVS tree until the bug disappears.</para>
+       </listitem>
+
+       <listitem>
+         <para>Keep the sources at least *buildable* at any given
+          time. No doubt bugs will creep in, but it's quite easy to
+          ensure that any change made at least leaves the tree in a
+          buildable state. We do nightly builds of GHC to keep an eye
+          on what things work/don't work each day and how we're doing
+          in relation to previous verions. This idea is truely wrecked
+          if the compiler won't build in the first place!</para>
+       </listitem>
+
+       <listitem>
+         <para>To check out extra bits into an already-checked-out
+          tree, use the following procedure.  Suppose you have a
+          checked-out fptools tree containing just ghc, and you want
+          to add nofib to it:</para>
+
+<screen>
+$ cd fptools
+$ cvs checkout nofib
+</screen>
+
+         <para>or: </para>
+
+<screen>
+$ cd fptools
+$ cvs update -d nofib
+</screen>
+         
+         <para>(the -d flag tells update to create a new
+          directory). If you just want part of the nofib suite, you
+          can do </para>
+
+<screen>
+$ cd fptools
+$ cvs checkout nofib/spectral
+</screen>
+
+         <para>This works because <literal>nofib</literal> is a
+          module in its own right, and spectral is a subdirectory of
+          the nofib module. The path argument to checkout must always
+          start with a module name. There's no equivalent form of this
+          command using <literal>update</literal>.</para>
+       </listitem>
+      </itemizedlist>
+    </sect2>
+  </sect1>
+
+  <sect1 id="projects">
+    <title>What projects are there?</title>
+
+    <para>The <literal>fptools</literal> suite consists of several
+    <firstterm>projects</firstterm>, most of which can be downloaded,
+    built and installed individually.  Each project corresponds to a
+    subdirectory in the source tree, and if checking out from CVS then
+    each project can be checked out individually by sitting in the top
+    level of your source tree and typing <command>cvs checkout
+    <replaceable>project</replaceable></command>.</para>
+
+    <para>Here is a list of the projects currently available:</para>
+
+    <variablelist>
+      <varlistentry>
+       <term><literal>ghc</literal></term>
+       <indexterm><primary><literal>ghc</literal></primary>
+       <secondary>project</secondary></indexterm>
+       <listitem>
+         <para>The <ulink url="http://www.haskell.org/ghc/">Glasgow
+         Haskell Compiler</ulink> (minus libraries).  Absolutely
+         required for building GHC.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term><literal>glafp-utils</literal></term>
+       <indexterm><primary><literal>glafp-utils</literal></primary><secondary>project</secondary></indexterm>
+       <listitem>
+         <para>Utility programs, some of which are used by the
+         build/installation system.  Required for pretty much
+         everything.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term><literal>green-card</literal></term>
+       <indexterm><primary><literal>green-card</literal></primary><secondary>project</secondary></indexterm>
+       <listitem>
+         <para>The <ulink
+         url="http://www.haskell.org/greencard/">Green Card</ulink>
+         system for generating Haskell foreign function
+         interfaces.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term><literal>haggis</literal></term>
+       <indexterm><primary><literal>haggis</literal></primary><secondary>project</secondary></indexterm>
+       <listitem>
+         <para>The <ulink
+         url="http://www.dcs.gla.ac.uk/fp/software/haggis/">Haggis</ulink>
+         Haskell GUI framework.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term><literal>happy</literal></term>
+       <indexterm><primary><literal>happy</literal></primary><secondary>project</secondary></indexterm>
+       <listitem>
+         <para>The <ulink
+         url="http://www.haskell.org/happy/">Happy</ulink> Parser
+         generator.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term><literal>hdirect</literal></term>
+       <indexterm><primary><literal>hdirect</literal></primary><secondary>project</secondary></indexterm>
+       <listitem>
+         <para>The <ulink
+         url="http://www.haskell.org/hdirect/">H/Direct</ulink>
+         Haskell interoperability tool.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term><literal>hood</literal></term>
+       <indexterm><primary><literal>hood</literal></primary><secondary>project</secondary></indexterm>
+       <listitem>
+         <para>The <ulink url="http://www.haskell.org/hood/">Haskell
+         Object Observation Debugger</ulink>.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term><literal>hslibs</literal></term>
+       <indexterm><primary><literal>hslibs</literal></primary><secondary>project</secondary></indexterm>
+       <listitem>
+         <para>GHC's libraries.  Required for building GHC.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term><literal>libraries</literal></term>
+       <indexterm><primary><literal></literal></primary><secondary>project</secondary></indexterm>
+       <listitem>
+         <para>Hierarchical Haskell library suite
+         (experimental).</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term><literal>mhms</literal></term>
+       <indexterm><primary><literal></literal></primary><secondary>project</secondary></indexterm>
+       <listitem>
+         <para>The Modular Haskell Metric System.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term><literal>nofib</literal></term>
+       <indexterm><primary><literal>nofib</literal></primary><secondary>project</secondary></indexterm>
+       <listitem>
+         <para>The NoFib suite: A collection of Haskell programs used
+         primarily for benchmarking.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term><literal>testsuite</literal></term>
+       <indexterm><primary><literal>testsuite</literal></primary><secondary>project</secondary></indexterm>
+       <listitem>
+         <para>A testing framework, including GHC's regression test
+         suite.</para>
+       </listitem>
+      </varlistentry>
+    </variablelist>
+
+    <para>So, to build GHC you need at least the
+    <literal>ghc</literal> and <literal>hslibs</literal> projects (a
+    GHC source distribution will already include the bits you
+    need).</para>
+  </sect1>
+
+  <sect1 id="sec-build-checks">
+    <title>Things to check before you start</title>
+
+    <para>Here's a list of things to check before you get
+    started.</para>
+
+    <orderedlist>
+
+      <listitem>
+       <indexterm><primary>Disk space needed</primary></indexterm>
+       <para>Disk space needed: from about 100Mb for a basic GHC
+       build, up to probably 500Mb for a GHC build with everything
+       included (libraries built several different ways,
+       etc.).</para>
+      </listitem>
+
+      <listitem>
+       <para>Use an appropriate machine, compilers, and things.
+        SPARC boxes, PCs running Linux or FreeBSD, and Alphas running
+        OSF/1 are all fully supported.  Win32 and HP boxes are in
+        pretty good shape.  PCs running Solaris, DEC Alphas running
+        Linux or some BSD variant, MIPS and AIX boxes will need some
+        minimal porting effort before they work (as of 4.06).  <xref
+        linkend="sec-port-info"> gives the full run-down on ports or
+        lack thereof.</para>
+      </listitem>
+
+      <listitem>
+       <para>Be sure that the ``pre-supposed'' utilities are
+        installed.  <Xref LinkEnd="sec-pre-supposed">
+        elaborates.</para>
+      </listitem>
+
+      <listitem>
+       <para>If you have any problem when building or installing the
+        Glasgow tools, please check the ``known pitfalls'' (<Xref
+        LinkEnd="sec-build-pitfalls">).  Also check the FAQ for the
+        version you're building, which should be available from the
+        relevant download page on the <ULink
+        URL="http://www.haskell.org/ghc/" >GHC web
+        site</ULink>.</para>
+
+       <indexterm><primary>known bugs</primary></indexterm>
+       <indexterm><primary>bugs, known</primary></indexterm>
+
+       <para>If you feel there is still some shortcoming in our
+        procedure or instructions, please report it.</para>
+
+       <para>For GHC, please see the bug-reporting section of the GHC
+        Users' Guide (separate document), to maximise the usefulness
+        of your report.</para>
+
+       <indexterm><primary>bugs</primary><secondary>seporting</secondary></indexterm>
+
+       <para>If in doubt, please send a message to
+<email>glasgow-haskell-bugs@haskell.org</email>.
+<indexterm><primary>bugs</primary><secondary>mailing
+list</secondary></indexterm></para>
+
+      </listitem>
+    </orderedlist>
+  </sect1>
 
 <Sect1 id="sec-port-info">
 <Title>What machines the Glasgow tools run on
 </Title>
 
 <para>
-<IndexTerm><Primary>ports, GHC</Primary></IndexTerm>
-<IndexTerm><Primary>GHC ports</Primary></IndexTerm>
-<IndexTerm><Primary>supported platforms</Primary></IndexTerm>
-<IndexTerm><Primary>platforms, supported</Primary></IndexTerm>
+<indexterm><primary>ports, GHC</primary></indexterm>
+<indexterm><primary>GHC ports</primary></indexterm>
+<indexterm><primary>supported platforms</primary></indexterm>
+<indexterm><primary>platforms, supported</primary></indexterm>
 The main question is whether or not the Haskell compiler (GHC) runs on
 your platform.
 </para>
@@ -263,10 +996,10 @@ supports the underlying BSDisms.
 <Title>What platforms the Haskell compiler (GHC) runs on</Title>
 
 <para>
-<IndexTerm><Primary>fully-supported platforms</Primary></IndexTerm>
-<IndexTerm><Primary>native-code generator</Primary></IndexTerm>
-<IndexTerm><Primary>registerised ports</Primary></IndexTerm>
-<IndexTerm><Primary>unregisterised ports</Primary></IndexTerm>
+<indexterm><primary>fully-supported platforms</primary></indexterm>
+<indexterm><primary>native-code generator</primary></indexterm>
+<indexterm><primary>registerised ports</primary></indexterm>
+<indexterm><primary>unregisterised ports</primary></indexterm>
 The GHC hierarchy of Porting Goodness: (a)&nbsp;Best is a native-code
 generator; (b)&nbsp;next best is a ``registerised''
 port; (c)&nbsp;the bare minimum is an ``unregisterised'' port.
@@ -283,161 +1016,160 @@ Here's everything that's known about GHC ports.  We identify platforms
 by their ``canonical'' CPU/Manufacturer/OS triple.
 </para>
 
-<para>
-<VariableList>
-
-<VarListEntry>
-<Term>alpha-dec-{osf,linux,freebsd,openbsd,netbsd}:</Term>
-<IndexTerm><Primary>alpha-dec-osf</Primary></IndexTerm>
-<IndexTerm><Primary>alpha-dec-linux</Primary></IndexTerm>
-<IndexTerm><Primary>alpha-dec-freebsd</Primary></IndexTerm>
-<IndexTerm><Primary>alpha-dec-openbsd</Primary></IndexTerm>
-<IndexTerm><Primary>alpha-dec-netbsd</Primary></IndexTerm>
-<ListItem>
-
-<para>
-Currently non-working.  The last working version (osf[1-3]) is GHC
-3.02.  A small amount of porting effort will be required to get Alpha
-support into GHC 4.xx, but we don't have easy access to machines right
-now, and there hasn't been a massive demand for support, so Alphas
-remain unsupported for the time being.  Please get in touch if you
-either need Alpha support and/or can provide access to boxes.
-</para>
-
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term>sparc-sun-sunos4:</Term>
-<IndexTerm><Primary>sparc-sun-sunos4</Primary></IndexTerm>
-<ListItem>
-
-<para>
-Probably works with minor tweaks, hasn't been tested for a while.
-</para>
-
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term>sparc-sun-solaris2:</Term>
-<IndexTerm><Primary>sparc-sun-solaris2</Primary></IndexTerm>
-<ListItem>
-
-<para>
-Fully supported, including native-code generator.
-</para>
-
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term>hppa1.1-hp-hpux (HP-PA boxes running HPUX 9.x)</Term>
-<IndexTerm><Primary>hppa1.1-hp-hpux</Primary></IndexTerm>
-<ListItem>
-
-<para>
-Works registerised.  No native-code generator.
-</para>
-
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term>i386-unknown-linux (PCs running Linux&mdash;ELF binary format):</Term>
-<IndexTerm><Primary>i386-*-linux</Primary></IndexTerm>
-<ListItem>
-
-<para>GHC works registerised and has a native code generator.  You
-<Emphasis>must</Emphasis> have GCC 2.7.x or later.  NOTE about
-<literal>glibc</literal> versions: GHC binaries built on a system
-running <literal>glibc 2.0</literal> won't work on a system running
-<literal>glibc 2.1</literal>, and vice versa.  In general, don't
-expect compatibility between <literal>glibc</literal> versions, even
-if the shared library version hasn't changed.
-</para>
-
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term>i386-unknown-{freebsd,netbsd,openbsd) (PCs running FreeBSD 2.2
-or higher, NetBSD, and possibly OpenBSD):</Term>
-<IndexTerm><Primary>i386-unknown-freebsd</Primary></IndexTerm> 
-<IndexTerm><Primary>i386-unknown-netbsd</Primary></IndexTerm> 
-<IndexTerm><Primary>i386-unknown-openbsd</Primary></IndexTerm> 
-<ListItem>
-
-<para>
-GHC works registerised.  These systems provide ready-built packages of
-GHC, so if you just need binaries you're better off just installing
-the package.
-</para>
-
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term>i386-unknown-cygwin32:</Term>
-<IndexTerm><Primary>i386-unknown-cygwin32</Primary></IndexTerm>
-<ListItem>
-
-<para>
-Fully supported under Win9x/NT, including a native code
-generator. Requires the <Literal>cygwin32</Literal> compatibility
-library and a healthy collection of GNU tools (i.e., gcc, GNU ld, bash
-etc.).
-</para>
-
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term>mips-sgi-irix5:</Term>
-<IndexTerm><Primary>mips-sgi-irix[5-6]</Primary></IndexTerm>
-<ListItem>
-
-<para>
-Port currently doesn't work, needs some minimal porting effort.  As
-usual, we don't have access to machines and there hasn't been an
-overwhelming demand for this port, but feel free to get in touch.
-</para>
-</ListItem></VarListEntry>
-
-<VarListEntry>
-<Term>powerpc-ibm-aix:</Term>
-<ListItem>
-<para>
-<IndexTerm><Primary>powerpc-ibm-aix</Primary></IndexTerm>
-Port currently doesn't work, needs some minimal porting effort.  As
-usual, we don't have access to machines and there hasn't been an
-overwhelming demand for this port, but feel free to get in touch.
-</para>
-</ListItem></VarListEntry>
-
-</VariableList>
-</para>
-
-<para>
-Various other systems have had GHC ported to them in the distant past,
-including various Motorola 68k boxes.  The 68k support still remains,
-but porting to one of these systems will certainly be a non-trivial
-task.
-</para>
-
-</Sect2>
-
-<Sect2>
-<Title>What machines the other tools run on</Title>
-
-<para>
-Unless you hear otherwise, the other tools work if GHC works.
-</para>
+      <variablelist>
+
+       <varlistentry>
+         <term>alpha-dec-{osf,linux,freebsd,openbsd,netbsd}:</term>
+         <indexterm><primary>alpha-dec-osf</primary></indexterm>
+         <indexterm><primary>alpha-dec-linux</primary></indexterm>
+         <indexterm><primary>alpha-dec-freebsd</primary></indexterm>
+         <indexterm><primary>alpha-dec-openbsd</primary></indexterm>
+         <indexterm><primary>alpha-dec-netbsd</primary></indexterm>
+         
+         <listitem>
+           <para>The OSF port is currently working (as of GHC version
+           5.02.1) and well supported.  The native code generator is
+           currently non-working.  Other operating systems will
+           require some minor porting.</para>
+         </listitem>
+       </varlistentry>
+
+       <varlistentry>
+         <term>sparc-sun-sunos4</term>
+         <indexterm><primary>sparc-sun-sunos4</primary></indexterm>
+         <listitem>
+           <para>Probably works with minor tweaks, hasn't been tested
+           for a while.</para>
+         </listitem>
+       </varlistentry>
+
+       <varlistentry>
+         <term>sparc-sun-solaris2</term>
+         <indexterm><primary>sparc-sun-solaris2</primary></indexterm>
+         <listitem>
+           <para>Fully supported, including native-code
+           generator.</para>
+         </listitem>
+       </varlistentry>
+
+       <varlistentry>
+         <term>hppa1.1-hp-hpux (HP-PA boxes running HPUX 9.x)</term>
+         <indexterm><primary>hppa1.1-hp-hpux</primary></indexterm>
+         <listitem>
+           <para>Works registerised.  No native-code
+           generator.</para>
+         </listitem>
+       </varlistentry>
+
+       <varlistentry>
+         <term>i386-unknown-linux (PCs running Linux, ELF binary format)</term>
+         <indexterm><primary>i386-*-linux</primary></indexterm>
+         <listitem>
+           <para>GHC works registerised and has a native code
+            generator.  You <Emphasis>must</Emphasis> have GCC 2.7.x
+            or later.  NOTE about <literal>glibc</literal> versions:
+            GHC binaries built on a system running <literal>glibc
+            2.0</literal> won't work on a system running
+            <literal>glibc 2.1</literal>, and vice versa.  In general,
+            don't expect compatibility between
+            <literal>glibc</literal> versions, even if the shared
+            library version hasn't changed.</para>
+         </listitem>
+       </varlistentry>
+
+       <varlistentry>
+         <term>i386-unknown-freebsd (PCs running FreeBSD 2.2
+or higher)</term>
+         <indexterm><primary>i386-unknown-freebsd</primary></indexterm>
+         <listitem>
+           <para>GHC works registerised.  Pre-built packages are
+            available in the native package format, so if you just
+            need binaries you're better off just installing the
+            package.</para>
+         </listitem>
+       </varlistentry>
+       
+       <varlistentry>
+         <term>i386-unknown-{netbsd,openbsd) (PCs running NetBSD
+           and OpenBSD)</term>
+         <indexterm><primary>i386-unknown-netbsd</primary></indexterm> 
+         <indexterm><primary>i386-unknown-openbsd</primary></indexterm> 
+         <listitem>
+           <para>Will require some minor porting effort, but should
+           work registerised.</para>
+         </listitem>
+       </varlistentry>
+
+       <varlistentry>
+         <term>i386-unknown-mingw32:</term>
+         <indexterm><primary>i386-unknown-mingw32</primary></indexterm>
+         <listitem>
+           <para>Fully supported under Win9x, WinNT, Win2k, and
+            WinXP.  Includes a native code generator.  Building from
+            source requires a recent <Literal>cygwin32</Literal>
+            distribution to be installed.</para>
+         </listitem>
+       </varlistentry>
+
+       <varlistentry>
+         <term>mips-sgi-irix5</term>
+         <indexterm><primary>mips-sgi-irix[5-6]</primary></indexterm>
+         <listitem>
+           <para>Port currently doesn't work, needs some minimal
+            porting effort.  As usual, we don't have access to
+            machines and there hasn't been an overwhelming demand for
+            this port, but feel free to get in touch.</para>
+         </listitem>
+       </varlistentry>
+
+       <varlistentry>
+         <term>powerpc-ibm-aix</term>
+         <indexterm><primary>powerpc-ibm-aix</primary></indexterm>
+         <listitem>
+           <para>Port currently doesn't work, needs some minimal
+            porting effort.  As usual, we don't have access to
+            machines and there hasn't been an overwhelming demand for
+            this port, but feel free to get in touch.</para>
+         </listitem>
+       </varlistentry>
+
+       <varlistentry>
+         <term>powerpc-apple-darwin</term>
+         <indexterm><primary>powerpc-apple-darwin</primary></indexterm> 
+         <listitem>
+           <para>Works, unregisterised only at the moment.</para>
+         </listitem>
+       </varlistentry>
+      </variablelist>
+
+      <para>Various other systems have had GHC ported to them in the
+      distant past, including various Motorola 68k boxes.  The 68k
+      support still remains, but porting to one of these systems will
+      certainly be a non-trivial task.</para>
+    </sect2>
 
-</Sect2>
+    <sect2>
+      <title>What machines the other tools run on</title>
 
-</Sect1>
+      <para>Unless you hear otherwise, the other tools work if GHC
+      works.</para>
+    </sect2>
+  </sect1>
 
 
 <Sect1 id="sec-pre-supposed">
 <Title>Installing pre-supposed utilities
 
-<IndexTerm><Primary>pre-supposed utilities</Primary></IndexTerm>
-<IndexTerm><Primary>utilities, pre-supposed</Primary></IndexTerm></Title>
+<indexterm><primary>pre-supposed utilities</primary></indexterm>
+<indexterm><primary>utilities, pre-supposed</primary></indexterm></Title>
 
 <para>
 Here are the gory details about some utility programs you may need;
 <Command>perl</Command>, <Command>gcc</Command> and
 <command>happy</command> are the only important
-ones. (PVM<IndexTerm><Primary>PVM</Primary></IndexTerm> is important
+ones. (PVM<indexterm><primary>PVM</primary></indexterm> is important
 if you're going for Parallel Haskell.)  The
-<Command>configure</Command><IndexTerm><Primary>configure</Primary></IndexTerm>
+<Command>configure</Command><indexterm><primary>configure</primary></indexterm>
 script will tell you if you are missing something.
 </para>
 
@@ -445,10 +1177,10 @@ script will tell you if you are missing something.
 <VariableList>
 
 <VarListEntry>
-<Term>Perl:</Term>
-<IndexTerm><Primary>pre-supposed: Perl</Primary></IndexTerm>
-<IndexTerm><Primary>Perl, pre-supposed</Primary></IndexTerm>
-<ListItem>
+<term>Perl:</term>
+<indexterm><primary>pre-supposed: Perl</primary></indexterm>
+<indexterm><primary>Perl, pre-supposed</primary></indexterm>
+<listitem>
 <para>
 <Emphasis>You have to have Perl to proceed!</Emphasis>
 It is pretty easy to install.
@@ -467,12 +1199,12 @@ pathname may need to be less than 32 characters long on some
 systems.
 </para>
 
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 <VarListEntry>
-<Term>GNU C (<Command>gcc</Command>):</Term>
-<IndexTerm><Primary>pre-supposed: GCC (GNU C compiler)</Primary></IndexTerm>
-<IndexTerm><Primary>GCC (GNU C compiler), pre-supposed</Primary></IndexTerm>
-<ListItem>
+<term>GNU C (<Command>gcc</Command>):</term>
+<indexterm><primary>pre-supposed: GCC (GNU C compiler)</primary></indexterm>
+<indexterm><primary>GCC (GNU C compiler), pre-supposed</primary></indexterm>
+<listitem>
 
 <para>
 We recommend using GCC version 2.95.2 on all platforms.  Failing that,
@@ -488,7 +1220,7 @@ please let us know, so we can report it and get things improved.
 (Exception: on iX86 boxes&mdash;you may need to fiddle with GHC's
 <Option>-monly-N-regs</Option> option; see the User's Guide)
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 
 <varlistentry>
 <term>Happy:</term>
@@ -507,10 +1239,10 @@ url="http://www.haskell.org/happy/">Happy's Web Page</ulink>.
 </varlistentry>
 
 <VarListEntry>
-<Term>Autoconf:</Term>
-<IndexTerm><Primary>pre-supposed: Autoconf</Primary></IndexTerm>
-<IndexTerm><Primary>Autoconf, pre-supposed</Primary></IndexTerm>
-<ListItem>
+<term>Autoconf:</term>
+<indexterm><primary>pre-supposed: Autoconf</primary></indexterm>
+<indexterm><primary>Autoconf, pre-supposed</primary></indexterm>
+<listitem>
 <para>
 GNU Autoconf is needed if you intend to build from the CVS sources, it
 is <Emphasis>not</Emphasis> needed if you just intend to build a
@@ -524,12 +1256,12 @@ If you modify either of these files, you'll need
 <command>autoconf</command> to rebuild <Filename>configure</Filename>.
 </para>
 
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 <VarListEntry>
-<Term><Command>sed</Command></Term>
-<IndexTerm><Primary>pre-supposed: sed</Primary></IndexTerm>
-<IndexTerm><Primary>sed, pre-supposed</Primary></IndexTerm>
-<ListItem>
+<term><Command>sed</Command></term>
+<indexterm><primary>pre-supposed: sed</primary></indexterm>
+<indexterm><primary>sed, pre-supposed</primary></indexterm>
+<listitem>
 <para>
 You need a working <Command>sed</Command> if you are going to build
 from sources.  The build-configuration stuff needs it.  GNU sed
@@ -537,7 +1269,7 @@ version 2.0.4 is no good!  It has a bug in it that is tickled by the
 build-configuration.  2.0.5 is OK. Others are probably OK too
 (assuming we don't create too elaborate configure scripts.)
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 </VariableList>
 </para>
 
@@ -557,10 +1289,10 @@ particularly Glasgow-ish, but Occasionally Indispensable.  Like
 <VariableList>
 
 <VarListEntry>
-<Term>PVM version 3:</Term>
-<IndexTerm><Primary>pre-supposed: PVM3 (Parallel Virtual Machine)</Primary></IndexTerm>
-<IndexTerm><Primary>PVM3 (Parallel Virtual Machine), pre-supposed</Primary></IndexTerm>
-<ListItem>
+<term>PVM version 3:</term>
+<indexterm><primary>pre-supposed: PVM3 (Parallel Virtual Machine)</primary></indexterm>
+<indexterm><primary>PVM3 (Parallel Virtual Machine), pre-supposed</primary></indexterm>
+<listitem>
 
 <para>
 PVM is the Parallel Virtual Machine on which Parallel Haskell programs
@@ -580,17 +1312,17 @@ available on the net; I think I got it from
 A PVM installation is slightly quirky, but easy to do.  Just follow
 the <Filename>Readme</Filename> instructions.
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 <VarListEntry>
-<Term><Command>bash</Command>:</Term>
-<IndexTerm><Primary>bash, presupposed (Parallel Haskell only)</Primary></IndexTerm>
-<ListItem>
+<term><Command>bash</Command>:</term>
+<indexterm><primary>bash, presupposed (Parallel Haskell only)</primary></indexterm>
+<listitem>
 <para>
 Sadly, the <Command>gr2ps</Command> script, used to convert ``parallelism profiles''
 to PostScript, is written in Bash (GNU's Bourne Again shell).
 This bug will be fixed (someday).
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 </VariableList>
 </para>
 
@@ -609,28 +1341,28 @@ documentation that comes with the <Literal>fptools</Literal> projects:
 <VariableList>
 
 <VarListEntry>
-<Term>DocBook:</Term>
-<IndexTerm><Primary>pre-supposed: DocBook</Primary></IndexTerm>
-<IndexTerm><Primary>DocBook, pre-supposed</Primary></IndexTerm>
-<ListItem>
+<term>DocBook:</term>
+<indexterm><primary>pre-supposed: DocBook</primary></indexterm>
+<indexterm><primary>DocBook, pre-supposed</primary></indexterm>
+<listitem>
 <para>
 All our documentation is written in SGML, using the DocBook DTD.
 Instructions on installing and configuring the DocBook tools are in the
 installation guide (in the GHC user guide).
 </para>
 
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 <VarListEntry>
-<Term>TeX:</Term>
-<IndexTerm><Primary>pre-supposed: TeX</Primary></IndexTerm>
-<IndexTerm><Primary>TeX, pre-supposed</Primary></IndexTerm>
-<ListItem>
+<term>TeX:</term>
+<indexterm><primary>pre-supposed: TeX</primary></indexterm>
+<indexterm><primary>TeX, pre-supposed</primary></indexterm>
+<listitem>
 <para>
 A decent TeX distribution is required if you want to produce printable
 documentation.  We recomment teTeX, which includes just about
 everything you need.
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 </VariableList>
 </para>
 
@@ -651,10 +1383,10 @@ everything you need.
 
 <VariableList>
 <VarListEntry>
-<Term>Flex:</Term>
-<IndexTerm><Primary>pre-supposed: flex</Primary></IndexTerm> 
-<IndexTerm><Primary>flex, pre-supposed</Primary></IndexTerm>
-<ListItem>
+<term>Flex:</term>
+<indexterm><primary>pre-supposed: flex</primary></indexterm> 
+<indexterm><primary>flex, pre-supposed</primary></indexterm>
+<listitem>
 
 <para>
 This is a quite-a-bit-better-than-Lex lexer.  Used to build a couple
@@ -662,7 +1394,7 @@ of utilities in <Literal>glafp-utils</Literal>.  Depending on your
 operating system, the supplied <Command>lex</Command> may or may not
 work; you should get the GNU version.
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 </VariableList>
 
 </Sect2>
@@ -672,8 +1404,8 @@ work; you should get the GNU version.
 <Sect1 id="sec-building-from-source">
 <Title>Building from source
 
-<IndexTerm><Primary>Building from source</Primary></IndexTerm>
-<IndexTerm><Primary>Source, building from</Primary></IndexTerm></Title>
+<indexterm><primary>Building from source</primary></indexterm>
+<indexterm><primary>Source, building from</primary></indexterm></Title>
 
 <para>
 You've been rash enough to want to build some of
@@ -709,33 +1441,33 @@ contain the following directories and files:
 <para>
 
 <ItemizedList>
-<ListItem>
+<listitem>
 
 <para>
 <Filename>Makefile</Filename>: the root Makefile.
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
 <Filename>mk/</Filename>: the directory that contains the
 main Makefile code, shared by all the
 <Literal>fptools</Literal> software.
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
  <Filename>configure.in</Filename>, <Filename>config.sub</Filename>, <Filename>config.guess</Filename>:
 these files support the configuration process.
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
  <Filename>install-sh</Filename>.
 </para>
-</ListItem>
+</listitem>
 
 </ItemizedList>
 
@@ -761,8 +1493,8 @@ just the <Filename>happy/</Filename> directory.
 
 <Sect2>
 <Title>Build trees
-<IndexTerm><Primary>build trees</Primary></IndexTerm>
-<IndexTerm><Primary>link trees, for building</Primary></IndexTerm></Title>
+<indexterm><primary>build trees</primary></indexterm>
+<indexterm><primary>link trees, for building</primary></indexterm></Title>
 
 <para>
 While you can build a system in the source tree, we don't recommend it.
@@ -778,7 +1510,7 @@ build tree is initially an exact copy of the source tree, except that
 each file is a symbolic link to the source file, rather than being a
 copy of the source file.  There are ``standard'' Unix utilities that
 make such copies, so standard that they go by different names:
-<Command>lndir</Command><IndexTerm><Primary>lndir</Primary></IndexTerm>, <Command>mkshadowdir</Command><IndexTerm><Primary>mkshadowdir</Primary></IndexTerm> are two (If you
+<Command>lndir</Command><indexterm><primary>lndir</primary></indexterm>, <Command>mkshadowdir</Command><indexterm><primary>mkshadowdir</primary></indexterm> are two (If you
 don't have either, the source distribution includes sources for the
 X11 <Command>lndir</Command>&mdash;check out <Filename>fptools/glafp-utils/lndir</Filename>). See <Xref LinkEnd="sec-storysofar"> for a typical invocation.
 </para>
@@ -821,10 +1553,10 @@ copy.  More commonly you do want to edit the source file.)
 Like the source tree, the top level of your build tree must be (a
 linked copy of) the root directory of the <Literal>fptools</Literal> suite.  Inside
 Makefiles, the root of your build tree is called
-<Constant>&dollar;(FPTOOLS&lowbar;TOP)</Constant><IndexTerm><Primary>FPTOOLS&lowbar;TOP</Primary></IndexTerm>.  In the rest of this document path
-names are relative to <Constant>&dollar;(FPTOOLS&lowbar;TOP)</Constant> unless otherwise stated.  For
+<constant>&dollar;(FPTOOLS&lowbar;TOP)</constant><indexterm><primary>FPTOOLS&lowbar;TOP</primary></indexterm>.  In the rest of this document path
+names are relative to <constant>&dollar;(FPTOOLS&lowbar;TOP)</constant> unless otherwise stated.  For
 example, the file <Filename>ghc/mk/target.mk</Filename> is actually
-<Filename><Constant>&dollar;(FPTOOLS&lowbar;TOP)</Constant>/ghc/mk/target.mk</Filename>.
+<Filename><constant>&dollar;(FPTOOLS&lowbar;TOP)</constant>/ghc/mk/target.mk</Filename>.
 </para>
 
 </Sect2>
@@ -836,7 +1568,7 @@ example, the file <Filename>ghc/mk/target.mk</Filename> is actually
 <para>
 When you build <Literal>fptools</Literal> you will be compiling code on a particular
 <Emphasis>host platform</Emphasis>, to run on a particular <Emphasis>target platform</Emphasis>
-(usually the same as the host platform)<IndexTerm><Primary>platform</Primary></IndexTerm>.  The
+(usually the same as the host platform)<indexterm><primary>platform</primary></indexterm>.  The
 difficulty is that there are minor differences between different
 platforms; minor, but enough that the code needs to be a bit different
 for each.  There are some big differences too: for a different
@@ -859,21 +1591,21 @@ You set the configuration using a three-step process.
 <VariableList>
 
 <VarListEntry>
-<Term>Step 1: get ready for configuration.</Term>
-<ListItem>
+<term>Step 1: get ready for configuration.</term>
+<listitem>
              <para>Change directory to
-              <Constant>&dollar;(FPTOOLS&lowbar;TOP)</Constant> and
+              <constant>&dollar;(FPTOOLS&lowbar;TOP)</constant> and
               issue the command
-              <Command>autoconf</Command><IndexTerm><Primary>autoconf</Primary></IndexTerm>
+              <Command>autoconf</Command><indexterm><primary>autoconf</primary></indexterm>
               (with no arguments). This GNU program converts
-              <Filename><Constant>&dollar;(FPTOOLS&lowbar;TOP)</Constant>/configure.in</Filename>
+              <Filename><constant>&dollar;(FPTOOLS&lowbar;TOP)</constant>/configure.in</Filename>
               to a shell script called
-              <Filename><Constant>&dollar;(FPTOOLS&lowbar;TOP)</Constant>/configure</Filename>.
+              <Filename><constant>&dollar;(FPTOOLS&lowbar;TOP)</constant>/configure</Filename>.
               </para>
 
              <para>Some projects, including GHC, have their own
               configure script.  If there's an
-              <Constant>&dollar;(FPTOOLS&lowbar;TOP)/&lt;project&gt;/configure.in</Constant>,
+              <constant>&dollar;(FPTOOLS&lowbar;TOP)/&lt;project&gt;/configure.in</constant>,
               then you need to run <command>autoconf</command> in that
               directory too.</para>
 
@@ -917,9 +1649,9 @@ You set the configuration using a three-step process.
                <listitem>
 
                  <para>It translates
-                  <Filename>mk/config.mk.in</Filename><IndexTerm><Primary>config.mk.in</Primary></IndexTerm>
+                  <Filename>mk/config.mk.in</Filename><indexterm><primary>config.mk.in</primary></indexterm>
                   to
-                  <Filename>mk/config.mk</Filename><IndexTerm><Primary>config.mk</Primary></IndexTerm>,
+                  <Filename>mk/config.mk</Filename><indexterm><primary>config.mk</primary></indexterm>,
                   substituting for things between
                   ``<Literal>@</Literal>'' brackets.  So,
                   ``<Literal>@HaveGcc@</Literal>'' will be replaced by
@@ -930,13 +1662,13 @@ You set the configuration using a three-step process.
                   every Makefile (directly or indirectly), so the
                   configuration information is thereby communicated to
                   all Makefiles.</para>
-               </ListItem>
+               </listitem>
 
                <listitem>
                  <para> It translates
-                  <Filename>mk/config.h.in</Filename><IndexTerm><Primary>config.h.in</Primary></IndexTerm>
+                  <Filename>mk/config.h.in</Filename><indexterm><primary>config.h.in</primary></indexterm>
                   to
-                  <Filename>mk/config.h</Filename><IndexTerm><Primary>config.h</Primary></IndexTerm>.
+                  <Filename>mk/config.h</Filename><indexterm><primary>config.h</primary></indexterm>.
                   The latter is <Literal>&num;include</Literal>d by
                   various C programs, which can thereby make use of
                   configuration information.</para>
@@ -1003,11 +1735,11 @@ You set the configuration using a three-step process.
          </varlistentry>
 
 <VarListEntry>
-<Term>Step 3: build configuration.</Term>
-<ListItem>
+<term>Step 3: build configuration.</term>
+<listitem>
 <para>
 Next, you say how this build of <Literal>fptools</Literal> is to differ from the
-standard defaults by creating a new file <Filename>mk/build.mk</Filename><IndexTerm><Primary>build.mk</Primary></IndexTerm>
+standard defaults by creating a new file <Filename>mk/build.mk</Filename><indexterm><primary>build.mk</primary></indexterm>
 <Emphasis>in the build tree</Emphasis>.  This file is the one and only file you edit
 in the build tree, precisely because it says how this build differs
 from the source.  (Just in case your build tree does die, you might
@@ -1017,7 +1749,7 @@ symbolic link in each build tree to point to the appropriate one.)  So
 each build tree from the template.  We'll discuss what to put in it
 shortly.  
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 </VariableList>
 </para>
 
@@ -1038,7 +1770,7 @@ And that's it for configuration. Simple, eh?
       <filename>mk/build.mk</filename> that override any of the
       <filename>config.mk</filename> definitions that you want to
       change.  (The override occurs because the main boilerplate file,
-      <filename>mk/boilerplate.mk</filename><IndexTerm><Primary>boilerplate.mk</Primary></IndexTerm>,
+      <filename>mk/boilerplate.mk</filename><indexterm><primary>boilerplate.mk</primary></indexterm>,
       includes <filename>build.mk</filename> after
       <filename>config.mk</filename>.)</para>
 
@@ -1085,7 +1817,7 @@ GhcHcOpts=-DDEBUG -Rghc-timing
 YACC = @YaccCmd@
 </ProgramListing>
 
-      <para>This defines the Make variables <Constant>YACC</Constant>
+      <para>This defines the Make variables <constant>YACC</constant>
       to the pathname for a <Command>yacc</Command> that
       <Command>configure</Command> finds somewhere.  If you have your
       own pet <Command>yacc</Command> you want to use instead, that's
@@ -1103,7 +1835,7 @@ YACC = myyacc
       <para>You can also use <filename>build.mk</filename> to override
       anything that <Command>configure</Command> got wrong.  One place
       where this happens often is with the definition of
-      <Constant>FPTOOLS&lowbar;TOP&lowbar;ABS</Constant>: this
+      <constant>FPTOOLS&lowbar;TOP&lowbar;ABS</constant>: this
       variable is supposed to be the canonical path to the top of your
       source tree, but if your system uses an automounter then the
       correct directory is hard to find automatically.  If you find
@@ -1112,107 +1844,105 @@ YACC = myyacc
 
 </Sect2>
 
-<Sect2 id="sec-storysofar">
-<Title>The story so far</Title>
-
-<para>
-Let's summarise the steps you need to carry to get yourself
-a fully-configured build tree from scratch.
-</para>
-
-<para>
-
-<OrderedList>
-<ListItem>
-
-<para>
- Get your source tree from somewhere (CVS repository or source
-distribution).  Say you call the root directory <filename>myfptools</filename> (it
-does not have to be called <filename>fptools</filename>).  Make sure that you have
-the essential files (see <XRef LinkEnd="sec-source-tree">).
-
-</para>
-</ListItem>
-<ListItem>
-
-<para>
- Use <Command>lndir</Command> or <Command>mkshadowdir</Command> to create a build tree.
-
-<ProgramListing>
-cd myfptools
-mkshadowdir . /scratch/joe-bloggs/myfptools-sun4
-</ProgramListing>
-
-(N.B. <Command>mkshadowdir</Command>'s first argument is taken relative to its second.) You probably want to give the build tree a name that
-suggests its main defining characteristic (in your mind at least),
-in case you later add others.
-
-</para>
-</ListItem>
-<ListItem>
-
-<para>
- Change directory to the build tree.  Everything is going
-to happen there now.
-
-<ProgramListing>
-cd /scratch/joe-bloggs/myfptools-sun4
-</ProgramListing>
-
-</para>
-</ListItem>
-<ListItem>
-
-<para>
- Prepare for system configuration:
-
-<ProgramListing>
-autoconf
-</ProgramListing>
-
-(You can skip this step if you are starting from a source distribution,
-and you already have <filename>configure</filename> and <filename>mk/config.h.in</filename>.)
-
-</para>
-</ListItem>
-<ListItem>
-
-<para>
- Do system configuration:
-
-<ProgramListing>
-./configure
-</ProgramListing>
-
-
-</para>
-</ListItem>
-<ListItem>
-
-<para>
- Create the file <filename>mk/build.mk</filename>, 
-adding definitions for your desired configuration options.
-
-<ProgramListing>
-emacs mk/build.mk
-</ProgramListing>
-
-</para>
-</ListItem>
-
-</OrderedList>
-
-You can make subsequent changes to <filename>mk/build.mk</filename> as often
-as you like.  You do not have to run any further configuration programs to
-make these changes take effect. In theory you should, however, say
-<Command>gmake clean</Command>, <Command>gmake all</Command>, because
-configuration option changes could affect anything&mdash;but in practice you
-are likely to know what's affected.
-</para>
-
-</Sect2>
+    <sect2 id="sec-storysofar">
+      <title>The story so far</title>
+
+      <para>Let's summarise the steps you need to carry to get
+      yourself a fully-configured build tree from scratch.</para>
+
+      <orderedlist>
+       <listitem>
+         <para> Get your source tree from somewhere (CVS repository
+          or source distribution).  Say you call the root directory
+          <filename>myfptools</filename> (it does not have to be
+          called <filename>fptools</filename>).  Make sure that you
+          have the essential files (see <XRef
+          LinkEnd="sec-source-tree">).</para>
+       </listitem>
+
+       <listitem>
+
+         <para>(Optional) Use <Command>lndir</Command> or
+         <Command>mkshadowdir</Command> to create a build tree.</para>
+
+<programlisting>
+$ cd myfptools
+$ mkshadowdir . /scratch/joe-bloggs/myfptools-sun4
+</programlisting>
+
+         <para>(N.B. <Command>mkshadowdir</Command>'s first argument
+          is taken relative to its second.) You probably want to give
+          the build tree a name that suggests its main defining
+          characteristic (in your mind at least), in case you later
+          add others.</para>
+       </listitem>
+
+       <listitem>
+         <para>Change directory to the build tree.  Everything is
+          going to happen there now.</para>
+
+<programlisting>
+$ cd /scratch/joe-bloggs/myfptools-sun4
+</programlisting>
+
+       </listitem>
+
+       <listitem>
+         <para>Prepare for system configuration:</para>
+
+<programlisting>
+$ autoconf
+</programlisting>
+
+         <para>(You can skip this step if you are starting from a
+          source distribution, and you already have
+          <filename>configure</filename> and
+          <filename>mk/config.h.in</filename>.)</para>
+
+         <para>Some projects, including GHC itself, have their own
+         configure scripts, so it is necessary to run autoconf again
+         in the appropriate subdirectories. eg:</para>
+
+<programlisting>
+$ (cd ghc; autoconf)
+</programlisting>
+       </listitem>
+
+       <listitem>
+         <para>Do system configuration:</para>
+
+<programlisting>
+$ ./configure
+</programlisting>
+
+         <para>Don't forget to check whether you need to add any
+         arguments to <literal>configure</literal>; for example, a
+         common requirement is to specify which GHC to use with
+         <option>--with-ghc=<replaceable>ghc</replaceable></option>.</para>
+       </listitem>
+
+       <listitem>
+         <para>Create the file <filename>mk/build.mk</filename>,
+          adding definitions for your desired configuration
+          options.</para>
+
+<programlisting>
+$ emacs mk/build.mk
+</programlisting>
+       </listitem>
+      </orderedlist>
+
+      <para>You can make subsequent changes to
+      <filename>mk/build.mk</filename> as often as you like.  You do
+      not have to run any further configuration programs to make these
+      changes take effect. In theory you should, however, say
+      <Command>gmake clean</Command>, <Command>gmake all</Command>,
+      because configuration option changes could affect
+      anything&mdash;but in practice you are likely to know what's
+      affected.</para>
+    </sect2>
 
-    <Sect2>
+    <sect2>
       <Title>Making things</Title>
 
       <para>At this point you have made yourself a fully-configured
@@ -1237,16 +1967,16 @@ are likely to know what's affected.
 
     <Sect2 id="sec-standard-targets">
       <Title>Standard Targets</title>
-      <IndexTerm><Primary>targets, standard makefile</Primary></IndexTerm>
-      <IndexTerm><Primary>makefile targets</Primary></IndexTerm>
+      <indexterm><primary>targets, standard makefile</primary></indexterm>
+      <indexterm><primary>makefile targets</primary></indexterm>
 
       <para>In any directory you should be able to make the following:
 
 <VariableList>
 
 <VarListEntry>
-<Term><Literal>boot</Literal>:</Term>
-<ListItem>
+<term><Literal>boot</Literal>:</term>
+<listitem>
 <para>does the one-off preparation required to get ready for the real
 work.  Notably, it does <Command>gmake depend</Command> in all
 directories that contain programs.  It also builds the necessary tools
@@ -1263,22 +1993,22 @@ subdirectories, in the order specified by
 <para>If you're working in a subdirectory somewhere and need to update
 the dependencies, <literal>gmake boot</literal> is a good way to do it.</para>
 
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 <VarListEntry>
-<Term><Literal>all</Literal>:</Term>
-<ListItem>
+<term><Literal>all</Literal>:</term>
+<listitem>
 <para>
 makes all the final target(s) for this Makefile.
 Depending on which directory you are in a ``final target'' may be an
 executable program, a library archive, a shell script, or a Postscript
 file.  Typing <Command>gmake</Command> alone is generally the same as typing <Command>gmake all</Command>.
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 <VarListEntry>
-<Term><Literal>install</Literal>:</Term>
-<ListItem>
+<term><Literal>install</Literal>:</term>
+<listitem>
 <para>
-installs the things built by <Literal>all</Literal>.  Where does it
+installs the things built by <Literal>all</Literal> (except for the documentation).  Where does it
 install them?  That is specified by
 <filename>mk/config.mk.in</filename>; you can override it in
 <filename>mk/build.mk</filename>, or by running
@@ -1286,25 +2016,32 @@ install them?  That is specified by
 <literal>--bindir=/home/simonpj/bin</literal>;  see <literal>./configure
 --help</literal> for the full details.
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 <VarListEntry>
-<Term><Literal>uninstall</Literal>:</Term>
-<ListItem>
+<term><Literal>install-docs</Literal>:</term>
+<listitem>
+<para>
+installs the documentation. Otherwise behaves just like <literal>install</literal>.
+</para>
+</listitem></VarListEntry>
+<VarListEntry>
+<term><Literal>uninstall</Literal>:</term>
+<listitem>
 <para>
 reverses the effect of <Literal>install</Literal>.
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 
 <VarListEntry>
-<Term><Literal>clean</Literal>:</Term>
-<ListItem>
+<term><Literal>clean</Literal>:</term>
+<listitem>
 <para>
 Delete all files from the current directory that are normally created
 by building the program.  Don't delete the files that record the
 configuration, or files generated by <Command>gmake boot</Command>.
 Also preserve files that could be made by building, but normally
 aren't because the distribution comes with them.</para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 
 <varlistentry>
 <term><literal>distclean</literal>:</term>
@@ -1326,8 +2063,8 @@ few files that people normally don't want to recompile.</para>
 </varlistentry>
 
 <VarListEntry>
-<Term><Literal>maintainer-clean</Literal>:</Term>
-<ListItem>
+<term><Literal>maintainer-clean</Literal>:</term>
+<listitem>
 <para>
 Delete everything from the current directory that can be reconstructed
 with this Makefile.  This typically includes everything deleted by
@@ -1345,12 +2082,12 @@ build the program.</para>
 </varlistentry>
 
 <VarListEntry>
-<Term><Literal>check</Literal>:</Term>
-<ListItem>
+<term><Literal>check</Literal>:</term>
+<listitem>
 <para>
 run the test suite.
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 </VariableList>
 </para>
 
@@ -1363,16 +2100,16 @@ sub-directories.  Certain other standard targets do not:
 <VariableList>
 
 <VarListEntry>
-<Term><Literal>configure</Literal>:</Term>
-<ListItem>
+<term><Literal>configure</Literal>:</term>
+<listitem>
 <para>
 is only available in the root directory
-<Constant>&dollar;(FPTOOLS&lowbar;TOP)</Constant>; it has been discussed in <XRef LinkEnd="sec-build-config">.
+<constant>&dollar;(FPTOOLS&lowbar;TOP)</constant>; it has been discussed in <XRef LinkEnd="sec-build-config">.
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 <VarListEntry>
-<Term><Literal>depend</Literal>:</Term>
-<ListItem>
+<term><Literal>depend</Literal>:</term>
+<listitem>
 <para>
 make a <filename>.depend</filename> file in each directory that needs
 it. This <filename>.depend</filename> file contains mechanically-generated dependency
@@ -1394,24 +2131,24 @@ which says that the object file <filename>Foo.o</filename> depends on the interf
 <filename>Baz.hi</filename> generated by compiling module <Literal>Baz</Literal>.  The <filename>.depend</filename> file is
 automatically included by every Makefile.
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 <VarListEntry>
-<Term><Literal>binary-dist</Literal>:</Term>
-<ListItem>
+<term><Literal>binary-dist</Literal>:</term>
+<listitem>
 <para>
 make a binary distribution.  This is the
 target we use to build the binary distributions of GHC and Happy.
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 <VarListEntry>
-<Term><Literal>dist</Literal>:</Term>
-<ListItem>
+<term><Literal>dist</Literal>:</term>
+<listitem>
 <para>
 make a source distribution.  Note that this target does &ldquo;make
 distclean&rdquo; as part of its work; don't use it if you want to keep
 what you've built.
 </para>
-</ListItem></VarListEntry>
+</listitem></VarListEntry>
 </VariableList>
 </para>
 
@@ -1444,10 +2181,10 @@ Happy can similarly be run from the build tree, using
 </sect2>
 
 <Sect2>
-<Title>Fast Making <IndexTerm><Primary>fastmake</Primary></IndexTerm>
-<IndexTerm><Primary>dependencies, omitting</Primary></IndexTerm>
-<IndexTerm><Primary>FAST, makefile
-variable</Primary></IndexTerm></Title>
+<Title>Fast Making <indexterm><primary>fastmake</primary></indexterm>
+<indexterm><primary>dependencies, omitting</primary></indexterm>
+<indexterm><primary>FAST, makefile
+variable</primary></indexterm></Title>
 
 <para>
 Sometimes the dependencies get in the way: if you've made a small
@@ -1485,7 +2222,7 @@ User's Guide section on "Separate Compilation").
 
 <Sect1 id="sec-makefile-arch">
 <Title>The <filename>Makefile</filename> architecture
-<IndexTerm><Primary>makefile architecture</Primary></IndexTerm></Title>
+<indexterm><primary>makefile architecture</primary></indexterm></Title>
 
 <para>
 <Command>make</Command> is great if everything works&mdash;you type <Command>gmake install</Command> and
@@ -1500,19 +2237,40 @@ The purpose of this section is to give you a road-map to help you figure
 out what is going right and what is going wrong.
 </para>
 
-<Sect2>
-<Title>A small project</Title>
+    <sect2>
+      <title>Debugging</title>
+      
+      <para>Debugging <filename>Makefile</filename>s is something of a
+      black art, but here's a couple of tricks that we find
+      particularly useful.  The following command allows you to see
+      the contents of any make variable in the context of the current
+      <filename>Makefile</filename>:</para>
+
+<screen>$  make show VALUE=HS_SRCS</screen>
+
+      <para>where you can replace <literal>HS_SRCS</literal> with the
+      name of any variable you wish to see the value of.</para>
+      
+      <para>GNU make has a <option>-d</option> option which generates
+      a dump of the decision procedure used to arrive at a conclusion
+      about which files should be recompiled.  Sometimes useful for
+      tracking down problems with superfluous or missing
+      recompilations.</para>
+    </sect2>
+
+<Sect2>
+<Title>A small project</Title>
 
 <para>
 To get started, let us look at the <filename>Makefile</filename> for an imaginary small
 <Literal>fptools</Literal> project, <Literal>small</Literal>.  Each project in <Literal>fptools</Literal> has its own
-directory in <Constant>FPTOOLS&lowbar;TOP</Constant>, so the <Literal>small</Literal> project will have its own
-directory <Constant>FPOOLS&lowbar;TOP/small/</Constant>.  Inside the <filename>small/</filename> directory there
+directory in <constant>FPTOOLS&lowbar;TOP</constant>, so the <Literal>small</Literal> project will have its own
+directory <constant>FPOOLS&lowbar;TOP/small/</constant>.  Inside the <filename>small/</filename> directory there
 will be a <filename>Makefile</filename>, looking something like this:
 </para>
 
 <para>
-<IndexTerm><Primary>Makefile, minimal</Primary></IndexTerm>
+<indexterm><primary>Makefile, minimal</primary></indexterm>
 
 <ProgramListing>
 #     Makefile for fptools project "small"
@@ -1535,7 +2293,7 @@ This <filename>Makefile</filename> has three sections:
 <para>
 
 <OrderedList>
-<ListItem>
+<listitem>
 
 <para>
  The first section includes
@@ -1551,15 +2309,15 @@ directive.
 </FOOTNOTE>
  a file of ``boilerplate'' code from the level
 above (which in this case will be
-<filename><Constant>FPTOOLS&lowbar;TOP</Constant>/mk/boilerplate.mk</filename><IndexTerm><Primary>boilerplate.mk</Primary></IndexTerm>).  As its name
+<filename><constant>FPTOOLS&lowbar;TOP</constant>/mk/boilerplate.mk</filename><indexterm><primary>boilerplate.mk</primary></indexterm>).  As its name
 suggests, <filename>boilerplate.mk</filename> consists of a large quantity of standard
 <filename>Makefile</filename> code.  We discuss this boilerplate in more detail in
 <XRef LinkEnd="sec-boiler">.
-<IndexTerm><Primary>include, directive in Makefiles</Primary></IndexTerm>
-<IndexTerm><Primary>Makefile inclusion</Primary></IndexTerm>
+<indexterm><primary>include, directive in Makefiles</primary></indexterm>
+<indexterm><primary>Makefile inclusion</primary></indexterm>
 
 Before the <Literal>include</Literal> statement, you must define the <Command>make</Command> variable
-<Constant>TOP</Constant><IndexTerm><Primary>TOP</Primary></IndexTerm> to be the directory containing the <filename>mk</filename> directory in
+<constant>TOP</constant><indexterm><primary>TOP</primary></indexterm> to be the directory containing the <filename>mk</filename> directory in
 which the <filename>boilerplate.mk</filename> file is.  It is <Emphasis>not</Emphasis> OK to simply say
 
 
@@ -1573,41 +2331,41 @@ that it can, in turn, <Literal>include</Literal> other files.  (Unfortunately, w
 <Literal>include</Literal>d file does an <Literal>include</Literal>, the filename is treated relative to
 the directory in which <Command>gmake</Command> is being run, not the directory in
 which the <Literal>include</Literal>d sits.)  In general, <Emphasis>every file <filename>foo.mk</filename>
-assumes that <filename><Constant>&dollar;(TOP)</Constant>/mk/foo.mk</filename> refers to itself.</Emphasis> It is up to the
+assumes that <filename><constant>&dollar;(TOP)</constant>/mk/foo.mk</filename> refers to itself.</Emphasis> It is up to the
 <filename>Makefile</filename> doing the <Literal>include</Literal> to ensure this is the case.
 
 Files intended for inclusion in other <filename>Makefile</filename>s are written to have
 the following property: <Emphasis>after <filename>foo.mk</filename> is <Literal>include</Literal>d, it leaves
-<Constant>TOP</Constant> containing the same value as it had just before the <Literal>include</Literal>
+<constant>TOP</constant> containing the same value as it had just before the <Literal>include</Literal>
 statement</Emphasis>.  In our example, this invariant guarantees that the
 <Literal>include</Literal> for <filename>target.mk</filename> will look in the same directory as that for
 <filename>boilerplate.mk</filename>.
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
  The second section defines the following standard <Command>make</Command>
-variables: <Constant>SRCS</Constant><IndexTerm><Primary>SRCS</Primary></IndexTerm> (the source files from which is to be
-built), and <Constant>HS&lowbar;PROG</Constant><IndexTerm><Primary>HS&lowbar;PROG</Primary></IndexTerm> (the executable binary to be
+variables: <constant>SRCS</constant><indexterm><primary>SRCS</primary></indexterm> (the source files from which is to be
+built), and <constant>HS&lowbar;PROG</constant><indexterm><primary>HS&lowbar;PROG</primary></indexterm> (the executable binary to be
 built).  We will discuss in more detail what the ``standard
 variables'' are, and how they affect what happens, in <XRef LinkEnd="sec-targets">.
 
-The definition for <Constant>SRCS</Constant> uses the useful GNU <Command>make</Command> construct
-<Literal>&dollar;(wildcard&nbsp;$pat$)</Literal><IndexTerm><Primary>wildcard</Primary></IndexTerm>, which expands to a list of all
+The definition for <constant>SRCS</constant> uses the useful GNU <Command>make</Command> construct
+<Literal>&dollar;(wildcard&nbsp;$pat$)</Literal><indexterm><primary>wildcard</primary></indexterm>, which expands to a list of all
 the files matching the pattern <Literal>pat</Literal> in the current directory.  In
-this example, <Constant>SRCS</Constant> is set to the list of all the <filename>.lhs</filename> and <filename>.c</filename>
+this example, <constant>SRCS</constant> is set to the list of all the <filename>.lhs</filename> and <filename>.c</filename>
 files in the directory.  (Let's suppose there is one of each,
 <filename>Foo.lhs</filename> and <filename>Baz.c</filename>.)
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
  The last section includes a second file of standard code,
-called <filename>target.mk</filename><IndexTerm><Primary>target.mk</Primary></IndexTerm>.  It contains the rules that tell
+called <filename>target.mk</filename><indexterm><primary>target.mk</primary></indexterm>.  It contains the rules that tell
 <Command>gmake</Command> how to make the standard targets (<Xref LinkEnd="sec-standard-targets">).  Why, you ask,
 can't this standard code be part of <filename>boilerplate.mk</filename>?  Good question.
 We discuss the reason later, in <Xref LinkEnd="sec-boiler-arch">.
@@ -1619,7 +2377,7 @@ in <filename>target.mk</filename>; the price tag is that you have to understand
 canned rules get enabled, and what they do (<Xref LinkEnd="sec-targets">).
 
 </para>
-</ListItem>
+</listitem>
 
 </OrderedList>
 
@@ -1634,15 +2392,15 @@ happen:
 <para>
 
 <ItemizedList>
-<ListItem>
+<listitem>
 
 <para>
  <Command>gmake</Command> figures out that the object files are <filename>Foo.o</filename> and
 <filename>Baz.o</filename>.
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
  It uses a boilerplate pattern rule to compile <filename>Foo.lhs</filename> to
@@ -1650,27 +2408,27 @@ happen:
 build configuration.)
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
  It uses another standard pattern rule to compile <filename>Baz.c</filename> to
 <filename>Baz.o</filename>, using a C compiler.  (Ditto.)
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
  It links the resulting <filename>.o</filename> files together to make <Literal>small</Literal>,
 using the Haskell compiler to do the link step.  (Why not use <Command>ld</Command>?
 Because the Haskell compiler knows what standard libraries to link in.
 How did <Command>gmake</Command> know to use the Haskell compiler to do the link,
-rather than the C compiler?  Because we set the variable <Constant>HS&lowbar;PROG</Constant>
-rather than <Constant>C&lowbar;PROG</Constant>.)
+rather than the C compiler?  Because we set the variable <constant>HS&lowbar;PROG</constant>
+rather than <constant>C&lowbar;PROG</constant>.)
 
 </para>
-</ListItem>
+</listitem>
 
 </ItemizedList>
 
@@ -1719,7 +2477,7 @@ $(FPTOOLS_TOP)/ghc/
 <para>
 The sub-directories <filename>docs</filename>, <filename>driver</filename>, <filename>compiler</filename>, and so on, each
 contains a sub-component of GHC, and each has its own <filename>Makefile</filename>.
-There must also be a <filename>Makefile</filename> in <filename><Constant>&dollar;(FPTOOLS&lowbar;TOP)</Constant>/ghc</filename>.  It does most
+There must also be a <filename>Makefile</filename> in <filename><constant>&dollar;(FPTOOLS&lowbar;TOP)</constant>/ghc</filename>.  It does most
 of its work by recursively invoking <Command>gmake</Command> on the <filename>Makefile</filename>s in the
 sub-directories.  We say that <filename>ghc/Makefile</filename> is a <Emphasis>non-leaf
 <filename>Makefile</filename></Emphasis>, because it does little except organise its children,
@@ -1745,7 +2503,7 @@ contains GHC-specific <filename>Makefile</filename> boilerplate code.  More prec
 <para>
 
 <ItemizedList>
-<ListItem>
+<listitem>
 
 <para>
  <filename>ghc/mk/boilerplate.mk</filename> is included at the top of
@@ -1755,8 +2513,8 @@ sub-directories.  It in turn <Literal>include</Literal>s the main boilerplate fi
 
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
  <filename>ghc/mk/target.mk</filename> is <Literal>include</Literal>d at the bottom of
@@ -1764,7 +2522,7 @@ sub-directories.  It in turn <Literal>include</Literal>s the main boilerplate fi
 sub-directories.  It in turn <Literal>include</Literal>s the file <filename>mk/target.mk</filename>.
 
 </para>
-</ListItem>
+</listitem>
 
 </ItemizedList>
 
@@ -1779,12 +2537,12 @@ of the standard boilerplate.
 
 <Sect2 id="sec-boiler-arch">
 <Title>Boilerplate architecture
-<IndexTerm><Primary>boilerplate architecture</Primary></IndexTerm>
+<indexterm><primary>boilerplate architecture</primary></indexterm>
 </Title>
 
 <para>
-Every <filename>Makefile</filename> includes a <filename>boilerplate.mk</filename><IndexTerm><Primary>boilerplate.mk</Primary></IndexTerm> file
-at the top, and <filename>target.mk</filename><IndexTerm><Primary>target.mk</Primary></IndexTerm> file at the bottom.  In
+Every <filename>Makefile</filename> includes a <filename>boilerplate.mk</filename><indexterm><primary>boilerplate.mk</primary></indexterm> file
+at the top, and <filename>target.mk</filename><indexterm><primary>target.mk</primary></indexterm> file at the bottom.  In
 this section we discuss what is in these files, and why there have to
 be two of them.  In general:
 </para>
@@ -1792,30 +2550,30 @@ be two of them.  In general:
 <para>
 
 <ItemizedList>
-<ListItem>
+<listitem>
 
 <para>
  <filename>boilerplate.mk</filename> consists of:
 
 <ItemizedList>
-<ListItem>
+<listitem>
 
 <para>
  <Emphasis>Definitions of millions of <Command>make</Command> variables</Emphasis> that
 collectively specify the build configuration.  Examples:
-<Constant>HC&lowbar;OPTS</Constant><IndexTerm><Primary>HC&lowbar;OPTS</Primary></IndexTerm>, the options to feed to the Haskell compiler;
-<Constant>NoFibSubDirs</Constant><IndexTerm><Primary>NoFibSubDirs</Primary></IndexTerm>, the sub-directories to enable within the
-<Literal>nofib</Literal> project; <Constant>GhcWithHc</Constant><IndexTerm><Primary>GhcWithHc</Primary></IndexTerm>, the name of the Haskell
+<constant>HC&lowbar;OPTS</constant><indexterm><primary>HC&lowbar;OPTS</primary></indexterm>, the options to feed to the Haskell compiler;
+<constant>NoFibSubDirs</constant><indexterm><primary>NoFibSubDirs</primary></indexterm>, the sub-directories to enable within the
+<Literal>nofib</Literal> project; <constant>GhcWithHc</constant><indexterm><primary>GhcWithHc</primary></indexterm>, the name of the Haskell
 compiler to use when compiling GHC in the <Literal>ghc</Literal> project.  
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
 <Emphasis>Standard pattern rules</Emphasis> that tell <Command>gmake</Command> how to construct one
 file from another.
 </para>
-</ListItem>
+</listitem>
 
 </ItemizedList>
 
@@ -1835,11 +2593,11 @@ SRC_HC_OPTS += -O
 </ProgramListing>
 
 
-thereby adding ``<Option>-O</Option>'' to the end of <Constant>SRC&lowbar;HC&lowbar;OPTS</Constant><IndexTerm><Primary>SRC&lowbar;HC&lowbar;OPTS</Primary></IndexTerm>.
+thereby adding ``<Option>-O</Option>'' to the end of <constant>SRC&lowbar;HC&lowbar;OPTS</constant><indexterm><primary>SRC&lowbar;HC&lowbar;OPTS</primary></indexterm>.
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
  <filename>target.mk</filename> contains <Command>make</Command> rules for the standard
@@ -1853,7 +2611,7 @@ variables are usually set in the middle section of the
 
 
 <ItemizedList>
-<ListItem>
+<listitem>
 
 <para>
  <Command>gmake</Command> commits target and dependency lists earlier than
@@ -1867,8 +2625,8 @@ $(HS_PROG) : $(OBJS)
 </ProgramListing>
 
 
-If this rule was in <filename>boilerplate.mk</filename> then <Constant>&dollar;(HS&lowbar;PROG)</Constant><IndexTerm><Primary>HS&lowbar;PROG</Primary></IndexTerm>
-and <Constant>&dollar;(OBJS)</Constant><IndexTerm><Primary>OBJS</Primary></IndexTerm> would not have their final values at the
+If this rule was in <filename>boilerplate.mk</filename> then <constant>&dollar;(HS&lowbar;PROG)</constant><indexterm><primary>HS&lowbar;PROG</primary></indexterm>
+and <constant>&dollar;(OBJS)</constant><indexterm><primary>OBJS</primary></indexterm> would not have their final values at the
 moment <Command>gmake</Command> encountered the rule.  Alas, <Command>gmake</Command> takes a snapshot
 of their current values, and wires that snapshot into the rule.  (In
 contrast, the commands executed when the rule ``fires'' are only
@@ -1876,8 +2634,8 @@ substituted at the moment of firing.)  So, the rule must follow the
 definitions given in the <filename>Makefile</filename> itself.
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
  Unlike pattern rules, ordinary rules cannot be overriden or
@@ -1886,19 +2644,19 @@ error message).  Including ordinary rules in <filename>boilerplate.mk</filename>
 prevent the user from writing rules for specific targets in specific cases.
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
  There are a couple of other reasons I've forgotten, but it doesn't
 matter too much.
 </para>
-</ListItem>
+</listitem>
 
 </ItemizedList>
 
 </para>
-</ListItem>
+</listitem>
 
 </ItemizedList>
 
@@ -1909,118 +2667,232 @@ matter too much.
 <Sect2 id="sec-boiler">
 <Title>The main <filename>mk/boilerplate.mk</filename> file
 
-<IndexTerm><Primary>boilerplate.mk</Primary></IndexTerm></Title>
+<indexterm><primary>boilerplate.mk</primary></indexterm></Title>
 
 <para>
-If you look at <filename><Constant>&dollar;(FPTOOLS&lowbar;TOP)</Constant>/mk/boilerplate.mk</filename> you will find
+If you look at <filename><constant>&dollar;(FPTOOLS&lowbar;TOP)</constant>/mk/boilerplate.mk</filename> you will find
 that it consists of the following sections, each held in a separate
 file: 
 </para>
 
-<para>
-<VariableList>
+      <variablelist>
+
+       <varlistentry>
+         <term><filename>config.mk</filename></term>
+         <indexterm><primary>config.mk</primary></indexterm>
+         <listitem>
+           <para>is the build configuration file we discussed at
+            length in <Xref LinkEnd="sec-build-config">.</para>
+         </listitem>
+       </varlistentry>
+
+       <varlistentry>
+         <term><filename>paths.mk</filename></term>
+         <indexterm><primary>paths.mk</primary></indexterm>
+         <listitem>
+           <para>defines <Command>make</Command> variables for
+            pathnames and file lists.  This file contains code for
+            automatically compiling lists of source files and deriving
+            lists of object files from those.  The results can be
+            overriden in the <filename>Makefile</filename>, but in
+            most cases the automatic setup should do the right
+            thing.</para>
+           
+           <para>The following variables may be set in the
+           <filename>Makefile</filename> to affect how the automatic
+           source file search is done:</para>
+
+           <variablelist>
+             <varlistentry>
+               <term><literal>ALL_DIRS</literal></term>
+               <indexterm><primary><literal>ALL_DIRS</literal></primary>
+               </indexterm>
+               <listitem>
+                 <para>Set to a list of directories to search in
+                 addition to the current directory for source
+                 files.</para>
+               </listitem>
+             </varlistentry>
 
-<VarListEntry>
-<Term><filename>config.mk</filename><IndexTerm><Primary>config.mk</Primary></IndexTerm></Term>
-<ListItem>
-<para>
-is the build configuration file we
-discussed at length in <Xref LinkEnd="sec-build-config">.
-</para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><filename>paths.mk</filename><IndexTerm><Primary>paths.mk</Primary></IndexTerm></Term>
-<ListItem>
-<para>
-defines <Command>make</Command> variables for
-pathnames and file lists.  In particular, it gives definitions for:
-</para>
+             <varlistentry>
+               <term><literal>EXCLUDE_SRCS</literal></term>
+               <indexterm><primary><literal>EXCLUDE_SRCS</literal></primary>
+               </indexterm>
+               <listitem>
+                 <para>Set to a list of source files (relative to the
+                 current directory) to omit from the automatic
+                 search.  The source searching machinery is clever
+                 enough to know that if you exclude a source file
+                 from which other sources are derived, then the
+                 derived sources should also be excluded.  For
+                 example, if you set <literal>EXCLUDED_SRCS</literal>
+                 to include <filename>Foo.y</filename>, then
+                 <filename>Foo.hs</filename> will also be
+                 excluded.</para>
+               </listitem>
+             </varlistentry>
 
-<para>
-<VariableList>
+             <varlistentry>
+               <term><literal>EXTRA_SRCS</literal></term>
+               <indexterm><primary><literal>EXCLUDE_SRCS</literal></primary>
+               </indexterm>
+                 <listitem>
+                 <para>Set to a list of extra source files (perhaps
+                 in directories not listed in
+                 <literal>ALL_DIRS</literal>) that should be
+                 considered.</para>
+               </listitem>
+             </varlistentry>
+           </variablelist>
 
-<VarListEntry>
-<Term><Constant>SRCS</Constant><IndexTerm><Primary>SRCS</Primary></IndexTerm>:</Term>
-<ListItem>
-<para>
-all source files in the current directory.
-</para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><Constant>HS&lowbar;SRCS</Constant><IndexTerm><Primary>HS&lowbar;SRCS</Primary></IndexTerm>:</Term>
-<ListItem>
-<para>
-all Haskell source files in the current directory.
-It is derived from <Constant>&dollar;(SRCS)</Constant>, so if you override <Constant>SRCS</Constant> with a new value
-<Constant>HS&lowbar;SRCS</Constant> will follow suit.
-</para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><Constant>C&lowbar;SRCS</Constant><IndexTerm><Primary>C&lowbar;SRCS</Primary></IndexTerm>:</Term>
-<ListItem>
-<para>
-similarly for C source files.
-</para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><Constant>HS&lowbar;OBJS</Constant><IndexTerm><Primary>HS&lowbar;OBJS</Primary></IndexTerm>:</Term>
-<ListItem>
-<para>
-the <filename>.o</filename> files derived from <Constant>&dollar;(HS&lowbar;SRCS)</Constant>.
-</para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><Constant>C&lowbar;OBJS</Constant><IndexTerm><Primary>C&lowbar;OBJS</Primary></IndexTerm>:</Term>
-<ListItem>
-<para>
-similarly for <Constant>&dollar;(C&lowbar;SRCS)</Constant>.
-</para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><Constant>OBJS</Constant><IndexTerm><Primary>OBJS</Primary></IndexTerm>:</Term>
-<ListItem>
-<para>
-the concatenation of <Constant>&dollar;(HS&lowbar;OBJS)</Constant> and <Constant>&dollar;(C&lowbar;OBJS)</Constant>.
-</para>
-</ListItem></VarListEntry>
-</VariableList>
-</para>
+           <para>The results of the automatic source file search are
+           placed in the following make variables:</para>
 
-<para>
-Any or all of these definitions can easily be overriden by giving new
-definitions in your <filename>Makefile</filename>.  For example, if there are things in
-the current directory that look like source files but aren't, then
-you'll need to set <Constant>SRCS</Constant> manually in your <filename>Makefile</filename>.  The other
-definitions will then work from this new definition.
-</para>
+           <variablelist>
+             <varlistentry>
+               <term><literal>SRCS</literal></term>
+               <indexterm><primary><literal>SRCS</literal></primary></indexterm>
+               <listitem>
+                 <para>All source files found, sorted and without
+                 duplicates, including those which might not exist
+                 yet but will be derived from other existing sources.
+                 <literal>SRCS</literal> <emphasis>can</emphasis> be
+                 overriden if necessary, in which case the variables
+                 below will follow suit.</para>
+               </listitem>
+             </varlistentry>
 
-<para>
-What, exactly, does <filename>paths.mk</filename> consider a ``source file'' to be?  It's
-based on the file's suffix (e.g. <filename>.hs</filename>, <filename>.lhs</filename>, <filename>.c</filename>, <filename>.lc</filename>, etc), but
-this is the kind of detail that changes, so rather than
-enumerate the source suffices here the best thing to do is to look in
-<filename>paths.mk</filename>.
-</para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><filename>opts.mk</filename><IndexTerm><Primary>opts.mk</Primary></IndexTerm></Term>
-<ListItem>
-<para>
-defines <Command>make</Command> variables for option
-strings to pass to each program. For example, it defines
-<Constant>HC&lowbar;OPTS</Constant><IndexTerm><Primary>HC&lowbar;OPTS</Primary></IndexTerm>, the option strings to pass to the Haskell
-compiler.  See <Xref LinkEnd="sec-suffix">.
-</para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><filename>suffix.mk</filename><IndexTerm><Primary>suffix.mk</Primary></IndexTerm></Term>
-<ListItem>
-<para>
-defines standard pattern rules&mdash;see <Xref LinkEnd="sec-suffix">.
-</para>
-</ListItem></VarListEntry>
-</VariableList>
-</para>
+             <varlistentry>
+               <term><literal>HS_SRCS</literal></term>
+               <indexterm><primary><literal>HS_SRCS</literal></primary></indexterm>
+               <listitem>
+                 <para>all Haskell source files in the current
+                  directory, including those derived from other source
+                  files (eg. Happy sources also give rise to Haskell
+                  sources).</para>
+               </listitem>
+             </varlistentry>
+
+             <varlistentry>
+               <term><literal>HS_OBJS</literal></term>
+               <indexterm><primary><literal>HS_OBJS</literal></primary></indexterm>
+               <listitem>
+                 <para>Object files derived from
+                 <literal>HS_SRCS</literal>.</para>
+               </listitem>
+             </varlistentry>
+
+             <varlistentry>
+               <term><literal>HS_IFACES</literal></term>
+               <indexterm><primary><literal>HS_IFACES</literal></primary></indexterm>
+               <listitem>
+                 <para>Interface files (<literal>.hi</literal> files)
+                 derived from <literal>HS_SRCS</literal>.</para>
+               </listitem>
+             </varlistentry>
+
+             <varlistentry>
+               <term><literal>C_SRCS</literal></term>
+               <indexterm><primary><literal>C_SRCS</literal></primary></indexterm>
+               <listitem>
+                 <para>All C source files found.</para>
+               </listitem>
+             </varlistentry>
+
+             <varlistentry>
+               <term><literal>C_OBJS</literal></term>
+               <indexterm><primary><literal>C_OBJS</literal></primary></indexterm>
+               <listitem>
+                 <para>Object files derived from
+                 <literal>C_SRCS</literal>.</para>
+               </listitem>
+             </varlistentry>
+
+             <varlistentry>
+               <term><literal>SCRIPT_SRCS</literal></term>
+               <indexterm><primary><literal>SCRIPT_SRCS</literal></primary></indexterm>
+               <listitem>
+                 <para>All script source files found
+                 (<literal>.lprl</literal> files).</para>
+               </listitem>
+             </varlistentry>
+
+             <varlistentry>
+               <term><literal>SCRIPT_OBJS</literal></term>
+               <indexterm><primary><literal>SCRIPT_OBJS</literal></primary></indexterm>
+               <listitem>
+                 <para><quote>object</quote> files derived from
+                 <literal>SCRIPT_SRCS</literal>
+                 (<literal>.prl</literal> files).</para>
+               </listitem>
+             </varlistentry>
+
+             <varlistentry>
+               <term><literal>HSC_SRCS</literal></term>
+               <indexterm><primary><literal>HSC_SRCS</literal></primary></indexterm>
+               <listitem>
+                 <para>All <literal>hsc2hs</literal> source files
+                 (<literal>.hsc</literal> files).</para>
+               </listitem>
+             </varlistentry>
+
+             <varlistentry>
+               <term><literal>HAPPY_SRCS</literal></term>
+               <indexterm><primary><literal>HAPPY_SRCS</literal></primary></indexterm>
+               <listitem>
+                 <para>All <literal>happy</literal> source files
+                 (<literal>.y</literal> or <literal>.hy</literal> files).</para>
+               </listitem>
+             </varlistentry>
+
+             <varlistentry>
+               <term><literal>OBJS</literal></term>
+               <indexterm><primary>OBJS</primary></indexterm>
+               <listitem>
+                 <para>the concatenation of
+                 <literal>&dollar;(HS_OBJS)</literal>,
+                 <literal>&dollar;(C_OBJS)</literal>, and
+                 <literal>&dollar;(SCRIPT_OBJS)</literal>.</para>
+               </listitem>
+             </varlistentry>
+           </variablelist>
+
+           <para>Any or all of these definitions can easily be
+            overriden by giving new definitions in your
+            <filename>Makefile</filename>.</para>
+
+           <para>What, exactly, does <filename>paths.mk</filename>
+            consider a <quote>source file</quote> to be?  It's based
+            on the file's suffix (e.g. <filename>.hs</filename>,
+            <filename>.lhs</filename>, <filename>.c</filename>,
+            <filename>.hy</filename>, etc), but this is the kind of
+            detail that changes, so rather than enumerate the source
+            suffices here the best thing to do is to look in
+            <filename>paths.mk</filename>.</para>
+         </listitem>
+       </varlistentry>
+
+       <varlistentry>
+         <term><filename>opts.mk</filename></term>
+         <indexterm><primary>opts.mk</primary></indexterm>
+         <listitem>
+           <para>defines <Command>make</Command> variables for option
+            strings to pass to each program. For example, it defines
+            <constant>HC&lowbar;OPTS</constant><indexterm><primary>HC&lowbar;OPTS</primary></indexterm>,
+            the option strings to pass to the Haskell compiler.  See
+            <Xref LinkEnd="sec-suffix">.</para>
+         </listitem>
+       </varlistentry>
+
+       <varlistentry>
+         <term><filename>suffix.mk</filename></term>
+         <indexterm><primary>suffix.mk</primary></indexterm>
+         <listitem>
+           <para>defines standard pattern rules&mdash;see <Xref
+           LinkEnd="sec-suffix">.</para>
+         </listitem>
+       </varlistentry>
+      </variablelist>
 
 <para>
 Any of the variables and pattern rules defined by the boilerplate file
@@ -2034,10 +2906,10 @@ directive simply override the default ones in <filename>boilerplate.mk</filename
 <Sect2 id="sec-suffix">
 <Title>Pattern rules and options
 
-<IndexTerm><Primary>Pattern rules</Primary></IndexTerm></Title>
+<indexterm><primary>Pattern rules</primary></indexterm></Title>
 
 <para>
-The file <filename>suffix.mk</filename><IndexTerm><Primary>suffix.mk</Primary></IndexTerm> defines standard <Emphasis>pattern
+The file <filename>suffix.mk</filename><indexterm><primary>suffix.mk</primary></indexterm> defines standard <Emphasis>pattern
 rules</Emphasis> that say how to build one kind of file from another, for
 example, how to build a <filename>.o</filename> file from a <filename>.c</filename> file.  (GNU <Command>make</Command>'s
 <Emphasis>pattern rules</Emphasis> are more powerful and easier to use than Unix
@@ -2062,8 +2934,8 @@ Almost all the rules look something like this:
 Here's how to understand the rule.  It says that
 <Emphasis>something</Emphasis><filename>.o</filename> (say <filename>Foo.o</filename>) can be built from
 <Emphasis>something</Emphasis><filename>.c</filename> (<filename>Foo.c</filename>), by invoking the C compiler
-(path name held in <Constant>&dollar;(CC)</Constant>), passing to it the options
-<Constant>&dollar;(CC&lowbar;OPTS)</Constant> and the rule's dependent file of the rule
+(path name held in <constant>&dollar;(CC)</constant>), passing to it the options
+<constant>&dollar;(CC&lowbar;OPTS)</constant> and the rule's dependent file of the rule
 <Literal>&dollar;&lt;</Literal> (<filename>Foo.c</filename> in this case), and putting the result in
 the rule's target <Literal>&dollar;@</Literal> (<filename>Foo.o</filename> in this case).
 </para>
@@ -2072,12 +2944,12 @@ the rule's target <Literal>&dollar;@</Literal> (<filename>Foo.o</filename> in th
 Every program is held in a <Command>make</Command> variable defined in
 <filename>mk/config.mk</filename>&mdash;look in <filename>mk/config.mk</filename> for the
 complete list.  One important one is the Haskell compiler, which is
-called <Constant>&dollar;(HC)</Constant>.
+called <constant>&dollar;(HC)</constant>.
 </para>
 
 <para>
 Every program's options are are held in a <Command>make</Command> variables called
-<Constant>&lt;prog&gt;&lowbar;OPTS</Constant>.  the <Constant>&lt;prog&gt;&lowbar;OPTS</Constant> variables are defined in
+<constant>&lt;prog&gt;&lowbar;OPTS</constant>.  the <constant>&lt;prog&gt;&lowbar;OPTS</constant> variables are defined in
 <filename>mk/opts.mk</filename>.  Almost all of them are defined like this:
 </para>
 
@@ -2090,45 +2962,45 @@ CC_OPTS = $(SRC_CC_OPTS) $(WAY$(_way)_CC_OPTS) $($*_CC_OPTS) $(EXTRA_CC_OPTS)
 </para>
 
 <para>
-The four variables from which <Constant>CC&lowbar;OPTS</Constant> is built have the following meaning:
+The four variables from which <constant>CC&lowbar;OPTS</constant> is built have the following meaning:
 </para>
 
 <para>
 <VariableList>
 
-<VarListEntry>
-<Term><Constant>SRC&lowbar;CC&lowbar;OPTS</Constant><IndexTerm><Primary>SRC&lowbar;CC&lowbar;OPTS</Primary></IndexTerm>:</Term>
-<ListItem>
+<varlistentry>
+<term><constant>SRC&lowbar;CC&lowbar;OPTS</constant><indexterm><primary>SRC&lowbar;CC&lowbar;OPTS</primary></indexterm>:</term>
+<listitem>
 <para>
 options passed to all C
 compilations.
 </para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><Constant>WAY&lowbar;&lt;way&gt;&lowbar;CC&lowbar;OPTS</Constant>:</Term>
-<ListItem>
+</listitem></varlistentry>
+<varlistentry>
+<term><constant>WAY&lowbar;&lt;way&gt;&lowbar;CC&lowbar;OPTS</constant>:</term>
+<listitem>
 <para>
 options passed to C
 compilations for way <Literal>&lt;way&gt;</Literal>. For example,
-<Constant>WAY&lowbar;mp&lowbar;CC&lowbar;OPTS</Constant> gives options to pass to the C compiler when
-compiling way <Literal>mp</Literal>.  The variable <Constant>WAY&lowbar;CC&lowbar;OPTS</Constant> holds
+<constant>WAY&lowbar;mp&lowbar;CC&lowbar;OPTS</constant> gives options to pass to the C compiler when
+compiling way <Literal>mp</Literal>.  The variable <constant>WAY&lowbar;CC&lowbar;OPTS</constant> holds
 options to pass to the C compiler when compiling the standard way.
 (<Xref LinkEnd="sec-ways"> dicusses multi-way
 compilation.)  
 </para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><Constant>&lt;module&gt;&lowbar;CC&lowbar;OPTS</Constant>:</Term>
-<ListItem>
+</listitem></varlistentry>
+<varlistentry>
+<term><constant>&lt;module&gt;&lowbar;CC&lowbar;OPTS</constant>:</term>
+<listitem>
 <para>
 options to
-pass to the C compiler that are specific to module <Literal>&lt;module&gt;</Literal>.  For example, <Constant>SMap&lowbar;CC&lowbar;OPTS</Constant> gives the specific options
+pass to the C compiler that are specific to module <Literal>&lt;module&gt;</Literal>.  For example, <constant>SMap&lowbar;CC&lowbar;OPTS</constant> gives the specific options
 to pass to the C compiler when compiling <filename>SMap.c</filename>.
 </para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><Constant>EXTRA&lowbar;CC&lowbar;OPTS</Constant><IndexTerm><Primary>EXTRA&lowbar;CC&lowbar;OPTS</Primary></IndexTerm>:</Term>
-<ListItem>
+</listitem></varlistentry>
+<varlistentry>
+<term><constant>EXTRA&lowbar;CC&lowbar;OPTS</constant><indexterm><primary>EXTRA&lowbar;CC&lowbar;OPTS</primary></indexterm>:</term>
+<listitem>
 <para>
 extra options to pass to all
 C compilations.  This is intended for command line use, thus:
@@ -2141,7 +3013,7 @@ gmake libHS.a EXTRA_CC_OPTS="-v"
 </ProgramListing>
 
 </para>
-</ListItem></VarListEntry>
+</listitem></varlistentry>
 </VariableList>
 </para>
 
@@ -2150,7 +3022,7 @@ gmake libHS.a EXTRA_CC_OPTS="-v"
 <Sect2 id="sec-targets">
 <Title>The main <filename>mk/target.mk</filename> file
 
-<IndexTerm><Primary>target.mk</Primary></IndexTerm></Title>
+<indexterm><primary>target.mk</primary></indexterm></Title>
 
 <para>
 <filename>target.mk</filename> contains canned rules for all the standard targets
@@ -2168,75 +3040,75 @@ special cases yourself.
 <para>
 <VariableList>
 
-<VarListEntry>
-<Term><Constant>HS&lowbar;PROG</Constant><IndexTerm><Primary>HS&lowbar;PROG</Primary></IndexTerm>.</Term>
-<ListItem>
+<varlistentry>
+<term><constant>HS&lowbar;PROG</constant><indexterm><primary>HS&lowbar;PROG</primary></indexterm>.</term>
+<listitem>
 <para>
-If <Constant>HS&lowbar;PROG</Constant> is defined, you get
+If <constant>HS&lowbar;PROG</constant> is defined, you get
 rules with the following targets:
 <VariableList>
 
-<VarListEntry>
-<Term><filename>HS&lowbar;PROG</filename><IndexTerm><Primary>HS&lowbar;PROG</Primary></IndexTerm></Term>
-<ListItem>
+<varlistentry>
+<term><filename>HS&lowbar;PROG</filename><indexterm><primary>HS&lowbar;PROG</primary></indexterm></term>
+<listitem>
 <para>
-itself.  This rule links <Constant>&dollar;(OBJS)</Constant>
+itself.  This rule links <constant>&dollar;(OBJS)</constant>
 with the Haskell runtime system to get an executable called
-<Constant>&dollar;(HS&lowbar;PROG)</Constant>.
+<constant>&dollar;(HS&lowbar;PROG)</constant>.
 </para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><Literal>install</Literal><IndexTerm><Primary>install</Primary></IndexTerm></Term>
-<ListItem>
+</listitem></varlistentry>
+<varlistentry>
+<term><Literal>install</Literal><indexterm><primary>install</primary></indexterm></term>
+<listitem>
 <para>
-installs <Constant>&dollar;(HS&lowbar;PROG)</Constant>
-in <Constant>&dollar;(bindir)</Constant>.
+installs <constant>&dollar;(HS&lowbar;PROG)</constant>
+in <constant>&dollar;(bindir)</constant>.
 </para>
-</ListItem></VarListEntry>
+</listitem></varlistentry>
 </VariableList>
 </para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><Constant>C&lowbar;PROG</Constant><IndexTerm><Primary>C&lowbar;PROG</Primary></IndexTerm></Term>
-<ListItem>
+</listitem></varlistentry>
+<varlistentry>
+<term><constant>C&lowbar;PROG</constant><indexterm><primary>C&lowbar;PROG</primary></indexterm></term>
+<listitem>
 <para>
-is similar to <Constant>HS&lowbar;PROG</Constant>, except that
-the link step links <Constant>&dollar;(C&lowbar;OBJS)</Constant> with the C runtime system.
+is similar to <constant>HS&lowbar;PROG</constant>, except that
+the link step links <constant>&dollar;(C&lowbar;OBJS)</constant> with the C runtime system.
 </para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><Constant>LIBRARY</Constant><IndexTerm><Primary>LIBRARY</Primary></IndexTerm></Term>
-<ListItem>
+</listitem></varlistentry>
+<varlistentry>
+<term><constant>LIBRARY</constant><indexterm><primary>LIBRARY</primary></indexterm></term>
+<listitem>
 <para>
-is similar to <Constant>HS&lowbar;PROG</Constant>, except that
-it links <Constant>&dollar;(LIB&lowbar;OBJS)</Constant> to make the library archive <Constant>&dollar;(LIBRARY)</Constant>, and
-<Literal>install</Literal> installs it in <Constant>&dollar;(libdir)</Constant>.
+is similar to <constant>HS&lowbar;PROG</constant>, except that
+it links <constant>&dollar;(LIB&lowbar;OBJS)</constant> to make the library archive <constant>&dollar;(LIBRARY)</constant>, and
+<Literal>install</Literal> installs it in <constant>&dollar;(libdir)</constant>.
 </para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><Constant>LIB&lowbar;DATA</Constant><IndexTerm><Primary>LIB&lowbar;DATA</Primary></IndexTerm></Term>
-<ListItem>
+</listitem></varlistentry>
+<varlistentry>
+<term><constant>LIB&lowbar;DATA</constant><indexterm><primary>LIB&lowbar;DATA</primary></indexterm></term>
+<listitem>
 <para>
 &hellip;
 </para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><Constant>LIB&lowbar;EXEC</Constant><IndexTerm><Primary>LIB&lowbar;EXEC</Primary></IndexTerm></Term>
-<ListItem>
+</listitem></varlistentry>
+<varlistentry>
+<term><constant>LIB&lowbar;EXEC</constant><indexterm><primary>LIB&lowbar;EXEC</primary></indexterm></term>
+<listitem>
 <para>
 &hellip;
 </para>
-</ListItem></VarListEntry>
-<VarListEntry>
-<Term><Constant>HS&lowbar;SRCS</Constant><IndexTerm><Primary>HS&lowbar;SRCS</Primary></IndexTerm>, <Constant>C&lowbar;SRCS</Constant><IndexTerm><Primary>C&lowbar;SRCS</Primary></IndexTerm>.</Term>
-<ListItem>
+</listitem></varlistentry>
+<varlistentry>
+<term><constant>HS&lowbar;SRCS</constant><indexterm><primary>HS&lowbar;SRCS</primary></indexterm>, <constant>C&lowbar;SRCS</constant><indexterm><primary>C&lowbar;SRCS</primary></indexterm>.</term>
+<listitem>
 <para>
-If <Constant>HS&lowbar;SRCS</Constant>
+If <constant>HS&lowbar;SRCS</constant>
 is defined and non-empty, a rule for the target <Literal>depend</Literal> is included,
 which generates dependency information for Haskell programs.
-Similarly for <Constant>C&lowbar;SRCS</Constant>.
+Similarly for <constant>C&lowbar;SRCS</constant>.
 </para>
-</ListItem></VarListEntry>
+</listitem></varlistentry>
 </VariableList>
 </para>
 
@@ -2257,7 +3129,7 @@ install :: $(HS_PROG)
 GNU <Command>make</Command> treats double-colon rules as separate entities.  If there
 are several double-colon rules for the same target it takes each in
 turn and fires it if its dependencies say to do so.  This means that
-you can, for example, define both <Constant>HS&lowbar;PROG</Constant> and <Constant>LIBRARY</Constant>, which will
+you can, for example, define both <constant>HS&lowbar;PROG</constant> and <constant>LIBRARY</constant>, which will
 generate two rules for <Literal>install</Literal>.  When you type <Command>gmake install</Command> both
 rules will be fired, and both the program and the library will be
 installed, just as you wanted.
@@ -2268,25 +3140,25 @@ installed, just as you wanted.
 <Sect2 id="sec-subdirs">
 <Title>Recursion
 
-<IndexTerm><Primary>recursion, in makefiles</Primary></IndexTerm>
-<IndexTerm><Primary>Makefile, recursing into subdirectories</Primary></IndexTerm></Title>
+<indexterm><primary>recursion, in makefiles</primary></indexterm>
+<indexterm><primary>Makefile, recursing into subdirectories</primary></indexterm></Title>
 
 <para>
-In leaf <filename>Makefile</filename>s the variable <Constant>SUBDIRS</Constant><IndexTerm><Primary>SUBDIRS</Primary></IndexTerm> is undefined.
-In non-leaf <filename>Makefile</filename>s, <Constant>SUBDIRS</Constant> is set to the list of
+In leaf <filename>Makefile</filename>s the variable <constant>SUBDIRS</constant><indexterm><primary>SUBDIRS</primary></indexterm> is undefined.
+In non-leaf <filename>Makefile</filename>s, <constant>SUBDIRS</constant> is set to the list of
 sub-directories that contain subordinate <filename>Makefile</filename>s.  <Emphasis>It is up to
-you to set <Constant>SUBDIRS</Constant> in the <filename>Makefile</filename>.</Emphasis> There is no automation here&mdash;<Constant>SUBDIRS</Constant> is too important to automate.
+you to set <constant>SUBDIRS</constant> in the <filename>Makefile</filename>.</Emphasis> There is no automation here&mdash;<constant>SUBDIRS</constant> is too important to automate.
 </para>
 
 <para>
-When <Constant>SUBDIRS</Constant> is defined, <filename>target.mk</filename> includes a rather
+When <constant>SUBDIRS</constant> is defined, <filename>target.mk</filename> includes a rather
 neat rule for the standard targets (<Xref LinkEnd="sec-standard-targets"> that simply invokes
 <Command>make</Command> recursively in each of the sub-directories.
 </para>
 
 <para>
 <Emphasis>These recursive invocations are guaranteed to occur in the order
-in which the list of directories is specified in <Constant>SUBDIRS</Constant>. </Emphasis>This
+in which the list of directories is specified in <constant>SUBDIRS</constant>. </Emphasis>This
 guarantee can be important.  For example, when you say <Command>gmake boot</Command> it
 can be important that the recursive invocation of <Command>make boot</Command> is done
 in one sub-directory (the include files, say) before another (the
@@ -2296,101 +3168,123 @@ first, and the most dependent last.
 
 </Sect2>
 
-<Sect2 id="sec-ways">
-<Title>Way management
-
-<IndexTerm><Primary>way management</Primary></IndexTerm></Title>
-
-<para>
-We sometimes want to build essentially the same system in several
-different ``ways''.  For example, we want to build GHC's <Literal>Prelude</Literal>
-libraries with and without profiling, with and without concurrency,
-and so on, so that there is an appropriately-built library archive to
-link with when the user compiles his program.  It would be possible to
-have a completely separate build tree for each such ``way'', but it
-would be horribly bureaucratic, especially since often only parts of
-the build tree need to be constructed in multiple ways.
-</para>
-
-<para>
-Instead, the <filename>target.mk</filename><IndexTerm><Primary>target.mk</Primary></IndexTerm> contains some clever magic to
-allow you to build several versions of a system; and to control
-locally how many versions are built and how they differ.  This section
-explains the magic.
-</para>
-
-<para>
-The files for a particular way are distinguished by munging the
-suffix.  The ``normal way'' is always built, and its files have the
-standard suffices <filename>.o</filename>, <filename>.hi</filename>, and so on.  In addition, you can build
-one or more extra ways, each distinguished by a <Emphasis>way tag</Emphasis>.  The
-object files and interface files for one of these extra ways are
-distinguished by their suffix.  For example, way <Literal>mp</Literal> has files
-<filename>.mp&lowbar;o</filename> and <filename>.mp&lowbar;hi</filename>.  Library archives have their way tag the other
-side of the dot, for boring reasons; thus, <filename>libHS&lowbar;mp.a</filename>.
-</para>
-
-<para>
-A <Command>make</Command> variable called <Constant>way</Constant> holds the current way tag.  <Emphasis><Constant>way</Constant>
-is only ever set on the command line of a recursive invocation of
-<Command>gmake</Command>.</Emphasis> It is never set inside a <filename>Makefile</filename>.  So it is a global
-constant for any one invocation of <Command>gmake</Command>.  Two other <Command>make</Command>
-variables, <Constant>way&lowbar;</Constant> and <Constant>&lowbar;way</Constant> are immediately derived from <Constant>&dollar;(way)</Constant> and
-never altered.  If <Constant>way</Constant> is not set, then neither are <Constant>way&lowbar;</Constant> and
-<Constant>&lowbar;way</Constant>, and the invocation of <Command>make</Command> will build the ``normal way''.
-If <Constant>way</Constant> is set, then the other two variables are set in sympathy.
-For example, if <Constant>&dollar;(way)</Constant> is ``<Literal>mp</Literal>'', then <Constant>way&lowbar;</Constant> is set to ``<Literal>mp&lowbar;</Literal>''
-and <Constant>&lowbar;way</Constant> is set to ``<Literal>&lowbar;mp</Literal>''.  These three variables are then used
-when constructing file names.
-</para>
-
-<para>
-So how does <Command>make</Command> ever get recursively invoked with <Constant>way</Constant> set?  There
-are two ways in which this happens:
-</para>
-
-<para>
-
-<ItemizedList>
-<ListItem>
-
-<para>
- For some (but not all) of the standard targets, when in a leaf
-sub-directory, <Command>make</Command> is recursively invoked for each way tag in
-<Constant>&dollar;(WAYS)</Constant>.  You set <Constant>WAYS</Constant> to the list of way tags you want these
-targets built for.  The mechanism here is very much like the recursive
-invocation of <Command>make</Command> in sub-directories (<Xref LinkEnd="sec-subdirs">).
-
-It is up to you to set <Constant>WAYS</Constant> in your <filename>Makefile</filename>; this is how you
-control what ways will get built.  
-</para>
-</ListItem>
-<ListItem>
-
-<para>
- For a useful collection of
-targets (such as <filename>libHS&lowbar;mp.a</filename>, <filename>Foo.mp&lowbar;o</filename>) there is a rule which
-recursively invokes <Command>make</Command> to make the specified target, setting the
-<Constant>way</Constant> variable.  So if you say <Command>gmake Foo.mp&lowbar;o</Command> you should see a
-recursive invocation <Command>gmake Foo.mp&lowbar;o way=mp</Command>, and <Emphasis>in this
-recursive invocation the pattern rule for compiling a Haskell file
-into a <filename>.o</filename> file will match</Emphasis>.  The key pattern rules (in <filename>suffix.mk</filename>)
-look like this:
-
+    <sect2 id="sec-ways">
+      <title>Way management</title>
+      <indexterm><primary>way management</primary></indexterm>
+
+      <para>We sometimes want to build essentially the same system in
+      several different ``ways''.  For example, we want to build GHC's
+      <literal>Prelude</literal> libraries with and without profiling,
+      so that there is an appropriately-built library archive to link
+      with when the user compiles his program.  It would be possible
+      to have a completely separate build tree for each such ``way'',
+      but it would be horribly bureaucratic, especially since often
+      only parts of the build tree need to be constructed in multiple
+      ways.</para>
+
+      <para>Instead, the
+      <filename>target.mk</filename><indexterm><primary>target.mk</primary></indexterm>
+      contains some clever magic to allow you to build several
+      versions of a system; and to control locally how many versions
+      are built and how they differ.  This section explains the
+      magic.</para>
+
+      <para>The files for a particular way are distinguished by
+      munging the suffix.  The <quote>normal way</quote> is always
+      built, and its files have the standard suffices
+      <filename>.o</filename>, <filename>.hi</filename>, and so on.
+      In addition, you can build one or more extra ways, each
+      distinguished by a <emphasis>way tag</emphasis>.  The object
+      files and interface files for one of these extra ways are
+      distinguished by their suffix.  For example, way
+      <literal>mp</literal> has files
+      <filename>.mp&lowbar;o</filename> and
+      <filename>.mp&lowbar;hi</filename>.  Library archives have their
+      way tag the other side of the dot, for boring reasons; thus,
+      <filename>libHS&lowbar;mp.a</filename>.</para>
+
+      <para>A <Command>make</Command> variable called
+      <constant>way</constant> holds the current way tag.
+      <emphasis><constant>way</constant> is only ever set on the
+      command line of <Command>gmake</Command></emphasis> (usually in
+      a recursive invocation of <command>gmake</command> by the
+      system).  It is never set inside a
+      <filename>Makefile</filename>.  So it is a global constant for
+      any one invocation of <Command>gmake</Command>.  Two other
+      <Command>make</Command> variables,
+      <constant>way&lowbar;</constant> and
+      <constant>&lowbar;way</constant> are immediately derived from
+      <constant>&dollar;(way)</constant> and never altered.  If
+      <constant>way</constant> is not set, then neither are
+      <constant>way&lowbar;</constant> and
+      <constant>&lowbar;way</constant>, and the invocation of
+      <Command>make</Command> will build the <quote>normal
+      way</quote>.  If <constant>way</constant> is set, then the other
+      two variables are set in sympathy.  For example, if
+      <constant>&dollar;(way)</constant> is ``<Literal>mp</Literal>'',
+      then <constant>way&lowbar;</constant> is set to
+      ``<Literal>mp&lowbar;</Literal>'' and
+      <constant>&lowbar;way</constant> is set to
+      ``<Literal>&lowbar;mp</Literal>''.  These three variables are
+      then used when constructing file names.</para>
+
+      <para>So how does <Command>make</Command> ever get recursively
+      invoked with <constant>way</constant> set?  There are two ways
+      in which this happens:</para>
+
+      <itemizedlist>
+       <listitem>
+         <para>For some (but not all) of the standard targets, when
+          in a leaf sub-directory, <Command>make</Command> is
+          recursively invoked for each way tag in
+          <constant>&dollar;(WAYS)</constant>.  You set
+          <constant>WAYS</constant> in the
+          <filename>Makefile</filename> to the list of way tags you
+          want these targets built for.  The mechanism here is very
+          much like the recursive invocation of
+          <Command>make</Command> in sub-directories (<Xref
+          LinkEnd="sec-subdirs">).  It is up to you to set
+          <constant>WAYS</constant> in your
+          <filename>Makefile</filename>; this is how you control what
+          ways will get built.</para>
+       </listitem>
+
+       <listitem>
+         <para>For a useful collection of targets (such as
+          <filename>libHS&lowbar;mp.a</filename>,
+          <filename>Foo.mp&lowbar;o</filename>) there is a rule which
+          recursively invokes <Command>make</Command> to make the
+          specified target, setting the <constant>way</constant>
+          variable.  So if you say <Command>gmake
+          Foo.mp&lowbar;o</Command> you should see a recursive
+          invocation <Command>gmake Foo.mp&lowbar;o way=mp</Command>,
+          and <Emphasis>in this recursive invocation the pattern rule
+          for compiling a Haskell file into a <filename>.o</filename>
+          file will match</Emphasis>.  The key pattern rules (in
+          <filename>suffix.mk</filename>) look like this:
 
 <ProgramListing>
 %.$(way_)o : %.lhs
       $(HC) $(HC_OPTS) $&#60; -o $@
 </ProgramListing>
 
+          Neat, eh?</para>
+       </listitem>
 
-Neat, eh?
-</para>
-</ListItem>
+       <listitem>
+         <para>You can invoke <command>make</command> with a
+         particular <literal>way</literal> setting yourself, in order
+         to build files related to a particular
+         <literal>way</literal> in the current directory.  eg.
 
-</ItemizedList>
+<screen>
+$ make way=p
+</screen>
 
-</para>
+          will build files for the profiling way only in the current
+          directory. </para>
+       </listitem>
+      </itemizedlist>
 
 </Sect2>
 
@@ -2401,7 +3295,7 @@ Neat, eh?
 Sometimes the canned rule just doesn't do the right thing.  For
 example, in the <Literal>nofib</Literal> suite we want the link step to print out
 timing information.  The thing to do here is <Emphasis>not</Emphasis> to define
-<Constant>HS&lowbar;PROG</Constant> or <Constant>C&lowbar;PROG</Constant>, and instead define a special purpose rule in
+<constant>HS&lowbar;PROG</constant> or <constant>C&lowbar;PROG</constant>, and instead define a special purpose rule in
 your own <filename>Makefile</filename>.  By using different variable names you will avoid
 the canned rules being included, and conflicting with yours.
 </para>
@@ -2413,9 +3307,14 @@ the canned rules being included, and conflicting with yours.
 <Sect1 id="sec-booting-from-C">
 <Title>Booting/porting from C (<filename>.hc</filename>) files
 
-<IndexTerm><Primary>building GHC from .hc files</Primary></IndexTerm>
-<IndexTerm><Primary>booting GHC from .hc files</Primary></IndexTerm>
-<IndexTerm><Primary>porting GHC</Primary></IndexTerm></Title>
+<indexterm><primary>building GHC from .hc files</primary></indexterm>
+<indexterm><primary>booting GHC from .hc files</primary></indexterm>
+<indexterm><primary>porting GHC</primary></indexterm></Title>
+
+    <para><emphasis>NOTE: GHC version 5.xx is significantly harder to
+    bootstrap from C than previous versions.  We recommend starting
+    from version 4.08.2 if you need to bootstrap in this
+    way.</emphasis></para>
 
 <para>
 This section is for people trying to get GHC going by using the supplied
@@ -2450,7 +3349,7 @@ command will execute the whole build process (it won't install yet):
 <Screen>
 foo% distrib/hc-build --prefix=INSTALL_DIRECTORY
 </Screen>
-<IndexTerm><Primary>--hc-build</Primary></IndexTerm>
+<indexterm><primary>--hc-build</primary></indexterm>
 <para>
 By default, the installation directory is <filename>/usr/local</filename>.  If
 that is what you want, you may omit the argument to
@@ -2476,9 +3375,9 @@ the adventure&hellip;(ToDo: porting tips&mdash;stuff to look out for, etc.)
 <Sect1 id="sec-build-pitfalls">
 <Title>Known pitfalls in building Glasgow Haskell
 
-<IndexTerm><Primary>problems, building</Primary></IndexTerm>
-<IndexTerm><Primary>pitfalls, in building</Primary></IndexTerm>
-<IndexTerm><Primary>building pitfalls</Primary></IndexTerm></Title>
+<indexterm><primary>problems, building</primary></indexterm>
+<indexterm><primary>pitfalls, in building</primary></indexterm>
+<indexterm><primary>building pitfalls</primary></indexterm></Title>
 
 <para>
 WARNINGS about pitfalls and known ``problems'':
@@ -2487,16 +3386,16 @@ WARNINGS about pitfalls and known ``problems'':
 <para>
 
 <OrderedList>
-<ListItem>
+<listitem>
 
 <para>
 One difficulty that comes up from time to time is running out of space
 in <literal>TMPDIR</literal>.  (It is impossible for the configuration stuff to
 compensate for the vagaries of different sysadmin approaches to temp
 space.)
-<IndexTerm><Primary>tmp, running out of space in</Primary></IndexTerm>
+<indexterm><primary>tmp, running out of space in</primary></indexterm>
 
-The quickest way around it is <Command>setenv TMPDIR /usr/tmp</Command><IndexTerm><Primary>TMPDIR</Primary></IndexTerm> or
+The quickest way around it is <Command>setenv TMPDIR /usr/tmp</Command><indexterm><primary>TMPDIR</primary></indexterm> or
 even <Command>setenv TMPDIR .</Command> (or the equivalent incantation with your shell
 of choice).
 
@@ -2512,8 +3411,8 @@ in all cases.
 
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
 In compiling some support-code bits, e.g., in <filename>ghc/rts/gmp</filename> and even
@@ -2521,16 +3420,16 @@ in <filename>ghc/lib</filename>, you may get a few C-compiler warnings.  We thin
 are OK.
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
 When compiling via C, you'll sometimes get ``warning: assignment from
 incompatible pointer type'' out of GCC.  Harmless.
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
 Similarly, <Command>ar</Command>chiving warning messages like the following are not
@@ -2544,8 +3443,8 @@ ar: filename GlaIOMonad__2_2s.o truncated to GlaIOMonad_
 
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
  In compiling the compiler proper (in <filename>compiler/</filename>), you <Emphasis>may</Emphasis>
@@ -2554,7 +3453,7 @@ vagaries of different systems, it seems.  The solution is simple:
 
 
 <ItemizedList>
-<ListItem>
+<listitem>
 
 <para>
  If you're compiling with GHC 4.00 or later, then the
@@ -2562,26 +3461,26 @@ vagaries of different systems, it seems.  The solution is simple:
 is somewhat unlikely, since the maximum is set to 64M by default.
 Anyway, you can raise it with the
 <Option>-optCrts-M&lt;size&gt;</Option> flag (add this flag to
-<Constant>&lt;module&gt;&lowbar;HC&lowbar;OPTS</Constant>
+<constant>&lt;module&gt;&lowbar;HC&lowbar;OPTS</constant>
 <Command>make</Command> variable in the appropriate
 <filename>Makefile</filename>).
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
  For GHC &#60; 4.00, add a suitable <Option>-H</Option> flag to the <filename>Makefile</filename>, as
 above.
 
 </para>
-</ListItem>
+</listitem>
 
 </ItemizedList>
 
 
 and try again: <Command>gmake</Command>.  (see <Xref LinkEnd="sec-suffix"> for information about
-<Constant>&lt;module&gt;&lowbar;HC&lowbar;OPTS</Constant>.)
+<constant>&lt;module&gt;&lowbar;HC&lowbar;OPTS</constant>.)
 
 Alternatively, just cut to the chase:
 
@@ -2592,8 +3491,8 @@ Alternatively, just cut to the chase:
 
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
 If you try to compile some Haskell, and you get errors from GCC about
@@ -2605,11 +3504,11 @@ this bug also suggests that you have an old GCC.
 
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
-You <Emphasis>may</Emphasis> need to re-<Command>ranlib</Command><IndexTerm><Primary>ranlib</Primary></IndexTerm> your libraries (on Sun4s).
+You <Emphasis>may</Emphasis> need to re-<Command>ranlib</Command><indexterm><primary>ranlib</primary></indexterm> your libraries (on Sun4s).
 
 
 <Screen>
@@ -2625,8 +3524,8 @@ We'd be interested to know if this is still necessary.
 
 
 </para>
-</ListItem>
-<ListItem>
+</listitem>
+<listitem>
 
 <para>
 GHC's sources go through <Command>cpp</Command> before being compiled, and <Command>cpp</Command> varies
@@ -2652,7 +3551,7 @@ Alas, <Command>cpp</Command> doesn't tell you the offending file!
 
 Workaround: don't put weird things in string args to <Command>cpp</Command> macros.
 </para>
-</ListItem>
+</listitem>
 
 </OrderedList>
 
@@ -2672,240 +3571,84 @@ You should read the GHC installation guide sections on Windows (in the user
 guide) before continuing to read these notes.
 </para>
 
-<para>
-Because of various hard-wired infelicities, you need to copy
-<Filename>bash.exe</Filename> (from GHC's <Filename>extra-bin</Filename>
-directory), and <Filename>perl.exe</Filename> and
-<Filename>cat.exe</Filename> (from GHC's <Filename>bin</Filename> directory)
-to <Filename>/bin</Filename> (discover where your Cygwin root directory is
-by typign <Command>mount</Command>).
-</para>
 
+<Sect2><Title>Before you start</Title>
+
+<itemizedlist>
+<listitem>
 <para>
-Before you start, you need to make sure that the user environment variable
-<Constant>MAKE_MODE</Constant> is set to <Literal>UNIX</Literal>. If you
+Make sure that the user environment variable
+<constant>MAKE_MODE</constant> is set to <Literal>UNIX</Literal>. If you
 don't do this you get very weird messages when you type
 <Command>make</Command>, such as:
-</para>
-<Screen>
-/c: /c: No such file or directory</Screen>
-
-<Sect2><Title>Configuring ssh</Title>
-
-<ItemizedList>
-
-<ListItem>
-<para>
-Generate a key, by running <filename>c:/user/local/bin/ssh-keygen1</filename>.
-  This generates a public key in <filename>.ssh/identity.pub</filename>, and a
-  private key in <filename>.ssh/identity</filename>
-</para>
-
-<para>
-  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 <Command>ssh</Command>, so the best
-  thing to do is simply to protect your <filename>.ssh</filename> directory, and
-  <filename>.ssh/identity</filename> from access by anyone else.  To do this 
-  right-click your <filename>.ssh</filename> 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!)
-</para>
-
-<para>
-  If you have problems running <Command>ssh-keygen1</Command>
-  from within <Command>bash</Command>, start up <filename>cmd.exe</filename> and run it as follows:
-</para>
-
 <Screen>
-c:\tmp> set CYGWIN32=tty
-c:\tmp> c:/user/local/bin/ssh-keygen1
+/c: /c: No such file or directory
 </Screen>
-</ListItem>
-
-<ListItem>
-<para>
-If you don't have an account on <Literal>cvs.haskell.org</Literal>, send 
-  your <filename>.ssh/identity.pub</filename> to the CVS repository administrator
-  (currently Jeff Lewis <Email>jlewis@cse.ogi.edu</Email>).  He will set up
-  your account.
-</para>
-
-<para>
-  If you do have an account on <Literal>cvs.haskell.org</Literal>, use TeraTerm
-  to logon to it. Once in, copy the
-  key that <Command>ssh-keygen1</Command> deposited in <filename>/.ssh/identity.pub</filename> into
-  your <filename>~/.ssh/authorized_keys</filename>. Make sure that the new version
-  of <filename>authorized_keys</filename> still has 600 file permission.
-</para>
-</ListItem>
-
-</ItemizedList>
-
-</Sect2>
-
-
-<Sect2><Title>Configuring CVS</Title>
-
-<ItemizedList>
-
-<ListItem>
-<para>
-From the System control panel,
-set the following <Emphasis>user</Emphasis> environment variables (see the GHC user guide)
-</para>
-
-<ItemizedList>
-<ListItem>
-<para>
-<Constant>HOME</Constant>: points to your home directory.  This is where CVS
-will look for its <filename>.cvsrc</filename> file.
 </para>
-</ListItem>
-
-<ListItem>
-<para>
-<Constant>CVS_RSH</Constant>: <filename>c:/path_to_ghc/extra-bin/ssh</filename>
-</para>
-</ListItem>
-
-<ListItem>
-<para>
-<Constant>CVSROOT</Constant>: <Literal>:ext:username@cvs.haskell.org:/home/cvs/root</Literal>,
-where <Literal>username</Literal> is your userid
-</para>
-</ListItem>
-
-<ListItem>
-<para>
-<Constant>CVSEDITOR</Constant>: <filename>bin/gnuclient.exe</filename> if you want to use an Emacs buffer for typing in those long commit messages.
-</para>
-</ListItem>
-
-<ListItem>
-<para>
-<Constant>SHELL</Constant>: To use bash as the shell in Emacs, you need to
-set this to point to <Filename>bash.exe</Filename>.
-</para>
-</ListItem>
-
-</ItemizedList>
-</ListItem>
-
-<ListItem>
-<para>
-Put the following in <filename>$HOME/.cvsrc</filename>:
-</para>
-
-<ProgramListing>
-checkout -P
-release -d
-update -P
-diff -u
-</ProgramListing>
-
-<para>
-These are the default options for the specified CVS commands,
-and represent better defaults than the usual ones.  (Feel
-free to change them.)
-</para>
-
-<para>
-Filenames starting with <filename>.</filename> 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; <filename>.cvsrc</filename> is entirely
-optional.
-</para>
-</ListItem>
+</listitem>
 
-<ListItem>
-<para>
-Try doing <Command>cvs co fpconfig</Command>. All being well, bytes should
-start to trickle through, leaving a directory <filename>fptools</filename>
-in your current directory.  (You can <Command>rm</Command> it if you don't
-want to keep it.) The following messages appear to be harmless:
+<listitem>
+<para>GHC uses the <emphasis>mingw</emphasis> C compiler to
+generate code, so you have to install that. Just pick up a mingw bundle at
+<ulink url="http://www.mingw.org/">http://www.mingw.org/</ulink>.
+We install it in <filename>c:/mingw</filename>.
 </para>
+</listitem>
 
-<Screen>
-setsockopt IPTOS_LOWDELAY: Invalid argument
-setsockopt IPTOS_THROUGHPUT: Invalid argument
-</Screen>
-
+<listitem>
 <para>
-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
-for some reason 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.
+Install a version of GHC, and put it in your
+<constant>PATH</constant> (the installer tells you the path element
+you need to add upon completion.)
 </para>
-</ListItem>
+</listitem>
 
-<ListItem>
+<!--
+<listitem>
 <para>
-If you want to check out part of large tree, proceed as follows:
+Because of various hard-wired infelicities, you need to copy
+<Filename>bash.exe</Filename>, <Filename>perl.exe</Filename> and
+<Filename>cat.exe</Filename> (from Cygwin's <Filename>bin</Filename>
+directory), to <Filename>/bin</Filename> (discover where your Cygwin
+root directory is by typing <Command>mount</Command>). If
+<Command>/bin</Command> points to the Cygwin <Filename>bin</Filename>
+directory, there's no need to copy anything.
 </para>
+</listitem>
 
-<ProgramListing>
-cvs -f checkout -l papers
-cd papers
-cvs update cpr
-</ProgramListing>
-
+<listitem>
 <para>
-This sequence checks out the <Literal>papers</Literal> module, but none
-of its sub-directories.
-The "<Option>-l</Option>" flag says not to check out sub-directories.
-The "<Option>-f</Option>" flag says not to read the <filename>.cvsrc</filename> file
-whose <Option>-P</Option> default (don't check out empty directories) is
-in this case bogus.
+By default, cygwin provides the command shell <filename>ash</filename>
+as <filename>sh.exe</filename>. It has a couple of 'issues', so
+in your <filename>/bin</filename> directory, make sure that <filename>
+bash.exe</filename> is also provided as <filename>sh.exe</filename>.
 </para>
+</listitem>
 
-<para>
-The <Command>cvs update</Command> command sucks in a named sub-directory.
-</para>
-</ListItem>
 
-</ItemizedList>
+<listitem>
+<para> Both <command>cvs</command> and <command>ssh</command>
+come with Cygwin, but make sure you select them when running
+the Cygwin installer.
+</listitem>
 
-<para>
-There is a very nice graphical front-end to CVS for Win32 platforms,
-with a UI that people will be familiar with, at 
-<ULink URL="http://www.wincvs.org/">wincvs.org</ULink>.
-I have not tried it yet.
+<listitem>
+<para> Check out a copy of GHC sources from
+the CVS repository, following the instructions above (<xref linkend="cvs-access">).
 </para>
+</listitem>
+</itemizedlist>
+</sect2>
 
-</Sect2>
-
-
-    <Sect2><Title>Building GHC</Title>
+<Sect2><Title>Building GHC</Title>
       
-      <ItemizedList>
-
-       <ListItem>
-         <para>
-           You should give the option
-           <option>--host=i386-unknown-mingw32</option> to
-           <command>autoconf</command>, so that it doesn't try to
-           build for Cygwin (unless that's what you really
-           want). Since it's possible to get into trouble using the
-           wrong C compiler, it's wise either to avoid installing
-           Cygwin gcc, or to explicitly specify
-           <option>--with-gcc=/mingw/bin/gcc</option>.
-         </para>
-       </ListItem>
+<ItemizedList>
 
-<ListItem>
+<listitem>
 <para>
-You have to run <Command>autoconf</Command> both in <filename>fptools</filename>
+Run <Command>autoconf</Command> both in <filename>fptools</filename>
 and in <filename>fptools/ghc</filename>.  If you omit the latter step you'll
 get an error when you run <filename>./configure</filename>:
-</para>
-
 <Screen>
 ...lots of stuff...
 creating mk/config.h
@@ -2915,20 +3658,42 @@ running /bin/sh ./configure  --cache-file=.././config.cache --srcdir=.
 ./configure: ./configure: No such file or directory
 configure: error: ./configure failed for ghc
 </Screen>
-</ListItem>
+</para>
+</listitem>
 
-<ListItem>
+<listitem>
 <para>
-You need <filename>ghc</filename> to be in your <Constant>PATH</Constant> before you run
-<Command>configure</Command>. The InstallShield tells you the path
-when you install it.
+You either need to add <filename>ghc</filename> to your
+<constant>PATH</constant> before you invoke
+<Command>configure</Command>, or use the <Command>configure</Command>
+option <option>--with-ghc=c:/ghc/ghc-some-version/bin/ghc</option>.
+
+</para>
+<para>
+The Windows installer for GHC tells you at the end what
+additions you need to make to your <constant>PATH</constant>.
+</para>
+</listitem>
+
+<listitem>
+  <para> 
+    After <command>autoconf</command> run <command>./configure</command> in
+    <filename>fptools/</filename> thus:
+
+<Screen>
+  ./configure --host=i386-unknown-mingw32 --with-gcc=/mingw/bin/gcc
+</Screen>
+
+Both these options are important! It's possible to get into
+trouble using the wrong C compiler!
 </para>
-</ListItem>
+</listitem>
 
 </ItemizedList>
-
 </Sect2>
 
+
+<!--
     <sect2>
       <title>Building the Windows InstallShield&reg; Installer</title>
 
@@ -2991,9 +3756,6 @@ extra-bin/
   perl56.dll
 gcc-lib/
   Mingwin gcc binaries, libraries and headers
-imports/
-  com/
-    imports for HDirect's com library
 include/
   Mingwin includes
 </screen>
@@ -3001,6 +3763,7 @@ include/
        </sect3>
       
     </sect2>
+-->
 
 </Sect1>