Building Android sources on ubuntu 14

0

I had made a series of hacks to build Android source on ubuntu.

Hack 0
Use
sudo make (without -j since you wont be able to find the errors easily)
sudo make -B when you change the compiler (hack 2)

Hack 1
http://stackoverflow.com/questions/26670687/incorrect-java-version-when-trying-to-build-android-sources

Hack 2
sudo apt-get install g++-4.4-multilib
sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-4.4 20 –slave /usr/bin/g++ g++ /usr/bin/g++-4.4
sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20 –slave /usr/bin/g++ g++ /usr/bin/g++-4.8

Hack 3
https://mjanja.ch/2013/04/fix-for-dalvik-compile-error-on-cyanogenmod-9/

Hack 4
https://groups.google.com/forum/#!topic/android-building/gzsDhvmW994