Version 1 (modified by 12 years ago) (diff) | ,
---|
Compiling libpurple on Android
There are build scripts in Monotone that build the libraries on which libpurple depends automatically. But you need to set up your host Programms, mainly Eclipse and the Android SDK/NDK.
Follow these steps to set up a new Development platform. I recommend that even if you already have Eclipse or the SDK/NDK installed, you should download everything and start from scratch.
I gess you will need about one hour to set up your IDE, and afterwards another hour for the automated build.
Install required developer tools
Make sure you have the following things installed (the list may or may not be complete ;-)): a current JDK, patch, autoconf, pkg-config, gtk-doc-tools, GNU make and xzip
get the workspace
Check out the Android branch into a new working directory.
Eclipse
You need Eclipse IDE with C and Java Support. For this, I recommend you download Eclipse Classic or Eclipse IDE for Java developers. Files can be found at http://www.eclipse.org/downloads/. Eclipse does not need an installation, just extract the archive somewhere.
Start it: The executeable is in the Eclipse directory you just downloaded. It will prompt you for a workspace. Select the android/workspace subdirectory in the Android branch. There are errors in the projects, because you first need to install the Android plugin.
Install C: Go to Help → Install new Software. Select the update site for your Eclipse version. Then install "Programming languages" → "C/C++ Development tools"
Android Tools
Download
Download Android SDK + extract (recommended: r18) http://developer.android.com/sdk/index.html
Download Android NDK + extract (recommended: r8) http://developer.android.com/sdk/ndk/index.html
Install Eclipse plugin
If you encounter problems here, this page covers the issue with more details: http://developer.android.com/sdk/eclipse-adt.html#installing
In Eclipse, Go to Help → Install new Software.
Select the Android update site: https://dl-ssl.google.com/android/eclipse/
Select everything
Click on "next", "next", "accept", "finish"
Restart Eclipse when the plugin is installed.
Configure Android SDK
Click on Window → Preferences, Select Android from the left panel. Enter the directory where you downloaded the SDK. Apply.
Open the SDK Manager (if Eclipse has not prompted you to do it: Window → Android SDK Manager). Select "Tools" and "Android 2.3.3 (API 10)" and install. Android should have created an AVD for you.
Configure Android NDK
Create a custom toolchain: Execute the following command in the ndk directory. Remember the install directory.
build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=<some-new-dir>
Enter the install directory in eclipse in Preferences → String Substitution as ndk.root TODO: How exactly
Build it
Go to Project → Clean Projects... and clean all projects. Then let Eclipse rebuild if it did not do it automatically. This may take some time.
Explore the Workspace
There are several projects:
- im.pidgin.libpurple.build
- Needed utilities to build libpurple and its requirements. The direcotry buildscripts contains all the files that build the required projects. They are included in the eclipse build process. If you want to rebuild a library, just touch the buildfile for that library. If you touch common.ant, all libraries will be rebuild.
Problems
glib-compile-resources not found
Update glib on your host.
Problems with undefined pthread types, e.g. pthread_rwlock_t
Use the android-9 toolchain or newer.