www.delorie.com/gnu/docs/kawa/kawa_24.html   search  
 
Buy GNU books!


Kawa, the Java-based Scheme system

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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 .class files; see 6.2 Compiling Scheme to a set of .class files.
 
kawa --main -C myprog.scm

Then to create an executable myprog do:
 
gckawa --main=myprog myprog*.class -o myprog

The gckawa is a simple shell script that calls gcj. The reason for the wildcard in myprog*.class is that sometimes Kawa will generate some helper classes in addition to myprog.class. The --main option tell gcj which class contains the 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 the -L$PREFIX/bin option tells the linker where it can find that library.


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003