Set up a cross-build machine for the Raspberry Pi


This document focuses on Debian hosts. Debian derivatives such as Ubuntu should work with minor changes. Install the following packages:


Choose a directory for the raspi tools, firmware and filesystem, then make RASPI_SDK_ROOT point to it. For instance:

export RASPI_SDK_ROOT=/home/sam/raspi

Then add the following directory to PATH:


Install Raspi tools

Get the Raspberry firmware and tools:

git clone
git clone

Install Raspbian

As root, install a minimal Raspbian filesystem:

sudo cdebootstrap --foreign --allow-unauthenticated --flavour=minimal \
                  --arch=armhf stable chroot
sudo cp /usr/bin/qemu-arm-static ./chroot/usr/bin
sudo chroot ./chroot /sbin/cdebootstrap-foreign
sudo chroot ./chroot dpkg-divert --add --rename /usr/lib/arm-linux-gnueabihf/
sudo chroot ./chroot dpkg-divert --add --rename /usr/lib/arm-linux-gnueabihf/

Now to install packages inside the chroot:

alias raspi-get="sudo chroot $RASPI_SDK_ROOT/chroot apt-get"

raspi-get update
raspi-get upgrade
raspi-get install zsh

Build Lol Engine

Make sure the required packages are installed:

raspi-get install libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev

Then just run the following:


Build autoconf projects

For simple autoconf projects (using ./configure ; make) the following command can now be used:


./configure --host=arm-bcm2708hardfp-linux-gnueabi \
    CPPFLAGS="-I$RASPI_INCLUDES -I$RASPI_INCLUDES/interface/vcos/pthreads" \


If you need to use Raspbian packages, add the following to CPPFLAGS in the configure line:


And the following to LDFLAGS:

-Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/lib/arm-linux-gnueabihf
-Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/usr/lib/arm-linux-gnueabihf

Bitten configuration

For Lol Engine autobuilders, add the following section to the bitten machine file:

version = 0
Last modified 5 years ago Last modified on Apr 23, 2014, 5:25:51 PM