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 comamnd 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

    If you can't find a working d2c binary, 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.


 5) 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.
