Compiling and Installing XOE from sources

This chapter covers the process of building XOE and Kaffe for various architectures.

Prerequisites

In order to build Kaffe and the XOE framework you will need at least the following tools:

Working with the Sources

The sources for XOE and Kaffe are available from several locations. You will find a compressed archive in the src directory of your distribution. The XOE_1.0.tgz will contain the following modules in the src directory.

Using tvt-make

The tvt-make scripts are bourne shell scripts designed to ease the process of building, installing and running the XOE framework. The simplest way to build everything at once is:



# ./tvt-make -a [arch]

This script is in the tvt-make module and it will in turn call all of the following:



# ./tvt-make-kaffe -a [arch]
        # ./tvt-make-klasses -a [arch]
        # ./tvt-make-fgl -a [arch]
        # ./tvt-make-ipl -a [arch]
        # ./tvt-make-xoe

Passing -h to these scripts will list possible options as well as the available targets/architectures. When you first use tvt-make it will prompt you for the localtion of your CVS checkouts and for the location you wish to store the results of your builds. These values, along with some other settings are the stores in the ~/.tvtmakerc. If all goes well you will be left with a file structure like this (taking i386 as an example target):



$TVTDEST/
        |-- i386/
        |   |-- archive/
        |   |-- Klasses.jar 
        |   `-- kaffe 
        |-- archive/
        `-- xoe.jar
	

Where $TVTDEST is the location you chose for tvt-make to store resulting bonaries. The archive directory contains a configuratable number (normally 10) of previous builds with date-encoded filenames.

Creating and modifying target configurations

Within tvt-make is a directory called config.d. This directory contains all the configuration information for each supported configuration. To add a configuration for a new architecture/target simply create a directory in config.d with the name of the new target. Each target directory contains a file tvt-make.config which sets up target specific environment variable for tvt-make. The other files in the config.d directory are lists of ./configure options for the various modules. The simplest way to add a configuration is to make a copy of an existing one and modify it to suit your needs.

Building by hand

Building by hand is significantly more complicated. Studying the actions performed by the tvt-make scripts is the best way to get insight into this process. Knowledge of the GNU build system is certainly required before attempting to build XOE and Kaffe by hand. Essentially it is possible to build each module using the standard GNU build process of:


	

# ./autogen.sh [options]
        # ./make
        # ./make install

The autogen.sh script call aclocal and autoconf with the appropriate options. Because Kaffe is so flexible, and depends on the FGL and IPL modules, there are many configuration details that must be taken into account. If you want to know what the possible configuration options for a given module are then simly execute:



# ./configure --help

To find out which options are currently recommended for a given target/architecture check the options specified in the tvt-make module. tvt-make stored configuration options on the config.d directory. This directory contains a subdirectory for each target containing, among others, the following files

These files are simply lists of ./configure options for the respective modules. For example tvt-make/config.d/i386/kaffe.config contains the following lines:



--with-x
        --with-staticlib
        --with-threads=unix-jthreads

These options will configure Kaffe to the desktop X-windows enviroment. Once you have chosen to confiuration options required for each module, and assuming that you have all the CVS modules checked out in the same directory you can build Kaffe as follows:



# ROOT=`pwd`
        # cd fgl
        # ./autogen.sh --with-confdir=$ROOT/kaffe/build-gnu/config [other fgl options]
        # cd ..
        # cd ipl
        # ./autogen.sh --with-confdir=$ROOT/kaffe/build-gnu/config [other ipl options]
        # cd ..
        # cd kaffe/build-gnu
        # ./autogen.sh [kaffe options]
        # make
        # make classes

The --with-confdir tells configure where to put it's output files so that the Kaffe build process will pick up on them. If you want to build Kaffe for multiple targets it is recommended that you make a separate build directory for each target as follows:



# mkdir build-myarch
        # cd build-myarch
        # ../build-gnu/autogen.sh 
        # make
        # make classes

Once you have configured and built kaffe and Klasses.jar you can use it to build the XOE core classes against. To build XOE you must first set you CLASSPATH environment variable to point to the latest Klasses.jar, then run

./autogen.sh && make
in the top level directory of the xoe module. If you want a .jar archive to be created use
make jar