[java-gnome-hackers] --with-gcj-compile
Brought to you by:
afcowie
From: VEROK I. <vi...@in...> - 2002-12-04 17:55:34
|
Hi! I'm new to Java-GNOME, but I've been reading the mailing list web archives for the last four months or so. I run Debian unstable, with Sun's 1.4.1_01 JDK, and ran into a few snags when finally getting around to trying to get Java-GNOME to work. I'd like to have your opinion on these. First, I checked out the CVS repository, did ./configure --with-libdir=/home/vi/incoming/java-gnome/lib --with-gcj-compile because I want to eventually be able to compile stuff to native binaries (not just class files). Next came a make all which failed with about 370 error messages about missing classes. I found that these could be made to go away by amending java-gnome/src/Makefile's native-gnome and native-glade targets in the following way: native-gnome: native-gtk $(GNOME_O) $(GCJ) -g -shared $(GNOME_O) -Ibuild-java/gtk -Ibuild-java/gnome -o ../lib/libGNOMEJar.so.${version} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ native-glade: $(GLADE_O) $(GCJ) -g -shared $(GLADE_O) -Ibuild-java/gtk --extdirs=/opt/jdk/jre/lib -o ../lib/libGladeJar.so.${version} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The --extdirs is needed because I killed two birds with one stone: I have JDK 1.4.1 in /opt/jdk, and (on one hand) the Glade bindings want JAXP (understandable), and (on the other hand) the SignalHandler class wants to be a subclass of InvocationHandler, which is a Java 1.3 dependency (only satisfiable by /opt/jdk/jre/lib/rt.jar) introduced quite recently by Tom Ball. No flames, just an honest question: was this really necessary? I mean, from the free software angle. Anyway, back to my build process: I also added an empty native-glade target to test/Makefile to quench another complaint about a missing target. Having built the thing at last, make install didn't seem to want to work at all. Even the top Makefile's install target is horribly broken (the Makefile.in's "install: @INSTALL_TARGETS@_install" line will never result in the correct value of "install: gtk_install gnome_install native_install"). Also, specifying "--with-libdir" above does not influence the generated Makefile at all, so even if this target worked as advertised, everything would still be installed under /usr/local, not where I wanted. So I gave up on "make install", and copied the generated lib directory by hand. Then I discovered that I needed to edit build.xml's build-glade target to say <include name="org/gnu/glade/**"/> ^^^ because the resulting glade.jar contained practically nothing otherwise (I'm using Ant 1.5). A recompile followed. I have yet to get native compilation working. I can get class files using Java-GNOME, but my efforts to compile, say, src/examples/glade/Examples1.java into a native binary have so far all failed with hundreds of linking errors like ../lib/libGTKJar.so: undefined reference to `org::gnu::gtk::SpinButton::gtk_spin_button_get_adjustment(int)' My command line for this compilation was scrounged from src/Makefile and said: gcj -fPIC -fjni -g -O --classpath=/usr/share/java/libgcj.jar:${JG}/gtk.jar:${JG}/gnome.jar:${JG}/glade.jar:. Example1.java -o Example1 -L../lib -lGTKJar -lGNOMEJar -lGladeJar -lGTKJava -lGNOMEJava -lGladeJava I get the exact same error messages if the last three -l*Java library references are omitted. Any ideas? Cheers, Istvan P.S.: Please CC me, I'm not subscribed to the list. |