<ArtHeader>
-<Title>Building and Installing the Glasgow Functional Programming Tools Suite</Title>
+<Title>Building the Glasgow Functional Programming Tools Suite</Title>
<Author><OtherName>The GHC Team</OtherName></Author>
<Address><Email>glasgow-haskell-{users,bugs}@haskell.org</Email></Address>
<PubDate>January 2000</PubDate>
<VarListEntry>
<Term>alpha-dec-{osf,linux,freebsd,openbsd,netbsd}:</Term>
-<ListItem>
-<Para>
<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>
-</Para>
+<ListItem>
<Para>
Currently non-working. The last working version (osf[1-3]) is GHC
</ListItem></VarListEntry>
<VarListEntry>
<Term>sparc-sun-sunos4:</Term>
-<ListItem>
<IndexTerm><Primary>sparc-sun-sunos4</Primary></IndexTerm>
+<ListItem>
<Para>
Probably works with minor tweaks, hasn't been tested for a while.
</ListItem></VarListEntry>
<VarListEntry>
<Term>sparc-sun-solaris2:</Term>
-<ListItem>
<IndexTerm><Primary>sparc-sun-solaris2</Primary></IndexTerm>
+<ListItem>
<Para>
Fully supported, including native-code generator.
</ListItem></VarListEntry>
<VarListEntry>
<Term>hppa1.1-hp-hpux (HP-PA boxes running HPUX 9.x)</Term>
-<ListItem>
<IndexTerm><Primary>hppa1.1-hp-hpux</Primary></IndexTerm>
+<ListItem>
<Para>
Works registerised. No native-code generator.
</ListItem></VarListEntry>
<VarListEntry>
-<Term>i386-unknown-linux (PCs running Linux—ELF format):</Term>
-<ListItem>
+<Term>i386-unknown-linux (PCs running Linux—ELF binary format):</Term>
<IndexTerm><Primary>i386-*-linux</Primary></IndexTerm>
+<ListItem>
<Para>
GHC works registerised. You <Emphasis>must</Emphasis> have GCC 2.7.x
<VarListEntry>
<Term>i386-unknown-{freebsd,netbsd,openbsd) (PCs running FreeBSD 2.2
or higher, NetBSD, and possibly OpenBSD):</Term>
-<ListItem>
-<Para>
<IndexTerm><Primary>i386-unknown-freebsd</Primary></IndexTerm>
<IndexTerm><Primary>i386-unknown-netbsd</Primary></IndexTerm>
<IndexTerm><Primary>i386-unknown-openbsd</Primary></IndexTerm>
-</Para>
+<ListItem>
<Para>
GHC works registerised. These systems provide ready-built packages of
</ListItem></VarListEntry>
<VarListEntry>
<Term>i386-unknown-cygwin32:</Term>
-<ListItem>
-<Para>
<IndexTerm><Primary>i386-unknown-cygwin32</Primary></IndexTerm>
-</Para>
+<ListItem>
<Para>
Fully supported under Win9x/NT, including a native code
</ListItem></VarListEntry>
<VarListEntry>
<Term>mips-sgi-irix5:</Term>
-<ListItem>
-<Para>
<IndexTerm><Primary>mips-sgi-irix[5-6]</Primary></IndexTerm>
-</Para>
+<ListItem>
<Para>
Port currently doesn't work, needs some minimal porting effort. As
<Para>
Here are the gory details about some utility programs you may need;
-<Command>perl</Command> and <Command>gcc</Command> are the only 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>perl</Command>, <Command>gcc</Command> and
+<command>happy</command> are the only 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>
script will tell you if you are missing something.
</Para>
<VarListEntry>
<Term>Perl:</Term>
-<ListItem>
-<Para>
<IndexTerm><Primary>pre-supposed: Perl</Primary></IndexTerm>
<IndexTerm><Primary>Perl, pre-supposed</Primary></IndexTerm>
-<Emphasis>You have to have Perl to proceed!</Emphasis> Perl is a language quite good
-for doing shell-scripty tasks that involve lots of text processing.
-It is pretty easy to install.
+<ListItem>
+<Para>
+<Emphasis>You have to have Perl to proceed!</Emphasis> Perl is a
+language quite good for doing shell-scripty tasks that involve lots of
+text processing. It is pretty easy to install.
</Para>
<Para>
</ListItem></VarListEntry>
<VarListEntry>
<Term>GNU C (<Command>gcc</Command>):</Term>
-<ListItem>
-<Para>
<IndexTerm><Primary>pre-supposed: GCC (GNU C compiler)</Primary></IndexTerm>
<IndexTerm><Primary>GCC (GNU C compiler), pre-supposed</Primary></IndexTerm>
-</Para>
+<ListItem>
<Para>
We recommend using GCC version 2.95.2 on all platforms. Failing that,
</Para>
</ListItem></VarListEntry>
+<varlistentry>
+<term>Happy:</term>
+<indexterm><primary>Happy</primary></indexterm>
+<listitem>
+<para>Happy is a parser generator tool for Haskell, and is used to
+generate GHC's parsers. Happy is written in Haskell, and is a project
+in the CVS repository (<literal>fptools/happy</literal>). It can be
+built from source, but bear in mind that you'll need GHC installed in
+order to build it. To avoid the chicken/egg problem, install a binary
+distribtion of either Happy or GHC to get started. Happy
+distributions are available from <ulink
+url="http://www.haskell.org/happy/">Happy's Web Page</ulink>.
+</para>
+</listitem>
+</varlistentry>
+
<VarListEntry>
<Term>Autoconf:</Term>
-<ListItem>
-<Para>
<IndexTerm><Primary>pre-supposed: Autoconf</Primary></IndexTerm>
<IndexTerm><Primary>Autoconf, pre-supposed</Primary></IndexTerm>
-</Para>
-
+<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
</ListItem></VarListEntry>
<VarListEntry>
<Term><Command>sed</Command></Term>
-<ListItem>
-<Para>
<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
version 2.0.4 is no good! It has a bug in it that is tickled by the
<VarListEntry>
<Term>PVM version 3:</Term>
-<ListItem>
-<Para>
<IndexTerm><Primary>pre-supposed: PVM3 (Parallel Virtual Machine)</Primary></IndexTerm>
<IndexTerm><Primary>PVM3 (Parallel Virtual Machine), pre-supposed</Primary></IndexTerm>
-</Para>
+<ListItem>
<Para>
PVM is the Parallel Virtual Machine on which Parallel Haskell programs
</ListItem></VarListEntry>
<VarListEntry>
<Term><Command>bash</Command>:</Term>
+<IndexTerm><Primary>bash, presupposed (Parallel Haskell only)</Primary></IndexTerm>
<ListItem>
<Para>
-<IndexTerm><Primary>bash, presupposed (Parallel Haskell only)</Primary></IndexTerm>
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).
<VarListEntry>
<Term>DocBook:</Term>
+<IndexTerm><Primary>pre-supposed: DocBook</Primary></IndexTerm>
+<IndexTerm><Primary>DocBook, pre-supposed</Primary></IndexTerm>
<ListItem>
<Para>
-<IndexTerm><Primary>pre-supposed: DocBook</Primary></IndexTerm>
-<IndexTerm><Primary>DocBook, pre-supposed</Primary></IndexTerm> All
-our documentation is written in SGML, using the DocBook DTD and
+All our documentation is written in SGML, using the DocBook DTD and
processed using the <ULink
URL="http://sourceware.cygnus.com/docbook-tools/">Cygnus DocBook
tools</ULink>, which is the most shrink-wrapped SGML suite that we
-could find. Unfortunately, it's only packaged as RPMs. You can use it
-to generate HTML, DVI (and hence PDF and Postscript) and RTF from any
-DocBook source file (including this manual).
+could find. You need all the RPMs except for psgml (i.e. docbook, jade,
+jadetex, sgmlcommon and stylesheets). Unfortunately, it's only packaged as
+RPMs. You can use it to generate HTML, DVI (and hence PDF and Postscript)
+and RTF from any DocBook source file (including this manual). N.B. The
+<Emphasis>Cygnus</Emphasis> version of the tools is assumed. Others, such as
+the SuSE version, may not work. Note that most of these RPMs are
+architecture neutral, so are likely to be found in a <file>noarch</file>
+directory.
</Para>
</ListItem></VarListEntry>
<VarListEntry>
<Term>TeX:</Term>
-<ListItem>
-<Para>
<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.
<Title>Other useful tools
</Title>
-<Para>
<VariableList>
-
<VarListEntry>
<Term>Flex:</Term>
-<ListItem>
-<Para>
<IndexTerm><Primary>pre-supposed: flex</Primary></IndexTerm>
<IndexTerm><Primary>flex, pre-supposed</Primary></IndexTerm>
-</Para>
+<ListItem>
<Para>
This is a quite-a-bit-better-than-Lex lexer. Used to build a couple
</Para>
</ListItem></VarListEntry>
</VariableList>
-</Para>
</Sect2>
to a shell script called <Filename><Constant>$(FPTOOLS_TOP)</Constant>/configure</Filename>.
</Para>
+<para>
+Some projects, including GHC, have their own configure script. If
+there's an
+<Constant>$(FPTOOLS_TOP)/<project>/configure.in</Constant>,
+then you need to run <command>autoconf</command> in that directory too.
+</para>
+
<Para>
Both these steps are completely platform-independent; they just mean
that the human-written file (<Filename>configure.in</Filename>) can be short, although
reverses the effect of <Literal>install</Literal>.
</Para>
</ListItem></VarListEntry>
+
<VarListEntry>
<Term><Literal>clean</Literal>:</Term>
<ListItem>
<Para>
-remove all easily-rebuilt files.
-</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. Also preserve files that could be made
+by building, but normally aren't because the distribution comes
+with them.</para>
</ListItem></VarListEntry>
+
+<varlistentry>
+<term><literal>distclean</literal>:</term>
+<listitem>
+<para>Delete all files from the current directory that are created by
+configuring or building the program. If you have unpacked the source
+and built the program without creating any other files, <literal>make
+distclean</literal> should leave only the files that were in the
+distribution.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><literal>mostlyclean</literal>:</term>
+<listitem>
+<para>Like <literal>clean</literal>, but may refrain from deleting a
+few files that people normally don't want to recompile.</para>
+</listitem>
+</varlistentry>
+
<VarListEntry>
-<Term><Literal>veryclean</Literal>:</Term>
+<Term><Literal>maintainer-clean</Literal>:</Term>
<ListItem>
<Para>
-remove all files that can be rebuilt at all.
-There's a danger here that you may remove a file that needs a more
-obscure utility to rebuild it (especially if you started from a source
-distribution).
-</Para>
-</ListItem></VarListEntry>
+Delete everything from the current directory that can be reconstructed
+with this Makefile. This typically includes everything deleted by
+<literal>distclean</literal>, plus more: C source files produced by
+Bison, tags tables, Info files, and so on.</para>
+
+<para>One exception, however: <literal>make maintainer-clean</literal>
+should not delete <filename>configure</filename> even if
+<filename>configure</filename> can be remade using a rule in the
+<filename>Makefile</filename>. More generally, <literal>make
+maintainer-clean</literal> should not delete anything that needs to
+exist in order to run <filename>configure</filename> and then begin to
+build the program.</para>
+</listitem>
+</varlistentry>
+
<VarListEntry>
<Term><Literal>check</Literal>:</Term>
<ListItem>
</Sect2>
+<sect2>
+<title>Using a project from the build tree</title>
+<para>
+If you want to build GHC (say) and just use it direct from the build
+tree without doing <literal>make install</literal> first, you can run
+the in-place driver script:
+<filename>ghc/driver/ghc-inplace</filename>.
+</para>
+
+<para> Do <emphasis>NOT</emphasis> use
+<filename>ghc/driver/ghc</filename>, or
+<filename>ghc/driver/ghc-4.xx</filename>, as these are the scripts
+intended for installation, and contain hard-wired paths to the
+installed libraries, rather than the libraries in the build tree.
+</para>
+
+<para>
+Happy can similarly be run from the build tree, using
+<filename>happy/src/happy-inplace</filename>.
+</para>
+</sect2>
+
<Sect2>
-<Title>Fast Making
-<IndexTerm><Primary>fastmake</Primary></IndexTerm>
+<Title>Fast Making <IndexTerm><Primary>fastmake</Primary></IndexTerm>
<IndexTerm><Primary>dependencies, omitting</Primary></IndexTerm>
-<IndexTerm><Primary>FAST, makefile variable</Primary></IndexTerm></Title>
+<IndexTerm><Primary>FAST, makefile
+variable</Primary></IndexTerm></Title>
<Para>
Sometimes the dependencies get in the way: if you've made a small