Kawa, the Java-based Scheme system
6.5 Compiling Scheme to a native executable
You can compile your Scheme program to native code using GCJ,
as long as you have built Kawa using GCJ.
First, you need to compile the Scheme code to a set of
see 6.2 Compiling Scheme to a set of .class files.
kawa --main -C myprog.scm
Then to create an executable
gckawa --main=myprog myprog*.class -o myprog
gckawa is a simple shell script that calls
The reason for the wildcard in
myprog*.class is that sometimes
Kawa will generate some helper classes in addition to
--main option tell
gcj which class contains
main method it should use. The
-o option names
the resulting executable program. The
-lkawa option tells
the linker it should link with the kawa shared library, and
-L$PREFIX/bin option tells the linker where it can
find that library.