Building a Guile extension on an embedded device

Thanks to OpenEmbedded building extensions for Guile that run on embedded devices such as the BeagleBoard is fairly painless. As I have previously mentioned, Guile is already supported by OpenEmbedded. If you have an extension which is made up of some C code and some Scheme code you first should automate building it with autoconf. This might install a shared library and install some Scheme files into Guile specific locations. The next step is to write a bitbake recipe which will work with this autoconf based project. Typically this recipe will download a tarball or checkout some code from version control and then begin its magic. The end product hopefully is a binary package which can be easily installed onto the device. As an example I built packedobjects as a Guile extension for my BeagleBoard. The bitbake recipe is availabe here:

http://packedobjects.cvs.sourceforge.net/viewvc/packedobjects/packedobjects_project/openembedded/

This works by getting the latest code from CVS. It builds the code and is told which files need to be part of the package. So if you have OpenEmbedded setup you just need to issue the command:

bitbake packedobjects

This will build and package the lastest code as an ipk.

We should test the built ipk on the device to see if it works:

root@beagleboard:~# opkg install http://zedstar.org/ipk/libpackedobjects0_0.1-r0.1_armv7a.ipk
Downloading http://zedstar.org/ipk/libpackedobjects0_0.1-r0.1_armv7a.ipk
Installing libpackedobjects0 (0.1-r0.1) to root...
Configuring libpackedobjects0
root@beagleboard:~# guile
guile> (use-modules (packedobjects))
guile> (exit)

Leave a Reply