1= Android porting notes =
2
3How to setup a Ubuntu 12.04 machine to cross compile for different architectures.
4
5== Setup ==
6
7Install tools:
8
9sudo 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
10
11== Environment ==
12Ubuntu has a command called ''dpkg-architecture'' which setups up most of the cross compile environment.
13
1464-bit x86:
15 export $(dpkg-architecture -aamd64)
16
1732-bit x86:
18 export $(dpkg-architecture -ai386)
19
20armhf (RaspberryPi/uPC):
21 export $(dpkg-architecture -aarmhf)
22 export CROSS_COMPILE=arm-linux-gnueabihf-
23 export CCPREFIX=${CROSS_COMPILE}
24
25armel:
26 export $(dpkg-architecture -aarmel)
27 export CROSS_COMPILE=arm-linux-gnueabi-
28 export CCPREFIX=${CROSS_COMPILE}
29
30Shared Variables:
31 export CONCURRENCY_LEVEL=`grep -c '^processor' /proc/cpuinfo`
32 export ROOT_CMD=fakeroot
33
34== Build ==
35#Make
36 export CC=${CROSS_COMPILE}gcc
37 STATIC=1 make ARCH=arm
38
39= Ubuntu 17.04 =
40Considerably easier with a cross-compilation enable distribution, swap architecture as needed.
41
42=== Setup ===
43  apt-get install gcc-4.9-aarch64-linux-gnu
44
45=== Build ===
46
47  CC=aarch64-linux-gnu-gcc-4.9 STATIC=1 make
48
49M.Srikanth Kumar, Jul 14, 2015
50Colin Ian King,   Dec  6, 2016 (updated, static linking)
51