TOBA

Using Toba


Toba combines components of a Java program to build an executable file. Components can be source files, class files, object files, or library files. One component should contain a single static void main(String []) method, which becomes the initial entry point.

Synopsis

toba [options] file...

Example: toba -o myprog main.java helper.java more.java

Options

-o filename write executable to filename instead of a.out
-R libdir embed libdir as the library directory instead of the default

-K  produce class files from Java source but go no further
-C  produce C files but do not compile or link
-S  produce .s files but do not assemble or link
-c  compile to .o files but do not link

-I path set the include path for the C compiler
-g  pass -g (enable debugging) to cc
-O  pass -O (enable optimization) to cc
-A string add string to arguments passed to cc

-i  retain intermediate files upon exit
-v  ("verbose") list shell commands as executed

-d flags set debugging flags for Toba
-J  use interpreted versions of javac and Toba
-X  use directly executable javac and Toba (default)

File Arguments

file.java Java source file to compile and link
file.class Java class file to translate and link
file.c C source file to compile and link
file.o object file to link
file.a library to link
file.so library to link
-lxxx library to link (cannot be the first file named)
classname  Java class to link from $CLASSPATH

Environment Variables

The following environment variables affect execution of a Toba-built program:
TOBA_HEAP Initial size of allocated memory, in bytes.
TOBA_NOCOLLECT Inhibits garbage collection if set.
CLASSPATH Sets the java.class.path system property. (At translation time, affects searching for class files.)
JAVA_HOME Sets the java.home system property.

Caveats

Java class files must be available for all superclasses of class files processed by Toba. Classes are loaded from the path specified by the CLASSPATH environment variable, or, if not found there, from the Java API collection or finally the current directory. Classes must exist as individual .class files; Toba cannot unpack collections stored as .zip files.

When the components of a program are compiled separately, .h files generated by toba -C must be available for all referenced classes. The current directory, the API directory, and any directories specified by -I are searched.

The toba script uses timestamps to find files created by intermediate steps. Concurrent execution of two toba scripts in the same directory is likely to confuse both scripts.

The toba script must be executed by its true path, either explicitly or through the usual shell search mechanisms. Execution through a symbolic link in another directory does not work.


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