Cross-compiling libavg 1.7 for ARM on Debian

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:

  1. Install Emdebian ARM Cross Toolchain and Tools in Debian.
  2. Download libavg 1.7 source code
  3. Extract it
  4. 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

  5. Remove the SSE2 flags in configure script:
  6. 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.
  7. Export some environment variables (or create source.env file instead):
  8. 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.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

Radxa Orion O6 Armv9 mini-ITX motherboard
Subscribe
Notify of
guest


The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
25 Comments
oldest
newest
Boardcon CM3588 Rockchip RK3588 System-on-Module designed for AI and IoT applications