Android: Configuring the Host PC

From OMAPpedia

Revision as of 21:32, 11 August 2010 by Jeff Carr (Talk | contribs)
Jump to: navigation, search
Android Logov2.jpg
How to get started building your own binaries for the Android OS on your OMAP Platform
Overview Step 1 Step 2 Step 3 Step 4 Step 5 Step 6 Step 7 Step 8 Step 9


Step 1

Building Android binaries consists of 4 steps:

  1. Host PC setup
  2. Building bootloader
  3. Building kernel
  4. Building filesystem

This page details step 1 on how to setup a Host PC to build Android binaries.


Linux Distribution

Ubuntu is the recommended Linux distribution for this setup. Other distributions are available, however the configurations listed in this wiki currently only covers Ubuntu.

Ubuntu is available for download at:

Note: Around 10GB of hard disk space is required to build one release of Android.

Working behind a firewall

Refer to OMAP Platform Support Tools for more information on setting up Ubuntu's Firewall.

ARM Cross Compiler

CodeSourcery ARM Compiler should be used for building different kernel distribution and software releases on OMAP platforms. Visit for more info.

Note 1: For L25x kernel builds, Codesourcery tool chain 2008-q3 release should be used. Quick Link - CodeSourcery G++ Lite 2008q3-72 for ARM GNU/Linux

Note 2: For L24x, L27x kernel builds, Codesourcery tool chain 2009-q1 release should be used. Quick Link - CodeSourcery G++ Lite 2009q1-203 for ARM GNU/Linux


export PATH=/<toolchain_folder>/bin:$PATH
export CROSS_COMPILE=arm-none-linux-gnueabi-

Additional packages required for building

sudo apt-get install git-core flex bison gperf libesd0-dev zip
sudo apt-get install libwxgtk2.6-dev zlib1g-dev build-essential libstdc++5 
sudo apt-get install tofrodos x-dev libx11-dev libncurses5-dev 
sudo apt-get install sun-java5-jdk

To uninstall “sun-java6-jdk” please type:

sudo apt-get remove sun-java6-jdk
sudo apt-get install lib32readline5-dev 
sudo apt-get install libstdc++6

#add the old Jaunty repos to /etc/apt/sources.list 
deb jaunty multiverse
deb jaunty-updates multiverse

#then run below commands
sudo apt-get update
sudo apt-get install sun-java5-jdk

For Ubuntu® users, who previously had java6 installed might run into the following error:

You are attempting to build with the incorrect version of java.

Your version is: java version "1.6.0_10".
The correct version is: 1.5.
Please follow the machine setup instructions at

Try to change the default java version with the following command:

sudo update-alternatives –-config java

This will show you the options you have for selecting which java version you want by default. You will have to do this for all java binaries that come with the java jdk (javac, javadoc, javah, etc).

This can be downloaded from Follow the instructions and install to the standard location. like:

tar xzvf libiconv-1.13.1.tar.gz 
cd libiconv-1.13.1/
sudo make install

After installing GNU libiconv for the first time, it is recommended to recompile and reinstall GNU gettext, so that it can take advantage of libiconv. On systems other than GNU/Linux, the iconv program will be internationalized only if GNU gettext has been built and installed before GNU libiconv. This means that the first time GNU libiconv is installed, we have a circular dependency between the GNU libiconv and GNU gettext packages, which can be resolved by building and installing either

first libiconv, then gettext, then libiconv again

for further information refer to the link

64-bit Host

On a 64-bit host, you need to force creation of 32-bit code and use the 32-bit version of libiconv. You can do the native 64-bit build and install as described above first. Then to build a 32-bit version:

./configure CFLAGS=-m32
sudo make install-lib libdir=/usr/local/lib32

Note: You may also need to install ia32-libs.

Ubuntu 10 (32 bit)

From a stock default install:

apt-get install git-core 

Left arrow1.png Android Logov2.jpg Right arrow1.png
Previous Home Next
Personal tools