# Compile static executable using a specific GCJ if [ "$#" != "2" ]; then echo This script needs two parameters echo 1. directory within /var/local/gcc holding the gcc to be used echo 2. name of source file, without \".java\" echo echo Available compiler directories are: pushd /var/local/gcc >/dev/null ls popd exit 0 fi # My target has a 2.4.20 kernel, so... LD_ASSUME_KERNEL=2.4.20 rm -f libgcjx.o gcc -nostdlib -nostartfiles -r -o libgcjx.o -Wl,-d -Wl,--whole-archive /var/local/gcc/$1/lib/lib-gnu-awt-xlib.a echo COMPILING NOW echo compiling /var/local/gcc/$1/bin/gcj -v -g -O2 -c -o $2.o $2.java if [ "$?" = "0" ]; then echo echo Compiling Success!! echo else exit 1 fi echo LINKING NOW... /var/local/gcc/$1/bin/gcj -g --verbose --main=$2 -o $2.bin -static -static-libgcc -save-temps $2.o libgcjx.o -lstdc++ -L. -lX11 if [ "$?" = "0" ]; then echo echo Linking Success!! echo else exit 1 fi ./$2.bin if [ "$?" = "0" ]; then echo echo Run Success!! echo else exit 1 fi