Chinaunix首页 | 论坛 | 博客
  • 博客访问: 257587
  • 博文数量: 69
  • 博客积分: 1400
  • 博客等级: 上尉
  • 技术积分: 900
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-07 16:35
文章分类

全部博文(69)

文章存档

2011年(1)

2010年(68)

我的朋友

分类: LINUX

2010-08-09 22:08:27

编译环境

Ubuntu 9.04 Desktop

下载和编译流程

根据的说明,成功的下载了所有源代码,整个目录文件接近2G

前期准备:

安装 git工具内核, 命令 sudo apt-get install git-core

1. 下载repo工具

curl > $HOME/bin/repo
cd $HOME/bin
chmod +x repo
2.导出android项目
mkdir android
cd android
repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake (如果不出错的话,5分钟内应提示成功,跟网络速度有关)
3.开始下载android platform的源代码
repo sync               (这个操作会持续一段时间,与你自己的网速有关)

4.编译前,建议装的软件包如下(使用apt-get安装)
flex bison gperf libsdl-dev libesd0-dev curl libncurses5-dev zlib1g-dev libx11-dev

5.编译
make             (非常漫长的等待,与你的CPU速度有一定关系,建议是睡觉前编译)
编译时,以下源代码需要加入相应的头文件(include)
/android/cupcake/frameworks/base/tools/aidl/aidl.cpp string.h,stdlib.h
/android/cupcake/frameworks/base/tools/aidl/options.cpp string.h
/android/cupcake/frameworks/base/tools/aidl/search_path.h string,string.h
/android/cupcake/frameworks/base/tools/aidl/generate_java string.h
/android/cupcake/external/srec/tools/thirdparty/OpenFst/fst/lib/vector-fst.h string.h
/android/cupcake/external/srec/tools/thirdparty/OpenFst/fst/lib/symbol-table.cpp string.h
/android/cupcake/build/tools/atree/files.cpp string.h,stdlib.h
/android/cupcake/build/tools/atree/fs.cpp string.h
/android/cupcake/frameworks/base/tools/localize/file_utils.cpp string.h,stdlib.h
/android/cupcake/frameworks/base/tools/localize/localize.cpp string.h,stdlib.h
/android/cupcake/frameworks/base/tools/localize/Perforce.cpp string.h,stdlib.h
/android/cupcake/frameworks/base/tools/localize/XLIFFFile.cpp iostream,algorithm
/android/cupcake/frameworks/base/tools/localize/XMLHandler.cpp iostream,algorithm
/android/cupcake/development/emulator/qtools/dmtrace.cpp unistd.h

编译完毕以后,会发现在代码目录下多了一个out目录
6.设置运行环境 (修改$HOME/.profile文件),加入以下内容
# Android
PATH=”$PATH:$HOME/android/out/host/linux-x86/bin”
ANDROID_PRODUCT_OUT=$HOME/android/out/target/product/generic
export ANDROID_PRODUCT_OUT
设置完毕后,退出并重新登录
7.使用虚拟机运行
cd $HOME/android/out/target/product/generic
emulator -image system.img -data userdata.img -ramdisk ramdisk.img
应该看到以下的画面(第一次开启的时候,应该还有一个向google反馈的一个对话框,按下确定即可)

阅读(917) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~