Android: Build Environment
Android > Build Environment
This article will guide you through setting up a Debian 7 64 bit box for building the Android 2.3 thorugh 4.4 OS sources. This was done on a basic headless fresh Debian install, your mileage may very with your particular setup.
Prerequisites
- Official Android how to set up a Build Environment
- 64 Bit Debian 7 (in a Virtual Machine works fine)
- This was written for a fresh basic install, you may find some of this unnecessary, or incomplete with your system.
- How to download Android sources
Dependencies
Debian Packages
First step is to add multi-arch support, for the required i386 packages.
# sudo dpkg --add-architecture i386 # sudo apt-get update
Now to install the necessary packages (Due to system install variations, this may not be an exhaustive list).
# sudo apt-get install git gnupg flex bison gperf build-essential \ zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \ libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \ libgl1-mesa-dev g++-multilib mingw32 tofrodos \ python-markdown libxml2-utils xsltproc zlib1g-dev:i386 gcc-4.4-multilib \ g++-4.4-multilib
Java
For the FriendlyARM versions of Android, Java JDK 6 is required for the build. Go to Java Downloads and download make-jpkg jdk-6u45-linux-x64.bin you will need to log in, (bugmenot.com works well in these situations.) After downloading, you need to create a Debian package to install.
# fakeroot make-jpkg jdk-6u45-linux-x64.bin # sudo dpkg -i oracle-j2sdk1.6\_1.6.0+update45\_amd64.deb
System Configuration
Java alternative set up
# sudo ln -s /usr/lib/jvm/j2sdk1.6-oracle/ /usr/lib/jvm/java-6-sun # sudo update-java-alternatives -s java-6-oracle
libGL.so symlink
Check first if this is necessary, one box this was done on it was, the other it was not.
# sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
GCC alternative set up
# sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.4
Now you'll need to extract your sources if you got a tarball, and or cd into the repo if you downloaded that way. You are now ready for compiling.