XOE Developers Guide v1.0: A guide to application development within the XOE framework | ||
---|---|---|
Prev | Appendix A. Reference Material | Next |
This chapter covers the process of building XOE and Kaffe for various architectures.
In order to build Kaffe and the XOE framework you will need at least the following tools:
gcc: the gnu C compiler.
This will need to be a cross compiler if you want to build for an embedded device. This is usually included as part of a GNU toolchain package. Toolchains for several architectures are available from handhelds.org.
glibc: the gnu C library.
Compiled for each target architecture. This is usually part of the GNU toolchain. Toolchains for several architectures are available from handhelds.org.
libungif4 >=4: GIF89a decoding libraries.
You will need both libraries and header files for libungif compiled for each target architecture.
X11 Headers: The X11 development package.
You will need the X windowing system header files and libraries for each target architecture.
jikes >= 1.12: java compiler from IBM.
It is especially important to have a recent version of jikes as older versions will segfault during compilation. The latest version of jikes is available for free from IBM.
GNU autoconf >= 2.5: only required if building from CVS.
GNU automake >= 1.4: only required if building from CVS.
Actually you only need the aclocal tool which is usually packaged with automake.
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.
xoe: the core XOE framework.
xoe-packages: packages for XOE.
kaffe-all: the Kaffe java virtual machine.
ipl: simple input library for embedded programs.
fgl: frame-buffer graphics library.
calibrate: FGL/IPL application for touch screen calibration.
tvt-make: scripts for building, running and installing.
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.
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 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
kaffe.config
fgl.kaffe.config
ipl.kaffe.config
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 && makein the top level directory of the xoe module. If you want a .jar archive to be created use
make jar