How to set up the build environment

Put links to existing resources here, no need to reinvent the wheel.

Setup tested on Ubuntu 10.04

1. Adding Java 1.5 JDK Repository (only 1.6 is included in Ubuntu 10.04)

Put the following lines in your /etc/apt/sources.list

deb jaunty multiverse
deb jaunty-updates multiverse

Then do sudo apt-get update.

2. Needed Applications

In order to build android we need some Apps, so type for:

  • ubuntu 32bit:
    sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev \
    libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
  • ubuntu 64bit:
    sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf build-essential zip curl \
    zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs \
    x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev

You may have to set default 'java' command to point to Sun Java 1.5. Run (as root)

update-alternatives --config java

and select the one you need

How to fetch the source

Directory Setup

We need a directory in which we can work, you can use whatever you want ( In this guide I used /usr/src/android ).

$ sudo mkdir /usr/src/android
$ sudo chown  /usr/src/android

Tools for Source Download

Now you have to create the source download tool, this one is normally in a /bin directory in the working folder,so in our case:

$ cd /usr/src/android
$ mkdir bin

to download the download tool type:

$ curl > /usr/src/android/bin/repo

change permissions on repo:

$ chmod a+x /usr/src/android/bin/repo

Add the bin directory to your path and verify the repo tool is working

$ export PATH=/usr/src/android/bin:$PATH
$ repo

Now to the real download

Create a directory for the android source

$ mkdir /usr/src/android/mydroid
$ cd /usr/src/android/mydroid

Initialize the directory with the repo tool

$ repo init -u git:// -b froyo

Now real download

$ repo sync

This may take quite a long time ...

When this step is completed, you should have the official Android 2.2 source plus the Archos overlay for A5IT support. You can verify that these files are present by looking at:

$ ls vendor/archos