Here’s how you can cross-compile “normal” Linux applications for Android!

This post will be updated sometimes!

  • For the android_configure script download this script, place it in your ~/bin folder and (if not already) add ~/bin to your PATH variable.
  • To create a standalone toolchain use something like the following command (run from your NDK root-dir):

Ncurses

Add ac_cv_header_locale_h=no to your android_configure script to the line export CC (example: export CC=${CROSS_PATH}/${CROSS_COMPILE}-gcc ac_cv_header_locale_h=no)

android_configure --enable-widec
make
make install

Htop

android_configure
make
make install

GnuTLS

android_configure --without-p11-kit
make
make install

Wget

android_configure
patch src/gnutls.c < ../TOOLS/gnutls.c.patch
make
make install

Curl

android_configure
make
make install

Libiconv

android_configure --host=arm-linux
make
make install

Git

Comment out the parts in configure.ac with ac_cv_fread_reads_directories and ac_cv_snprintf_returns_bogus. Currently on Line 854.

make configure
android_configure
make NO_NSEC=1

Binutils

android_configure
make
make install

Python (not complete)

android_configure --host=arm-linux --build=arm
not complete!

GCC

GMP

android_configure --host=arm-linux
make
make install

MPFR

android_configure --host=arm-linux
make
make install

MPC

android_configure --host=arm-linux
make
make install

GCC

Add -I<YOUR_NDK_ROOT>/sources/android/support/include to your CFLAGS (android_configure script)

android_configure
make
make install

Thanks for reading!