Patch: FYI: Import AWT peers

Mark Wielaard mark@klomp.org
Fri Jan 31 21:05:00 GMT 2003


Hi,

On Fri, 2003-01-31 at 18:40, Tom Tromey wrote:
> I'm checking this in on the trunk only.
> 
> This patch pulls in the Gtk AWT peers and adds the configure and build
> support for them.

Cool! I have it working now but I had two problems.
I need the following patch to gjavah.c otherwise I would get segfaults
while generating the new jni .h files.

--- gjavah.c    12 Jan 2003 02:14:55 -0000      1.103
+++ gjavah.c    31 Jan 2003 21:00:06 -0000
@@ -1119,7 +1119,7 @@
  
   for (length = 0; clname[length] != ';' && clname[length] != '\0'; ++length)
     ;
-  current = ALLOC (length);
+  current = ALLOC (length+1);
   for (i = 0; i < length; ++i)
     current[i] = clname[i] == '/' ? '.' : clname[i];
   current[length] = '\0';


And the sed rule doesn't work correctly on my machine since it generates
rules like (not the / at the front of the class name):
../../gcc/gcjh -jni -d jniinclude -classpath '' -bootclasspath . /gnu.java.awt.peer.gtk.GtkFileDialogPeer

Something like the following helps for me (actually I just edited the generated Makefile):

--- Makefile.am 31 Jan 2003 17:54:09 -0000      1.271
+++ Makefile.am 31 Jan 2003 21:03:46 -0000
@@ -231,7 +231,7 @@
  
 $(gtk_c_headers): $(gtk_awt_peer_sources)
 ## FIXME: GNU make.
-       @input=`echo $@ | sed -e 's,jniinclude,,' -e 's,_,.,g' -e 's,.h$$,,'`; \
+       @input=`echo $@ | sed -e 's,jniinclude/,,' -e 's,_,.,g' -e 's,.h$$,,'`; \
        echo "$(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input"; \
        $(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input

I assume you are not seeing these issues. Has anybody else tried?

Cheers,

Mark



More information about the Java-patches mailing list