FAQ for Cygnus Win32
====================

Author: Dalibor Topic <robilad@kaffe.org>

Preparation
===========

You need the latest Cygwin. Since there are no Cygwin releases,
only a steady stream of updates and improvements, it is safe
to say that you need the latest. You can get Cygwin from 

	http://www.cygwin.com

You also need Jikes to build the class library. I'd recommend 
the latest version, at time of writing that is 1.22. You can get 
jikes from

	http://jikes.sf.net

You also need to apply one or two patches to jikes, in order to
fix some Cygwin specific bugs in it. See

http://sourceforge.net/tracker/index.php?func=detail&aid=1202863&group_id=128803&atid=712760
http://sourceforge.net/tracker/index.php?func=detail&aid=1202185&group_id=128803&atid=712760

for details. The first patch is for jikes 1.22, the second one is 
for jikes CVS head.

There is a jikes package in Cygwin now, but it can not be used yet
to compile GNU Classpath, which Kaffe uses as its class library.

You'll need the latest GNU Classpath CVS head. Instructions how to 
get it can be found on http://www.classpath.org

You'll Sun's javac in order to build GNU Classpath. Sun's JDK can be 
found at http://java.sun.com.

There is a Kaffe port to mingw32, and it would be great if someone 
volunteered to merge it into the main tree. For more information, see
http://www.kaffe.org/pipermail/kaffe/2003-January/092896.html
http://kaffe.org/pipermail/kaffe/2004-April/097829.html

GNU Classpath
=============

You need to build GNU Classpath first. After checking out Classpath,
make sure that you have Sun's JDK installed locally. Then, make sure
that Cygwin can find javac in its path, for example by setting

export PATH=$PATH:/cygdrive/c/Programme/Java/jdk1.6.0_01/bin

The actual path will depend on where Sun's JDK is installed.

I use the following cofiguration options

	../classpath/configure --disable-gtk-peer --disable-plugin \
	--disable-gconf-peer --with-javac="javac -target 1.5 -J-Xmx512M"

--disable-gtk-peer disables the building of the GTK peers, since the
version in Cygwin is not current enough.

--disable-plugin disables the building of the Mozilla plugin, since it 
does not serve much purpose without GTK peers.

--disable-gconf-peer disables the building of GConf peers, since the
version in Cygwin is not current enough.

--with-javac="javac -target 1.5 -J-Xmx512M" uses Sun's javac to build
GNU Classpath's java classes, targetting Java 1.5 for the bytecode,
and using up to 512M of memory for the compilation. We need to target 
1.5, since the default for javac in JDK 1.6 are 1.6 JVMs. We need to 
ask for more memory, since the default Sun JVM memory limit is too small
to compile GNU Classpath.

Running 

	make 

builds GNU Classpath. It also currently results in various warnings. If 
you fix them, please submit your patches to the GNU Classpath bug tracker. 

Running 

	make install

results in GNU Classpath being installed to /usr/local/classpath.

Configuration
=============

I tried various configuration options, and eventually settled for

	../kaffe/configure --disable-native-awt --disable-gconf-peer \
	--with-system-classpath --enable-pure-java-math \
	--disable-shared --with-engine=intrp

--disable-native-awt disables the AWT build. I was not interested in 
building graphical applications for Cygwin/XFree86 and enabling it means 
dealing with X11 headers, Gtk+, ... which I didn't have a need for.
If someone makes the Qt4 peers work with Qt4-win32, please send you patches,
screenshots and success stories to the Kaffe mailing list kaffe@kafe.org.

--disable-gconf-peer disables the building of GConf peers, since the
version in Cygwin is not current enough.

--enable-pure-java-math If you are not using crypto and don't have 
gmp installed.

--disable-shared Is necessary to make sure that libtool does not try to 
build shared libraries.

--with-engine=intrp Selects the interpreter engine, which passes more 
regression tests on Cygwin than the default jit engine.

--with-system-classpath Uses the freshly installed GNU Classpath, rather
than the one inside Kaffe's sources.

Status
======

With this setup, and after a round or two of make && make check, I get 
139 passes out of 150 regression tests with the interpreter engine, and
126 passes for the jit engine using the default unix-pthreads, and
for --with-threads=unix-jthreads I get 142 passes for interpreter and 
131 for the jit engine.

There probably are various issues that the compiler warnings should be 
able to help interested developers fix. As usual, I'd appreciate patches. 
