[racket] compiling Racket to android and ios apps

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Feb 25 20:36:25 EST 2015

At Tue, 24 Feb 2015 23:01:59 +0100, Jens Axel Søgaard wrote:
> While reading "Embedding into a Program"
> 
>     http://docs.racket-lang.org/inside/embedding.html
> 
> I see that the standard way of embedding Racket is via a dynamic library.
> 
> Reading up on iOS and dynamic libraries I notice that dynamic libraries
> were not supported before iOS8 (on actual devices - I believe they work
> in the simulator). Is it possible to embed Racket as a static library?

Yes: use "libracket3m.a", which is created along the way to generating
the dynamic library.

If you configure with `--enable-libs`, then `make install` even copies
"libracket3m.a" to the installation's "lib" directory. You can also
just use the static library directly from its build location, or you
can copy it anywhere else.

For example, in <build>/racket after `make` in a default configuration,

  gcc -o x gc2/main.o libracket3m.a -framework CoreFoundation -liconv

creates an executable `x` that's like `racket3m`, but with the Racket
VM statically linked.



Posted on the users mailing list.