This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
PR classpath/30706: gjavah incompatible with sun javah and gcjh
- From: Andrew Haley <aph at redhat dot com>
- To: Classpath Patches <classpath-patches at gnu dot org>, java-patches at gcc dot gnu dot org
- Date: Mon, 5 Feb 2007 18:44:25 +0000
- Subject: PR classpath/30706: gjavah incompatible with sun javah and gcjh
Like it says.
Since we started to use gjavah instead of gcjh, varous projects no
longer build because gjavah outputs the wrong filenames: it should be
org_gnu_readline_Readline.h, not org/gnu/readline/Readline.h.
Andrew.
2007-02-05 Andrew Haley <aph@redhat.com>
PR cp-tools/30706
* tools/gnu/classpath/tools/javah/JniIncludePrinter.java:
(printClass): Replace '/' in filenames with '_'.
* tools/gnu/classpath/tools/javah/JniStubPrinter.java
(printClass): Likewise.
Index: tools/gnu/classpath/tools/javah/JniStubPrinter.java
===================================================================
--- tools/gnu/classpath/tools/javah/JniStubPrinter.java (revision 121594)
+++ tools/gnu/classpath/tools/javah/JniStubPrinter.java (working copy)
@@ -76,12 +76,14 @@
if (! klass.hasNativeMethod())
return;
String xname = JniHelper.mangle(klass.name);
- JniPrintStream out = (JniPrintStream) getPrintStream(klass.name + ".c", klass);
+ JniPrintStream out
+ = (JniPrintStream) getPrintStream(klass.name.replace('/', '_') + ".c",
+ klass);
if (out == null)
return;
out.println();
out.print("#include <");
- out.print(klass.name);
+ out.print(klass.name.replace('/', '_'));
out.println(".h>");
Iterator i = klass.methods.iterator();
Index: tools/gnu/classpath/tools/javah/JniIncludePrinter.java
===================================================================
--- tools/gnu/classpath/tools/javah/JniIncludePrinter.java (revision 121594)
+++ tools/gnu/classpath/tools/javah/JniIncludePrinter.java (working copy)
@@ -112,7 +112,9 @@
if (! klass.hasNativeMethod())
return;
String xname = JniHelper.mangle(klass.name);
- JniPrintStream out = (JniPrintStream) getPrintStream(klass.name + ".h", klass);
+ JniPrintStream out
+ = (JniPrintStream) getPrintStream(klass.name.replace('/', '_') + ".h",
+ klass);
if (out == null)
return;
out.println();