What's here?
=============
include/ --- the I9 library interface files.

libi9/ --- the source code for the runtime library you'll want to link into
programs your compiler produces. This has the implementations of
things like _I_alloc_i, and the various methods given in the
IO and Conv modules.

gc6.8/ --- the source code for Boehm-Demers-Weise conservative garbage collector,
version 6.8. The runtime library relies on it for GC. See
http://www.hpl.hp.com/personal/Hans_Boehm/gc/ for more information.

These two things are combined by the Makefile into libi9.a

demangle/ --- a little utility that can turn things like _Imain_paii
into things like main(int[][]). You can pass error messages from the
linker through it to make them nicer, or use it to help debug
name encoding problems.

This gets compiled into i9filt.

common/ --- just a bit of code that's shared between the demangler utility
and libi9.

example/ --- the .s files are of most interest here, since they show
what your output might look like, and give examples of syntax
to produce. With libi9 compiled, you can turn them into runnable form
by doing something like this:

gcc -o arr example/arr.s -L. -li9

The -L. option tells to look for libraries in the current directory (.)
and -li9 tells to link in libi9. -o arr tells to name the output
arr (or arr.exe). If you don't include the -o, it'll get named
something like a.out or a.exe. GCC is used for this since it knows how to find
the assembler and the linker and what standard libraries to include.
Note that the C compiler (cc1) isn't actually invoked here.

You can use a command like this to test your output as well. For convenience,
we also include a little script, linki9.sh. It basically does the same
thing, but also passes the output through i9filt to get nicer link errors,
and tries to figure out where libi9 is located so it can work if you invoke it
from a different directory. The makefile uses it to compile examples,
like this:
   ./linki9.sh examples/fact.s -o examples/fact

Now, the .s files were not produced by hand. They were created by running
gcc -S -masm=intel on the corresponding .c files and then hand-editting things
that were not cross-platform out and adding the comments.

Makefile --- tells the make command how to compile all of the above.

Building
========

Windows:
-------------------------
To use this runtime, and to test your compiler on Windows, you'll need to
install Cygwin and the gcc toolchain for it. (Cygwin is a compatibility
layer that lets one use Unix programs like gcc, ld, as and make on Windows)

To do this, do the following:
1) Go to cygwin.org
2) Click the "Install cygwin now" link to download its setup.exe
3) Run setup.exe
4) Go through the wizard. When it asks what packages to install,
   under the Devel category, make sure to activate "gcc" and "make"
5) When finished, you'll get a start menu/desktop icon that launches the
   cygwin interface. Now you can go where you have this archive extracted,
   and type make.

In case you're not familiar with Unix command-line, you may find the following
helpful:
- Paths are separate with forward slashes, not backwards slashes
- Cygwin turns drive letters into subdirectories of /cygdrive/. So for
  example E:\CS4120\PA5 will become /cygdrive/e/CS4120/PA5
- Important commands:
    cd --- change directory. cd .. moves up one level
    ls --- list current directory
    pwd --- print working directory

OS X:
----------------------
Note: OS X's assembler seems to have problems with Intel syntax

You will need gcc. It's included in the Xcode tools package.

If you're using Snow Leopard, you'll need to add -m32 to ABI_FLAG settings
in Makefile and linki9.sh

When it's installed, go to directory where this archive is extracted, and run
make. (See the end of the above section if you're unfamiliar with the
command line)


Unix:
-------------------
Make sure you have gcc installed, and run make (or gmake, on BSD systems)
in this archives root directory
