]> gitweb @ CieloNegro.org - pkgsrc-ghc.git/blob - TODO
7.0.1 for powerpc-apple-darwin (but crashes on --interactive)
[pkgsrc-ghc.git] / TODO
1 .. -*- rst -*-
2
3 ============
4 wip/ghc TODO
5 ============
6
7 * Build more bootstrapping HC archives to support more platforms.
8
9
10 --------------------------
11 How to build an HC archive
12 --------------------------
13
14 It's basically the same as the `Porting Guide
15 <http://hackage.haskell.org/trac/ghc/wiki/Building/Porting>`_, plus
16 some minor tweaks.
17
18 Extract the source archive and duplicate the source tree, one for
19 ``-target`` and one for ``-host``::
20
21     $ tar jxf ghc-{VERSION}-src.tar.bz2
22     $ cp -r ghc-{VERSION} ghc-{VERSION}-target
23     $ mv ghc-{VERSION} ghc-{VERSION}-host
24
25 Build some configuration files::
26
27     $ cd ghc-{VERSION}-target
28     $ ln -s /bin/pwd utils/ghc-pwd/ghc-pwd
29     $ ./configure --enable-hc-boot
30     $ echo "INTEGER_LIBRARY = integer-simple" > mk/build.mk
31     $ gmake bootstrapping-files
32     $ cd ..
33
34 Run ``./configure`` on the host tree::
35
36     $ cd ghc-{VERSION}-host
37     $ ./configure
38
39 Then create ``ghc-{VERSION}-host/mk/build.mk`` with the following
40 contents::
41
42     PORTING_HOST = YES
43     GhcUnregisterised = YES
44     GhcLibHcOpts = -O -fvia-C -keep-hc-files
45     GhcRtsHcOpts = -keep-hc-files
46     GhcLibWays = v
47     GhcRTSWays =
48     SplitObjs = NO
49     GhcWithNativeCodeGen = NO
50     GhcWithInterpreter = NO
51     GhcStage1HcOpts = -O
52     GhcStage2HcOpts = -O -fvia-C -keep-hc-files
53     SRC_HC_OPTS += -H32m
54     GhcWithSMP = NO
55     utils/ghc-pkg_dist-install_v_HC_OPTS += -keep-hc-files
56     
57     INTEGER_LIBRARY = integer-simple
58
59 Copy some configuration files from the ``-target`` tree::
60
61     $ cp ../ghc-{VERSION}-target/includes/{ghcautoconf.h,DerivedConstants.h,GHCConstants.h} includes/
62
63 Build it::
64
65     $ gmake
66
67 Create an intermediate tarball::
68
69     $ rm -f list mkfiles boot.tar.gz
70     $ find . -name "*.hi" >> list
71     $ find . -name "*.hc" >> list
72     $ find . -name "*_stub.c" >> list
73     $ find . -name "*_stub.h" >> list
74     $ find . -name package-data.mk >> list
75     $ find . -name package.conf.d >> list
76     $ find . -name package.conf.inplace >> list
77     $ ls compiler/stage?/build/Config.hs >> list
78     $ echo compiler/prelude/primops.txt >> list
79     $ ls compiler/primop-*.hs-incl >> list
80     $ find . -name .depend | sed -e 's/^/mkdir -p `dirname /' -e 's/$/`/' >> mkfiles
81     $ find . -name .depend | sed "s/^/touch /" >> mkfiles
82     $ echo mkfiles >> list
83     $ tar -zcf boot.tar.gz -T list
84
85 Then extract it again, in a different directory::
86
87     $ mkdir ghc-{VERSION}
88     $ cd ghc-{VERSION}
89     $ tar zxf ../boot.tar.gz
90
91 Modify hard-coded paths in inplace ``.conf`` files, and then
92 re-archive the HC tree::
93
94     $ sed -i.bak -e 's#'`dirname \`pwd\``'#[[GHC_SOURCE_PATH]]#g' \
95           inplace/lib/package.conf.d/*.conf \
96           */*/package-data.mk \
97           */*/*/package-data.mk
98     $ cd ..
99     $ tar jcf ghc-{VERSION}-boot-{PLATFORM}.tar.bz2 ghc-{VERSION}
100
101 Done. Upload the archive to some host and add it to the ``Makefile``.