Compile linphone for Android

Compiling linphone has always been a challenge for me. Even after following the README down to each letter, I always get errors. Compiling linphone for Android is no difference.

So I followed the README, got everything installed, and did make.

And I ended up with numerous such errors:

Fatal error: invalid -march= option: `armv5te'

After a while, I figured out that it was caused by failure in cross compilation. So linphone uses a lot of libraries written for intel (desktop) processors. Those libraries need to be cross compiled for ARM. I failed at this stage.

So to summarize, the following are the steps needed to compile linphone for Android. These steps are taken from the README, with my comments inside the parentheses.
(My OS is Ubuntu 12).

0) download the Android sdk with platform-tools and tools updated to latest revision (at least API 16 is needed), then add both 'tools' and 'platform-tools' folders in your path.
1) download the Android ndk (>=r8b) from google and add it to your path.
2) install the autotools: autoconf, automake, aclocal, libtoolize pkgconfig (On my Ubuntu, aclocal is part of automake. pkgconfig is in a package called pkg-config and already installed. libtoolize is in a package called libtool. So actually I had to: sudo apt-get install automake autoconf libtool)
3) install the code sourcery toolchain. This step is crucial as the toolchain is needed for succesful cross compilation. This step is not mentioned in the README!!!!

So to install the sourcery toolchain, do these steps:
1. Get the binary from sourcery.mentor.com. Get the binary for Linux, not the source, to save you from compilation headache. The filename is: arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2. You have to register, agree to some formalities, and then download it.
2. Unzip it. Preferable to a subdir inside the /opt dir to make it look pro.
3. Add path to the bin directory inside the unzipped directory to your path.

And then, done. Follow the readme to make and make install and you'll compile with success.

0 komentar:

Posting Komentar