wiki:BuildingForAndroid

Version 1 (modified by rolker, 13 years ago) ( diff )

--

Building GDAL using Android NDK on Linux

Warning! this is still a work in progress!

This procedure was developed on a Linux system using Android NDK r5b.

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)

~$ android-ndk-r5b/build/tools/make-standalone-toolchain.sh --platform=android-8 --install-dir=android-8-toolchain

Next, the toolchain's bin directory is added to the PATH.

~$ export PATH=$PATH:~/android-8-toolchain/bin/

From the GDAL source directory, configure for cross compiling and make.

gdal$ CC="arm-linux-androideabi-gcc" CXX="arm-linux-androideabi-g++" \
CFLAGS="-mthumb" CXXFLAGS="-mthumb" LIBS="-lsupc++ -lstdc++"  ./configure --host=arm-linux-eabi --without-grib
gdal$ make

Next steps

  • check if resulting libs are usable.
  • build and adapt the Java swig bindings to expose GDAL to the Java portion of an Android application.
Note: See TracWiki for help on using the wiki.