| | 1 | = Compiling libpurple on Android = |
| | 2 | |
| | 3 | 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. |
| | 4 | |
| | 5 | 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. |
| | 6 | |
| | 7 | I gess you will need about one hour to set up your IDE, and afterwards another hour for the automated build. |
| | 8 | |
| | 9 | == Install required developer tools == |
| | 10 | |
| | 11 | 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 |
| | 12 | |
| | 13 | === get the workspace === |
| | 14 | |
| | 15 | Check out the Android branch into a new working directory. |
| | 16 | |
| | 17 | === Eclipse === |
| | 18 | |
| | 19 | 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. |
| | 20 | |
| | 21 | Start it: |
| | 22 | The executeable is in the Eclipse directory you just downloaded. |
| | 23 | It will prompt you for a workspace. Select the android/workspace subdirectory in the Android branch. |
| | 24 | There are errors in the projects, because you first need to install the Android plugin. |
| | 25 | |
| | 26 | Install C: |
| | 27 | Go to Help → Install new Software. Select the update site for your Eclipse version. Then install "Programming languages" → "C/C++ Development tools" |
| | 28 | |
| | 29 | |
| | 30 | |
| | 31 | == Android Tools == |
| | 32 | |
| | 33 | === Download === |
| | 34 | |
| | 35 | Download Android SDK + extract |
| | 36 | (recommended: r18) |
| | 37 | http://developer.android.com/sdk/index.html |
| | 38 | |
| | 39 | Download Android NDK + extract |
| | 40 | (recommended: r8) |
| | 41 | http://developer.android.com/sdk/ndk/index.html |
| | 42 | |
| | 43 | |
| | 44 | |
| | 45 | |
| | 46 | === Install Eclipse plugin === |
| | 47 | |
| | 48 | If you encounter problems here, this page covers the issue with more details: http://developer.android.com/sdk/eclipse-adt.html#installing |
| | 49 | |
| | 50 | In Eclipse, Go to Help → Install new Software.[[BR]] |
| | 51 | Select the Android update site: https://dl-ssl.google.com/android/eclipse/ [[BR]] |
| | 52 | Select everything[[BR]] |
| | 53 | Click on "next", "next", "accept", "finish"[[BR]] |
| | 54 | Restart Eclipse when the plugin is installed. |
| | 55 | |
| | 56 | === Configure Android SDK === |
| | 57 | Click on Window → Preferences, Select Android from the left panel. Enter the directory where you downloaded the SDK. Apply. |
| | 58 | |
| | 59 | 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. |
| | 60 | |
| | 61 | |
| | 62 | === Configure Android NDK === |
| | 63 | |
| | 64 | Create a custom toolchain: Execute the following command in the ndk directory. Remember the install directory. |
| | 65 | {{{ |
| | 66 | build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=<some-new-dir> |
| | 67 | }}} |
| | 68 | |
| | 69 | Enter the install directory in eclipse in Preferences → String Substitution as ndk.root TODO: How exactly |
| | 70 | |
| | 71 | == Build it == |
| | 72 | |
| | 73 | 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. |
| | 74 | |
| | 75 | == Explore the Workspace == |
| | 76 | |
| | 77 | There are several projects: |
| | 78 | |
| | 79 | im.pidgin.libpurple.build:: |
| | 80 | Needed utilities to build libpurple and its requirements. |
| | 81 | 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. |
| | 82 | |
| | 83 | |
| | 84 | == Problems == |
| | 85 | glib-compile-resources not found |
| | 86 | Update glib on your host. |
| | 87 | |
| | 88 | Problems with undefined pthread types, e.g. pthread_rwlock_t |
| | 89 | Use the android-9 toolchain or newer. |
| | 90 | |