= Android porting notes =

How to setup a Ubuntu 12.04 machine to cross compile for different architectures.

== Setup ==

Install tools:

sudo apt-get install kernel-package build-essential git gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf gcc-4.6-multilib-arm-linux-gnueabihf gcc-4.6-multilib-arm-linux-gnueabi

== Environment ==
Ubuntu has a command called ''dpkg-architecture'' which setups up most of the cross compile environment.

64-bit x86:
 export $(dpkg-architecture -aamd64)

32-bit x86:
 export $(dpkg-architecture -ai386)

armhf (RaspberryPi/uPC):
 export $(dpkg-architecture -aarmhf)
 export CROSS_COMPILE=arm-linux-gnueabihf-
 export CCPREFIX=${CROSS_COMPILE}

armel:
 export $(dpkg-architecture -aarmel)
 export CROSS_COMPILE=arm-linux-gnueabi-
 export CCPREFIX=${CROSS_COMPILE}

Shared Variables:
 export CONCURRENCY_LEVEL=`grep -c '^processor' /proc/cpuinfo`
 export ROOT_CMD=fakeroot

== Build ==
#Make
 export CC=${CROSS_COMPILE}
 STATIC=1 make ARCH=arm

= Ubuntu 17.04 =
Considerably easier with a cross-compilation enable distribution, swap architecture as needed.

=== Setup ===
  apt-get install gcc-4.9-aarch64-linux-gnu

=== Build ===

  CC=aarch64-linux-gnu-gcc-4.9 STATIC=1 make

M.Srikanth Kumar, Jul 14, 2015
Colin Ian King,   Dec  6, 2016 (updated, static linking)
