We've launched our new site at www.openlighting.org. This wiki will remain and be updated with more technical information.
Difference between revisions of "Cross Compiling OLA"
From wiki.openlighting.org
|  (Created page with "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 De...") | 
| (No difference) | 
Latest revision as of 11:18, 13 July 2013
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
http://wiki.debian.org/BuildingCrossCompilers describes how to get a working toolchain going.
Edit /etc/apt/sources.list:
deb http://www.emdebian.org/debian/ 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 ./configure make 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 make DESTDIR=/home/simon/lighting/arm-cross/dest/ make install
OLA
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.
