Personal tools
The Open Lighting Project has moved!

We've launched our new site at This wiki will remain and be updated with more technical information.

Cross Compiling OLA


Jump to: navigation, search

These are Simon's raw notes, it's similar to OLA_on_Android. It's not working correctly right now, I'm not sure what's wrong.

This assumes you're building for ARM on a Debian Wheezy machine. We do all the work in ~/arm-cross.

Setup describes how to get a working toolchain going.

Edit /etc/apt/sources.list:

deb wheezy main

Then install

$ apt-get install g++-4.7-arm-linux-gnueabi

This installs arm-linux-gnueabi-g++-4.7, but to make things easier we need to setup symlinks so that arm-linux-gnueabi-g++ works:

$ sudo update-alternatives --install /usr/bin/arm-linux-gnueabi-gcc arm-linux-gnueabi-gcc /usr/bin/arm-linux-gnueabi-gcc-4.7 46 --slave /usr/bin/arm-linux-gnueabi-g++ arm-linux-gnueabi-g++ /usr/bin/arm-linux-gnueabi-g++-4.7 --slave /usr/bin/arm-linux-gnueabi-gcov arm-linux-gnueabi-gcov /usr/bin/arm-linux-gnueabi-gcov-4.7 

Setup a Target Root

mkdir -p ~/arm-cross/dest 
cd arm-cross

Build protobuf

Wheezy comes with 2.4.1 which is a pain since you need to generate the protobuf headers with the same version as you compile against. Either use the 2.4.1 version or build 2.5.0 locally (but don't install).

tar -zxf protobuf-2.5.0.tar.gz
mv protobuf-2.5.0 protobuf-2.5.0-native
cd protobuf-2.5.0-native
pwd  # make a note of this, you need it for the --with-protoc option below

Now build the ARM one:

tar -zxf protobuf-2.5.0.tar.gz
cd protobuf-2.5.0
./configure   --host=arm-linux-gnueabi --with-protoc=/tmp/protobuf-2.5.0-native/src/protoc
DESTDIR=~/arm-cross/dest/ make install

E2FS Progs

tar -zxf e2fsprogs-1.42.8.tar.gz 
cd e2fsprogs-1.42.8/
./configure   --host=arm-linux-gnueabi --prefix=/usr/local
cd lib/uuid
DESTDIR=/home/simon/lighting/arm-cross/dest/ make install


You need version 0.8.31 or the version from git.

cd ola
autoreconf -i
export ac_cv_func_malloc_0_nonnull=yes
export PKG_CONFIG_PATH=~/arm-cross/dest/usr/local/lib/pkgconfig/
export PKG_CONFIG_SYSROOT_DIR=~/arm-cross/dest/
./configure   --host=arm-linux-gnueabi  --disable-http --disable-unittests  --disable-libftdi  --disable-spi --disable-osc --with-protoc=/tmp/protobuf-2.5.0/src/protoc

The last step fails.