I've gotten Japhar integration to work. As you can see from my previous
message, it is fully runtime binary compatible with their existing JDK
support. After some modest amount of grief, I was able to get all of my
existing java.io and java.net tests to run, with the exception of those that
rely on functional areas we have not implemented yet. Those principally
consist of:
-- Converting Floats and Doubles to Strings, and vice versa
-- Anything that requires PropertyResourceBundles
-- Anything that needs java.lang.Character (which needs ResourceBundles
working)
I am going to work on those in the immediate future, so by the time you read
this these areas might possibly be working.
Here are some instructions if you want to try this out. These may seem long
and complex, but 95% of them have nothing to do with the actual
integration. They are just the normal vagaries of compiling things out of
CVS.
-- Fetch the latest and greatest copies of Japhar and Classpath from CVS
-- Download my Japhar patches from
ftp://ftp.urbanophile.com/pub/arenn/patches/japhar/ There are two files in
that directory and you will need them both.
-- Apply the patches to Japhar. From the root of the Japhar source tree,
type "cat <patch file> | patch -p0"
-- Compile Japhar. This is sometimes easier said than done. First you need
to generate all of the configuration scripts. Do this with "aclocal;
autoheader; automake; autoconf". Next, you need to configure Japhar
appropriately. I suggest doing "./configure --enable-libffi
--enable-static=no --with-sun-jdk=/usr/local/jdk1.1.5". Of course you put
the correct path to your JDK in there.
-- I have encountered the following problem with this in Japhar. autoheader
gives an error message about "WITH_SYMBOL_UNDERSCORE". If you see this, you
need to edit acconfig.h and lib/libffi/acconfig.h and put a line that says
"#undef WITH_SYMBOL_UNDERSCORE" in them before running autoheader.
-- There is an --enable-classpath option to Japhar's configure, but you
don't need it.
-- Type "make", then "make install". You'll probably need to be root in
order for make install to work.
-- Next, download and install JavaDeps 1.0.4. You can get it from
http://www.CS.McGill.CA/~stever/software/JavaDeps/. The instructions for
setting it up are included in the distribution. This won't be necessary
when end users build classpath, but my instructions assume you have it and
all Classpath developers probably should.
-- Compile Classpath. We go through the same drill as Japhar, with a few
additional kinks. First run "aclocal; autoheader; automake; autoconf". Then
configure Classpath. I recommend using "./configure --enable-static=no
--with-japhar --enable-maintainer-build --with-deps=/usr/local/bin/jdeps
--with-classlib=/usr/local/jdk1.1.5/lib/classes.zip". Of course subtitute
the real locations of the jdeps executable and the JDK classes.zip file.
-- Go to the "lib" directory and edit the Makefile. Find the _last_
instance of "JAVAC" in the file and change it. Our current configuration
script uses Japhar to build our code, but it doesn't work completely right
now. So change the line to read something like "JAVAC=java -classpath
/usr/local/jdk1.1.5/lib/classes.zip sun.tools.javac.Main -classpath
../lib:/usr/local/jdk1.1.5/lib/classes.zip -d ../lib" I will hopefully fix
our build script to select this properly very soon.
-- Type "make". It will run for a while, them bomb with an error like
".deps:2868: *** commands commence before first target. Stop."
-- When make bombs, go the lib directory and edit the file ".deps" in
emacs. (vi can't handle it). Go to the line specified as having the
error. On the line before that line, there will be an extra trailing space
after the "\" character. (Look for the "STUBS" line). Remove the extra
space, save the file, and exit.
-- Go back to the root directory and type "make" again
-- After make finished, run "make install". You'll probably need to be
root.
-- Also as root, go to the directory /usr/local/classpath/lib and type "ln
-s libjavaio.so libjaphar_javaio.so". (Japhar is back to its old game of
insisting on having a japhar in the lib name again).
-- You are ready to go! Try running one of the test scripts.
-- Go to tests/java.io. Compile BufferedInputStreamTest.java by running
"java -classpath /usr/local/jdk1.1.5/lib/classes.zip sun.tools.javac.Main
BufferedInputStreamTest.java".
-- After compiling, run the test with Japhar and the Classpath library.
"japhar --classpath /users/devel/cvs/classpath/lib/glibj.zip:.
BufferedInputStreamTest"
-- Remember to substitute your correct file locations for my samples. I've
only tested this on GNU/Linux.
-- Have fun!
I will try to eliminate the hacks in the Classpath build ASAP, so by the
time you see this, they might already be unnecessary.
Last of all, Merry Christmas!
--
Aaron M. Renn ([EMAIL PROTECTED]) http://www.urbanophile.com/arenn/