Hi Paolo,
> Does someone succesfully compiled imagej with gcj ?
> And in the case of a positive answer :) ... how you did it?
>
Warning: it's not worth it.
Warning 2: the following notes are from June 2006, with gcj6, and ij137
Here are my notes to help you get started. Good luck.
Albert
- remove any ocurrrence of the string ';;' (since gcj chokes) in source code
- fix text encoding oddities where gcj chokes (may have changed with
latest ij.jar src)
- disable JPEG support at ij/plugin/JpegWriter.java, involving
JPEGImageEncoder class, or delete the ij/plugin/JpegWriter.java file.
- disable Tools.jar calls:
delete ij/plugin/Compiler.java
remove from IJ_props.txt:
#plug-in05="Edit...",ij.plugin.Compiler("edit")
#plug-in06="Compile and Run...",ij.plugin.Compiler
- install awt library
$ sudo apt-get install libgcj6-aw
Once you have the above, then:
$ mkdir build
$ rm -v ij.jar
$ rm -vrf build/*
$ /usr/bin/gcj-wrapper-4.0 -g -d build ij/*java ij/gui/*java ij/io/*java
ij/macro/*java ij/measure/*java ij/plugin/*java ij/plugin/filter/*java
ij/plugin/frame/*java ij/process/*java ij/text/*java ij/util/*java
$ /usr/lib/jvm/java-gcj/bin/jar cvfm ij.jar MANIFEST.MF -C build/ ij
$ /usr/lib/jvm/java-gcj/bin/java -jar ij.jar
Debugging with gdb:
Create a .gdbinit in the home or in the working dir, containing (used by
the garbage
collector):
handle SIGPWR nostop noprint
handle SIGXCPU nostop noprint
Needed debugging symbols for gdb in ddd:
$ sudo apt-get install libgcj6-dbg libgcj6-dev libgcj6-src
Compiling to object code:
$ gcj -shared -findirect-dispatch -Wl,-Bsymbolic -fjni -o ij.jar.so
ij.jar
(creates ij.jar.so)
$ gcj-dbtool -a ij.db ij.jar ij.jar.so
(creates ij and ij.db)
$ ./ij -consolelog -debug -vm gij vmargs -Dgnu.gcj.precompiled.db.path=ij.db
--
Albert Cardona
http://www.mcdb.ucla.edu/Research/Hartenstein/acardona