libavg is a high-level development platform for media-centric applications using Python as scripting language and written in C++ and I’ve already written a post to cross-compile libavg 1.6 in Ubuntu (with linaro cross toolchain) and using Beagleboard qemu image.
Since I’ve doing some preparation work to have software running on the Raspberry Pi and that the latter won’t support Ubuntu, I’ve had to cross-compile it again. This time, I’ve found a cleaner way to do the cross-compilation with dpkg-cross and xapt tools which can load the required armel package to the arm toolchain. Those tools really make life easy, as previously (a few years ago), I would have had to cross-compile all dependencies manually.
Here are the steps I followed:
- Install Emdebian ARM Cross Toolchain and Tools in Debian.
- Download libavg 1.7 source code
- Extract it
- Install the following armel development packages:
sudo /usr/share/pdebuild-cross/xapt -a armel libpango1.0-dev libavformat-dev libavcodec-dev libswscale-dev python2.6-dev libboost-python-dev libboost-thread-dev libglu-dev libgl1-mesa-dev libgtk2.0-dev libglib2.0-dev libsdl-dev libxml2-dev libxxf86vm-dev libcairo-dev librsvg2-dev --force-yes
- Remove the SSE2 flags in configure script:
- There is some x86 assembler in the code, we need to disable it.
Edit src/base/Exception.cpp and replace debugBreak code by :
Please note that I’m not fully sure of the ARM assembly I’ve used to replace the INT x86 instruction. If I’m wrong let me know. Anyway this code should not be called if the environment variable AVG_BREAK_ON_ASSERT is not set to 1. - Export some environment variables (or create source.env file instead):
- Configure, build and install libavg:
CFLAGS="-I/usr/arm-linux-gnueabi/include/gtk-2.0 -I/usr/arm-linux-gnueabi/include/glib-2.0" CXXFLAGS="-I/usr/arm-linux-gnueabi/include/gtk-2.0 -I/usr/arm-linux-gnueabi/include/glib-2.0/ -I/usr/arm-linux-gnueabi/lib/glib-2.0/include/ -I/usr/arm-linux-gnueabi/include/pango-1.0 -I/usr/arm-linux-gnueabi/include/cairo/ -I/usr/arm-linux-gnueabi/include/librsvg-2" LDFLAGS="-lgdk_pixbuf-2.0 -lavcodec -lavutil -lavformat -lswscale -lSDL -lpango-1.0 -lpangoft2-1.0 -lrsvg-2" ./configure --target=arm-linux-gnueabi --host=arm-linux-gnueabi --with-sdl-prefix=/usr/arm-linux-gnueabi --prefix=/home/jaufranc/edev/raspberry-pi/libs
make
make install
This was tested in Deiban Squeeze (6.0.3) in VirtualBox.

Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress