Adding new classes
Mark Wielaard
mark@klomp.org
Sun Jul 22 03:10:00 GMT 2001
Hi Nic,
On Sun, Jul 22, 2001 at 03:43:04AM +0100, Nic Ferrier wrote:
> Can someone give me a brief overview of how I add a class to GCJ's
> library implementation?
>
> I'm trying to add some of Mark Wielaard's 1.2 class loading stuff
> from Classpath.
Yeah!
> I need to add several new classes in several different places, at the
> moment the compiler is complaining about one of the new classes
> (java.lang.Package).
>
> I suspect this is because I haven't waved the dead chicken over the
> right parts of the config system.
In theory I know how to do this, but in practice I have also problems
with adding the Throwable chained exceptions and StackTraceElement
support.
So I will tell you what I just did and what the errors are that I get
by doing it that way. If you then tell me what you did and what errors
you get we will have eliminated two (of the thirty thousand :) ways that
we can do this wrong.
What I did was get the 'magic' automake described in the HACKING file.
Then I added the java/lang/StackTraceElement.java file in libjava and
added a line with that filename to the 'core_java_source_files' list in
Makefile.am file in that directory. And the run automake in the libjava
directory. This creates a new Makefile.in file which can then be turned
into a real Makefile by running configure.
So far so good. After doing that I have a new libgcj installation that
lets me play with StackTraceElement which works fine.
But if I now try to use this new class in libgcj itself something goes
wrong. Just adding a new field private ste StraceTraceElement to the
class Throwable seems to blow up the make process. Since the generated
Throwable.h file now includes a reference to the new
::java::lang::StackTraceElement that the compiler doesn't seem able to
find.
At this point I am a bit stuck. How far did you get?
Cheers,
Mark
--
Stuff to read:
< http://www.toad.com/gnu/whatswrong.html >
What's Wrong with Copy Protection, by John Gilmore
More information about the Java
mailing list