README 2.99 KB
Newer Older
1
2
The Glasgow Haskell Compiler
============================
3

4
5
This is the source tree for GHC, a compiler and interactive
environment for the Haskell functional programming language.
6

7
For more information, visit GHC's web site:
8

9
  http://www.haskell.org/ghc/
10

11
Information for developers of GHC can be found here:
12

13
  http://hackage.haskell.org/trac/ghc/
14

15

16
17
18
Getting the Source
==================

19
There are two ways to get a source tree:
20

21
22
  1. Download source tarballs
  ---------------------------
23

24
  Download the GHC source distribution:
25

26
      ghc-<version>-src.tar.bz2
27

28
  which contains GHC itself and the "boot" libraries.
29

30
31
  2. Check out the source code from darcs
  ---------------------------------------
32

33
34
  The recommended way to get a darcs checkout is to start off by
  downloading a snapshot with a name like:
35

36
      ghc-HEAD-2009-09-09-ghc-corelibs-testsuite.tar.bz2
37

38
39
40
41
42
43
44
45
46
47
48
49
  from:

      http://darcs.haskell.org/

  and then untar it and bring it up-to-date with:

     $ cd ghc
     $ ./darcs-all get


  Alternatively you can use darcs to get the repos, but it will take a
  lot longer. First get the GHC darcs repository:
50
51
52

    $ darcs get http://darcs.haskell.org/ghc/

Ian Lynagh's avatar
Ian Lynagh committed
53
  Then run the darcs-all script in that repository
54
55
56
  to get the other repositories:

     $ cd ghc
57
58
     $ chmod +x darcs-all
     $ ./darcs-all get
59

60
  This checks out the "boot" packages.
61

62

63
64
65
Building & Installing
=====================

66
67
68
69
For full information on building GHC, see the GHC Building Guide [3].
Here follows a summary - if you get into trouble, the Building Guide
has all the answers.

70
NB. you need GHC installed in order to build GHC, because the compiler
Ian Lynagh's avatar
Ian Lynagh committed
71
72
is itself written in Haskell.  For instructions on how to port GHC to a
new platform, see the Building Guide.
73

74
75
76
77
If you're building from darcs sources (as opposed to a source
distribution) then you also need to install Happy [4] and Alex [5].

For building library documentation, you'll need Haddock [6].  To build
Ian Lynagh's avatar
Ian Lynagh committed
78
79
the compiler documentation, you need a good DocBook XML toolchain and
dblatex.
80
81
82

Quick start:  the following gives you a default build:

83
    $ perl boot
84
85
86
    $ ./configure
    $ make
    $ make install
87

88
The "perl boot" step is only necessary if this is a tree checked out
89
90
91
from darcs.  For source distributions downloaded from GHC's web site,
this step has already been performed.

92
93
94
95
96
These steps give you the default build, which includes everything
optimised and built in various ways (eg. profiling libs are built).
It can take a long time.  To customise the build, see the file
HACKING.

97

98

99
100
References
==========
101

102
103
104
105
106
107
 [1] http://www.haskell.org/ghc/                        GHC Home Page
 [2] http://hackage.haskell.org/trac/ghc                GHC Developer's Wiki
 [3] http://hackage.haskell.org/trac/ghc/wiki/Building  Building Guide
 [4] http://www.haskell.org/happy/                      Happy
 [5] http://www.haskell.org/alex/                       Alex
 [6] http://www.haskell.org/haddock/                    Haddock
108

109

110
111
Contributors
============
112

113
Please see
Ian Lynagh's avatar
Ian Lynagh committed
114

115
   http://www.haskell.org/ghc/contributors.html