Here’s how you can cross-compile “normal” Linux applications for Android!
Note, that I cannot give you any help in following this. It worked(tm) when I wrote this but don’t know about now.
- For the
android_configure
script download this script, place it in your~/bin
folder and (if not already) add~/bin
to yourPATH
variable. - To create a standalone toolchain use something like the following command (run from your NDK root-dir):
build/tools/make_standalone_toolchain.py --arch arm --api 21 --stl gnustl -v --install-dir /home/luca/Android/standalone-toolchain
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!