Download the source code of Android2.3 and compile it on Ubuntu9.10 (32-bit. This article briefly records the download and compilation processes. This step install get source code and compile the required software, use the following command: $ sudoaptitudeinstallgit-coregnupgflexbisongperflibsdl-devlibesd0-devlibwxgtk2.6-devbuild-essenti
Download the source code of Android 2.3 and compile it on Ubuntu 9.10 (32-bit. This article briefly records the download and compilation processes.
Run the following command to install and obtain the source code and compile the required software:
$ Sudo aptitude install git-core gnupg flex bison gperf libsdl-devlibesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-devzlib1g-dev
In addition, the following software packages have been installed based on others' experience in compiling Android 2.3:
$ Sudo apt-get install lib64z1-dev libc6-dev-amd64 g ++-multilib lib64stdc ++ 6
Although Java 6 is not supported on the official website of Android, I can compile it using Java 6, so here Easwy installs Java 6. First, remove the comments of the two lines in/etc/apt/sources. list to enable Java 6 Source:
Deb http://archive.canonical.com/ubuntu lucid partner
Deb-src http://archive.canonical.com/ubuntu lucid partner
Then install Java 6 JDK:
$ Sudo aptitude install sun-java6-jdk
Next, download the repo tool. This is a Python script provided by Google to facilitate the management of multiple Git version libraries:
$ Cd ~
$ Mkdir bin
$ Curl http://android.git.kernel.org/repo> ~ /Bin/repo
$ Chmod a + x ~ /Bin/repo
Remember to add the repo to your path for future use. Edit ~ /. Bashrc, add the following line:
PATH = $ PATH :~ /Bin
Export PATH
Then run the command .~ /. Bashrc. You can directly use the repo command later.
Next, obtain the source code of Android 2.3:
$ Mkdir android
$ Cd android
$ Repo init-u git: // android.git.kernel.org/platform/manifest.git
$ Repo sync (this takes a long time)
Compile Android
Next, compile:
$ Make-j 'grep' ^ processor '/proc/cpuinfo | wc-l'
In the preceding command, the-j parameter tells make to start multiple parallel tasks for compilation and speed up compilation on CPU that supports multiple cores. If you know how many cores your CPU is, you can directly replace this part with-j2 (dual-core ).
During compilation, I encountered the following error:
Www.linuxidc.com @ ubuntu :~ /Android $ make-j 'grep' ^ processor '/proc/cpuinfo | wc-l'
Prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc:/lib/tls/i686/cmov/libc. so.6: version 'glibc _ 100' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
Prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc:/lib/tls/i686/cmov/libc. so.6: version 'glibc _ 100' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
/Bin/bash: bison: command not found
/Bin/bash: java: command not found
========================================================== ====
PLATFORM_VERSION_CODENAME = AOSP
PLATFORM_VERSION = 3.1.4.1.5.9.2.6.5
TARGET_PRODUCT = full
TARGET_BUILD_VARIANT = eng
TARGET_SIMULATOR =
TARGET_BUILD_TYPE = release
TARGET_BUILD_APPS =
TARGET_ARCH = arm
TARGET_ARCH_VARIANT = armv7-a
HOST_ARCH = x86
HOST_ OS = linux
HOST_BUILD_TYPE = release
BUILD_ID = OPENMASTER
========================================================== ====
Checking build tools versions...
**************************************** ********************
/Bin/bash: java: command not found # jdk is not installed.
/Bin/bash: bison: command not found # sudo apt-get install bison
Prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc:/lib/tls/i686/cmov/libc. so.6: version 'glibc _ 100' not found (requiredby prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
For this problem, I have never mentioned that it is a system version problem ......
When compilation is complete, the generated image file is placed in the out/target/product/generic Directory.