| 1 | == Building GDAL using Android NDK on Linux == |
| 2 | |
| 3 | ''' Warning! this is still a work in progress! ''' |
| 4 | |
| 5 | |
| 6 | This procedure was developed on a Linux system using Android NDK r5b. |
| 7 | |
| 8 | First, a standalone toolchain is created to make the configure script easier to use. (See android-ndk-r5b/docs/STANDALONE-TOOLCHAIN.html for more details) |
| 9 | |
| 10 | {{{ |
| 11 | ~$ android-ndk-r5b/build/tools/make-standalone-toolchain.sh --platform=android-8 --install-dir=android-8-toolchain |
| 12 | }}} |
| 13 | |
| 14 | Next, the toolchain's bin directory is added to the PATH. |
| 15 | |
| 16 | {{{ |
| 17 | ~$ export PATH=$PATH:~/android-8-toolchain/bin/ |
| 18 | }}} |
| 19 | |
| 20 | From the GDAL source directory, configure for cross compiling and make. |
| 21 | |
| 22 | {{{ |
| 23 | gdal$ CC="arm-linux-androideabi-gcc" CXX="arm-linux-androideabi-g++" \ |
| 24 | CFLAGS="-mthumb" CXXFLAGS="-mthumb" LIBS="-lsupc++ -lstdc++" ./configure --host=arm-linux-eabi --without-grib |
| 25 | gdal$ make |
| 26 | }}} |
| 27 | |
| 28 | == Next steps == |
| 29 | |
| 30 | * check if resulting libs are usable. |
| 31 | * build and adapt the Java swig bindings to expose GDAL to the Java portion of an Android application. |