I'm checking this in to classpath, gcc trunk, and the RH 4.1 branch.
Stepan Kasal noticed that 'gcjh -jni' fails incorrectly.
Whoops.
Tom
Index: ChangeLog
from Stepan Kasal <[EMAIL PROTECTED]>
* tools/gnu/classpath/tools/javah/Main.java (cniOrJniSeen): New
field.
(getParser): Use new field.
Index: tools/gnu/classpath/tools/javah/Main.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/tools/gnu/classpath/tools/javah/Main.java,v
retrieving revision 1.8
diff -u -r1.8 Main.java
--- tools/gnu/classpath/tools/javah/Main.java 17 Mar 2007 05:01:57 -0000 1.8
+++ tools/gnu/classpath/tools/javah/Main.java 26 Mar 2007 17:31:03 -0000
@@ -89,6 +89,9 @@
// True if we're emitting CNI code.
boolean cni;
+ // True if we've seen -cni or -jni.
+ boolean cniOrJniSeen;
+
// True if output files should always be written.
boolean force;
@@ -243,8 +246,9 @@
{
public void parsed(String arg0) throws OptionException
{
- if (cni)
+ if (cniOrJniSeen && cni)
throw new OptionException("only one of -jni or -cni may be used");
+ cniOrJniSeen = true;
cni = false;
}
});
@@ -252,6 +256,9 @@
{
public void parsed(String arg0) throws OptionException
{
+ if (cniOrJniSeen && ! cni)
+ throw new OptionException("only one of -jni or -cni may be used");
+ cniOrJniSeen = true;
cni = true;
}
});