-
Notifications
You must be signed in to change notification settings - Fork 2
/
BOOTSTRAP
106 lines (77 loc) · 4.75 KB
/
BOOTSTRAP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Boostrapping Notes for Gwydion
==============================
The d2c compiler is written in Dylan. This is good because Dylan is a
nice language for writing many types of program, including compilers.
Unfortunately, this makes it hard to compile d2c if you don't already
have a Dylan compiler. To work around this problem, the Gwydion Group
at CMU wrote Mindy, a Dylan-like interpreter implemented in C. Mindy
is missing a number of Dylan features (most notably macros), so we
have to be careful not to use those features in d2c itself, but it's
a lot better than nothing.
There are several possible scenarios, which the ./configure script is
pretty good at figuring out for you based on asking the installed d2c
(d2c --compiler-info) and looking at the source code you have
(CURRENT_BOOTSTRAP_COUNTER defined in configure.in). You can also
force some scenarios using command line arguments to ./configure.
Here's what happens in each case:
1) You already have an up-to-date version of d2c installed, and wish to
build a compatable version of d2c from the source: REGULAR_BUILD
This is the best scenario. You can find d2c binaries on our FTP site;
see the README and INSTALL files for details. On desktop machines
in mid 2003 this takes anywhere from five minutes to half an hour.
2) You have d2c version 2.2.0 or later installed, and you wish to build
a more recent version of d2c from the source: BOOTSTRAPPING_WITH_D2C
If you can find an up-to-date d2c binary, see (1) above. If not, you'll
need to bootstrap d2c using d2c. This is a two-stage process: first
a temporary version of d2c will be built and then this temporary version
will automatically be used to build your new d2c. This takes a
bit less than twice as long as (1) because not everything is built
for the temporary version.
3) You don't want d2c at all, but Mindy looks tempting.
Run './configure --disable-d2c'
4) You want d2c, can't find a binary for d2c, but d2c already
supports your platform: BOOTSTRAPPING_WITH_MINDY
This is also the scenario to use when you want a clean bootstrap to a
newer version of d2c than this one.
You'll need to bootstrap d2c using Mindy. This involves compiling Mindy,
building a bytecode-compiled copy of d2c that runs (very slowly) under
Mindy, and using that copy of d2c to compile a new version, as per step
(2) above. This automatically happens when configure doesn't find a
pre-installed binary. After configure, run "make", and the rest will
happen automagically.
This takes anything from several hours to several days.
If this process fails, subscribe to gd-hackers and tell us what
happened, or send a bug report to gd-bugs.
Here is the process in more detail:
a) Ensure you have a clean environment. Remove any existing d2c
installations from your PATH and undefine DYLANDIR.
b) Run autogen.sh, configure, make, and make install. Force the Mindy
bootstrap by giving the "--enable-mindy-bootstrap" option to the
configure command.
c) Add the d2c you just installed to the PATH and set DYLANDIR to the
PREFIX you configured in (b). This step will complete scenario (4).
d) Delete autom4te.cache.
e) Re-run configure, make, and make install. Your previous configure
command will be listed in the first few lines of config.log; do not
include the "--enable-mindy-bootstrap" option this time. This step
will complete scenario (2) and you will be left with a
fully-functional d2c installation.
6) You want to run d2c on your platform, but d2c doesn't support it yet.
This is the fun part. You'll need to port Mindy and d2c to your
platform, which will require some work. Start by subscribing to the
gd-hackers mailing list. Next, make sure that the Boehm GC runs on your
platform. Then, look at platforms.descr and add a system description.
At this point, unless you've got some brand new platform, chances are
pretty good that someone has done this before you on the same or a
closely-related platform, though in some cases it might have been a
while ago and bitrot may have set in.
All that remains is to try (3) over and over again, making changes
until you get a working d2c. When you get things working, please tell
gd-hackers and we'll arrange to integrate your patches into the next
release.
Alternatively, you may be able to cross-compile using d2c. If you make
this work, please describe your experience to gd-hackers. The initial
version of d2c for LinuxPPC was done by copying the generated C files
from x86 Linux to the LinuxPPC machine.
Of course, if something doesn't work that should, please send a bug
report to gd-hackers and we'll look into it.