Ahead of Time compiled version of freenet ----------------------------------------- !This is a fast hack - used for testing if its possible or not! To compile freenet, take the following steps: * Do not forget to install gcj. This works for me: sudo apt-get install java-gcj-compat-dev ant-optional * Compile freenet-ext.jar and freenet.jar using gcj. To do this, have a look in readme-freenet.txt. In short: checkout from SVN, apply the 001-freenet-v1122-gcjcompat.patch which includes some hacks necessary to compile using GCJ and a fix for missing SVN files ("compile-examples" and "compile-unittest" does not work, and two cases from the test suite fail with CGJ): patch -p1 < 001-freenet-v1122-gcjcompat.patch cd contrib/freenet_ext/ ant cd ../../freenet mkdir lib cp ../contrib/freenet_ext/freenet-ext.jar lib/ ant (Will output a lot of warnings, but they look uncritical) * Then you may need to adapt/recreate the Makefile*.inc files. Use the "grepjar.pl" for this. To prepare, you need two source dirs: /usr/src/freenet.compiled and /usr/src/freenet.uncompiled. Then do this: cd /usr/src/freenet.compiled /tmp/grepjar.pl ../freenet.uncompiled /freenet/lib/freenet-ext.jar > ../freenet.uncompiled/Makefile-freenet-ext.inc /tmp/grepjar.pl -res ../freenet.uncompiled /freenet/lib/freenet-ext.jar >> ../freenet.uncompiled/Makefile-freenet-ext.inc /tmp/grepjar.pl ../freenet.uncompiled /freenet/lib/freenet-cvs-snapshot.jar > ../freenet.uncompiled/Makefile-freenet.inc /tmp/grepjar.pl -res ../freenet.uncompiled /freenet/lib/freenet-cvs-snapshot.jar >> ../freenet.uncompiled/Makefile-freenet.inc The search for "No resource for" or "No source for" and correct. * Copy the Makefile and the *.inc into /usr/src/freenet.uncompiled. Currently, this symlink is also necessary: cd /usr/src/freenet.uncompiled ln -s ../../../../contrib/freenet_ext/ExtVersion.java freenet/src/freenet/node/ExtVersion.java make * Wait a couple of hours or so to complete. Copy the results to your local freenet install dir. stop a running freenet and then start with: export LD_LIBRARY_PATH=lib ./freenet-i486-linux-gnu The resulting files should have these sizes (with -Os compile switch): 6768k freenet-ext-i486-linux-gnu.so 6136k freenet-i486-linux-gnu 11136k freenet-standalone-i486-linux-gnu 24392k freenet-static-i486-linux-gnu (With external *.dll *.so the file size shrink a bit:) 4316k freenet-ext-i486-linux-gnu.so 6136k freenet-i486-linux-gnu 8684k freenet-standalone-i486-linux-gnu 21940k freenet-static-i486-linux-gnu Note, that currently debian offers no gcj-4.3 while I've used this new version of the compiler. Especially, the libgcj.a static lib file is missing from any debian version of libgcj*-dev. If you have gcj-4.3, you may use my version on i386 (extract gcc-gcj-4.3-i386-static-libgcj.tgz). You may also compile gcj/libgcj for your own - but be warned: this needs time and tweaks. // Sven-Ola