
How do I compile the class library?
-----------------------------------

Cd to your build directory (the same as the source directory if you
did ./configure), then cd to libraries/javalib/external/classpath/lib.

Type "make".

This will build the java libraries, put them in a glibj.zip file
and overwrite the version in your source tree.  Type "make install"
to install the jar file in your target prefix.

If you have added or removed files from the javalib tree, you will have
to update Makefile.am, Makefile.in and Makefile. Do this as follows:

    $ cd ../..
    $ sh developers/autogen.sh
    $ ./configure

Also note that some files are Kaffe specific, due to some classes not
yet being merged with GNU Classpath, and being part of the GNU Classpath 
VM interface. Those classes exist in libraries/javalib/vmspecific 
directory.

Please use the version of automake as described in FAQ.automake.
This version will minimize your diffs with the CVS tree as it is 
the version used by the kaffe developers.

If you want to rebuild not only Klasses.jar, but also the jar-files of
Kaffe extensions, type "make CLASSDIRS=all Klasses".

How do I set the compiler?
--------------------------

The ./configure script has several options to chose a compiler. If you 
don't set it at all, the build system will try to use the jikes compiler

Setting --with-jikes=yes will use the jikes compiler if one can
be found. You can also specify the absolute path to a jikes executable
using --with-jikes=/absolute-path-to/jikes.

What compilers are known to work?
---------------------------------

* jikes

The preferred compiler is jikes. The URL for jikes is:

  http://jikes.sf.net/

Please note that jikes 1.14 and 1.15 have bugs that result in a
miscompiled Klasses.jar file.

The recommended version of jikes is 1.22 or higher.

* gcjx

gcjx is the next generation of gcj. It is being developed in the 
gcjx-branch of the gcc CVS. In order to check it out and build it
see 
	http://gcc.gnu.org/cvs.html

As there are no releases of gcjx, you need to get it from CVS.
You can check out the gcjx source code from the gcc CVS using:

	cvs -d :ext:anoncvs@savannah.gnu.org:/cvsroot/gcc  \
	-qz9 co -P -rgcjx-branch gcc 

Then 
	cd gcc/gcjx ; configure && make && make install

In order to compile kaffe's class library, you need to set JAVAC_FLAGS
to "-bootclasspath /full/path/to/builddir/libraries/javalib/lib/",
with "/full/path/to/builddir" replaced by the full path to the directory
where you are building the Kaffe source code.

It works with gcjx from 2005-09-15, and should continue to work with 
later versions.

* ecj

The eclipse compiler works as well. ecj is part of the eclipse project:

  http://www.eclipse.org

If you cannot find ecj in this project site, just download Eclipse SDK
(eclipse-SDK-3.1.1 at the time of this writing), and read the document
"Compiling Java code". Then you will find that the following shell script
will work as ecj.

#!/bin/sh
exec path_to_a_working_Java_VM \
	-classpath path_to_org.eclipse.jdt.core.jar \
	org.eclipse.jdt.internal.compiler.batch.Main \
	"$@"
 
By the way, there is a "distribution" of ecj itself in the debian
repository (ecj-bootstrap). You can get that code from 
http://packages.qa.debian.org/e/ecj-bootstrap.html

The ./configure script accepts an option to use ecj:

  --with-ecj=ECJ          Define to use ECJ as the java compiler instead of
                          jikes

It works with ecj 0.548, pre-3.1.0 milestone-6, and should work with later 
versions as well.  The wrapping shell script of ecj shown above also works. 

What compilers are known not to work?
-------------------------------------

FSF's gcj doesn't work up to version 4.0.1

In order to compile the class library with gcj to bytecodes instead of
native code, you need to pass it the "-C" flag. Unfortunately, gcj has
some bugs that prevent it from compiling kaffe's class library at the
moment.

If you have managed to compile the class library using any version of
gcj, please write to kaffe@kaffe.org.

* javac 

Sun's javac compiler from JDK 1.3 - JDK 1.5 doesn't work, since the GNU
Classpath build system does not support it.

No known older version of Sun's javac compiler (up through JDK 1.2)
will compile Kaffe's classes, due to bugs in Sun's compiler.

* kjc

kjc may work as well, but it has not been tried for a while with GNU 
Classpath sources. kjc is part of the Kopi project:

  http://www.dms.at/kopi/kjc.html

Kaffe used to ship a patched version of kjc 2.1B. That version is still
available in source code form from the kjc module in kaffe's CVS. See

   http://www.kaffe.org/anoncvs.shtml 

for details on how to check it out.

How do I adapt / use a precompiled class library?
-------------------------------------------------

If you are using kaffe on an embedded system, you may want to use only
a part of the functionality provided by the class library. For
example, you may not need JAXP or AWT on your system. So you shouldn't
have to waste space on the device by including classes you are not
going to use.

Kaffe supports using a user-defined class library instead of the 
included one. The configure script option to use is 
--with-glibj-zip=/absolute/path/to/your/class/library .

That allows you to precompile kaffe's class library on a faster
platform than the one you're building on, for example.

You can not use the class library from another JVM, since the native
method signatures are likely going to differ.
