Cross Compiling CWiid

This section describes how to compile CWiid for another processor architecture, for example arm. The procedure was used and tested with the cross compile toolchain of the Familiar linux distribution and CWiid versions 0.5.03, 0.6.00 and svn trunk r124.

Setting up the cross compiler

Follow the instructions from  http://familiar.handhelds.org/build-setup.html and build the package gcc-cross:

git clone http://familiar.handhelds.org/git/familiar-build.git
cd /path/to/familiar-build
sh setup/build-env-nozenity.sh
cd /path/to/newly/created/build/directory
source conf/env.sh
bitbake meta-sdk

You should end up with a working cross compiler for your target system in /path/to/newly/created/build/directory/tmp/cross that you can copy anywhere you like to. Be shure you add the bin directory of the cross compiler to your PATH environment variable.

Preparing CWiid Source for cross compiling

Download an unpack the CWiid sources. If your target system does not provide GTK libraries, you have to delete the GTK-related lines and the line containing wmgui/Makefile in configure.ac and delete the term wmgui in Makefile.in. After that only the command line based executables and libwiimote (libcwiid for svn version) will be compiled.

Building CWiid

Simply run

autoconf
../configure --build=i686-pc-linux-gnu --host=your-host
make

For my device I had to specify --host=arm-linux. If your target device does not have python installed, you also have to add --without-python.

Installing on the host machine

Until now I copy the compiled files to their destination by hand. Of course it is possible to build packages for the desired distribution, but I have not much experience in packaging and use only one target machine, so the effort of building packages or install scripts would not be high.

rio b and you