如何在ubuntu10.04环境下编译android
编译环境:ubuntu10.04
1.安装java
下载jdk-1_5_0_22-linux-i586.bin
安装./jdk-1_5_0_22-linux-i586.bin
会生成jdk1.5.0_22目录,将此目录移至/usr/local/下
2.添加环境变量
export JAVA_HOME=/usr/local/jdk1.5.0_22
export JAVA_FONTS=$JAVA_HOME/jre/lib/fonts(不知道干什么用的)
export JRE_HOME=$JAVA_HOME/jre(不知道干什么用的)
export JAVA_PATH=$JAVA_HOME/bin: $JRE_HOME/bin
export CLASSPATH=.: $JAVA_HOME/lib: $JRE_HOME/lib: $CLASSPATH: $JAVA_HOME/lib/dt.jar: $JAVA_HOME/lib/tools.jar(不知道干什么用的)
export ANDROID_JAVA_HOME=$JAVA_HOME(不知道干什么用的)
export PATH=$JAVA_PATH: $PATH
3.安装必要的工具(以Ubuntu为例)
$sudo apt-get install build-essential(最新)
$sudo apt-get install zlib1g-dev(最新)
$sudo apt-get install flex(安装)
$sudo apt-get install libncurses-dev(安装)
$sudo apt-get install libx11-dev(最新)
$sudo apt-get install gperf(安装)
$sudo apt-get install bison(安装)
PS:最新为不需要安装但是编译Android所必须的工具
4.开始编译
source build/envsetup.sh
choosecombo 1 1 6 3
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=1.6
TARGET_PRODUCT=msm7625_qrd_evt1
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=Donut
============================================
make -j4(-j4是指开四个线程,速度会快一些)
import sha
unzipping target target-files...
WARNING: Failed to load max image sizes; will not enforce
image size limits.
warning: no radio image in input target_files; not flashing radio
failed to reconstruct target deflate chunk 2 [(null)]; treating as normal
Construct patches for 3 chunks...
patch 0 is 207 bytes (of 1904650)
patch 1 is 218299 bytes (of 159983)
patch 2 is 151 bytes (of 1799)
chunk 0: normal ( 0, 1904650) 207
chunk 1: deflate ( 1904650, 415279) 218299 (null)
chunk 2: normal ( 2319929, 455) 151
done.
make kernelconfig
出现以上,编译成功!~