TOBA

Porting Hints


Toba was designed with portability in mind. The current release supports Irix, Linux, and Solaris, although only the Linux implementation has just-in-time compiler support. Ports to other Unix systems should be fairly straightforward.

System Requirements

C Environment

Toba requires an ANSI C platform with the following features:

JDK

Toba requires version 1.0.2 of the Java Developers Kit on the host platform. Cross-building to a different target platform is not supported. Toba will not work with version 1.0.1 or 1.1 of the JDK.

Garbage Collector

Toba uses the Boehm-Demers conservative garbage collector. This package has been widely ported and should build on most popular Unix boxes. If the garbage collector has not been ported to your machine it will have to be ported before you can build Toba. See the garbage collector's home page for more information. If you wish to use Toba without a garbage collector or with a different garbage collector you will have to edit runtime/alloc.c, runtime/lang_Runtime.c, runtime/monitor.c and runtime/runtime.c.

AWT

Toba uses the BISS AWT package to provide AWT support. This package uses the X windowing system to display graphics. If X is not available, the BISS AWT will have to be ported to the underlying graphics system. The BISS AWT also requires thread support. See the BISS home page for more information.

Configuration

Porting the Toba code itself involves setting up the make process, writing a threads interface and adjusting the code for any compile problems during the build.

Makefile

The build process is specified in the top-level Makefile, platform-specific files in the ./configs directory, and the Makefiles in the sub-directories. The definitions used to parameterize the build process are described in ./configs/basic.mk, where the default values are set. Each Makefile includes this file, as well as ./configs/current.mk, which is used to override the default definitions with platform-specific settings. Platform-specific configurations are provided for: To build for a new system, create a new configuration file that overrides the default compilation settings, and change the configs/current.mk symlink to point to the new file. The Makefile target all builds the entire Toba system except for AWT support; the target all_awt adds AWT.

Driver Script

While building, Toba generates a shell-script driver program called bin/toba. This file is generated with flags from the top-level Makefile and with the bin/toba.sh file. If you need to make changes to the driver script you should edit the bin/toba.sh file and not the generated bin/toba file.

Threads Interface

There is a level of abstraction between the runtime system and the underlying threads package. This isolates the changes that need to be made to port to another threads package to two files. Each thread interface must provide a source file and a header file. These files are named runtime/sthreads_package.c and runtime/sthreads_package.h where package is the thread interface package defined in the top level Makefile. During the build a link is made from sthreads.c and sthreads.h to one set of these files. Several interface definitions are provided:

The underlying thread package that is used MUST be supported by the garbage collector. The garbage collector may require that certain flags be defined when compiling the collector and the threads interface package; set these in the GCCFLAGS Makefile variable. The C compiler may also require that certain flags be set when including C header files. These flags should be added to the CBUILD variable.

Feedback

If you succeed in porting Toba to a new platform, please send the information back to the Sumatra project so that we can consider it for inclusion in future releases. We ask that you follow a few guidelines in any changes you make:


index | usage | differences | native code | implementation | porting | releases | installation || home
http://www.cs.arizona.edu/sumatra/toba/doc/porting.html (April, 1998)