Proposal: make gcjh default to JNI mode
Thomas Fitzsimmons
fitzsim@redhat.com
Thu Apr 28 17:39:00 GMT 2005
On Thu, 2005年04月28日 at 12:09 -0400, Bryce McKinlay wrote:
> Andrew Haley wrote:
>> >Thomas Fitzsimmons writes:
> > > > Currently gcjh defaults to emitting CNI headers. I propose we change it
> > > > to emit JNI headers by default. That way gcjh will become command-line
> > > > compatible with javah. This would allow me to remove the javah wrapper
> > > > script from java-gcj-compat and instead symlink javah directly to gcjh.
> > >
> > > I should have mentioned; I'm proposing this change for mainline (4.1),
> > > not 4.0.x.
> >
> >I think this is an awful idea. CNI is our preferred route and offers
> >many advantages. To change gcjh to emitting JNI headers by default
> >would send out an inapporpriate message. If you would like gcjh to
> >look at its argv[0] and do something different when invoked as javah I
> >wouldn't object.
> >
> I agree. Despite the fact that "downgrading" CNI is not the direction we
> want to take, dramatically changing the behavior of an existing tool is
> a no-no and would contradict/break all the documentation, FAQs,
> Makefiles etc that are out there.
>
That's why I'm proposing it for 4.1. I really don't like the idea that
gcjh is command-line incompatible with javah just for the sake of
promoting CNI. That said, the mistake has already been made; if people
think it's too big a break for a point release then we'll just have to
live with the current situation for now.
> On the other hand, using JNI by default if invoked as "javac" seems like
> a great idea!
>
I'd rather create a separate tool then, maybe called "gcjhjni". I don't
like the idea that:
/usr/bin/javah -> /usr/bin/gcjh
and running "javah" gives different behaviour from running "gcjh". It's
too confusing.
We can't just call the separate tool "javah" because that will conflict
with proprietary versions of "javah". For example, we had problems when
fastjar was installed as /usr/bin/jar. So I propose calling it
"gcjhjni" and installing it in $prefix/bin alongside gcjh. Then I can
create a direct symlink from javah -> gcjhjni in java-gcj-compat.
Tom
More information about the Java
mailing list