当前位置: 代码迷 >> Android >> Android 4.0 编译全程.
  详细解决方案

Android 4.0 编译全程.

热度:17   发布时间:2016-05-01 14:07:19.0
Android 4.0 编译全程...

进过几天的等待,几经波折终于把android 4.0 的代码下载下来。(http://android-sz.iteye.com/blog/1259206)

?

终于可以编译了,期待……

?

编译环境:

1,系统: Ubuntu 10.10 (64bit)
2,Jdk: java (64bit)
3,交叉编译链: 自带

?

为了避免编译过程中出现错误,执行如下命令安装下面软件

$:sudo apt-get install zlib1g-dev lib64z1-dev bison flex libncurses5-dev libgl1-mesa-dev gperf gnupg zip libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential

?

个人习惯,修改一些配置文件。减少系统语言的种类,设置系统显示的样式及设置jdk变量。

?

?

envsetup.sh                      |    3 ++- target/product/languages_full.mk |    3 ++- target/product/locales_full.mk   |    2 +- 3 files changed, 5 insertions(+), 3 deletions(-)diff --git a/envsetup.sh b/envsetup.shindex bab2d25..900b3f0 100644--- a/envsetup.sh+++ b/envsetup.sh@@ -1046,7 +1046,8 @@ function set_java_home() {                 export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home                 ;;             *)-                export JAVA_HOME=/usr/lib/jvm/java-6-sun+                #export JAVA_HOME=/usr/lib/jvm/java-6-sun+		export JAVA_HOME=/usr/local/jdk6/jdk1.6.0_24                 ;;         esac     fidiff --git a/target/product/languages_full.mk b/target/product/languages_full.mkindex e494fad..77ddd93 100644--- a/target/product/languages_full.mk+++ b/target/product/languages_full.mk@@ -21,5 +21,6 @@  # Those are all the locales that have translations and are displayable # by TextView in this branch.-PRODUCT_LOCALES := en_US fr_FR it_IT es_ES de_DE nl_NL cs_CZ pl_PL ja_JP zh_TW zh_CN ru_RU ko_KR nb_NO es_US da_DK el_GR tr_TR pt_PT pt_BR rm_CH sv_SE bg_BG ca_ES en_GB fi_FI hi_IN hr_HR hu_HU in_ID iw_IL lt_LT lv_LV ro_RO sk_SK sl_SI sr_RS uk_UA vi_VN tl_PH ar_EG fa_IR th_TH sw_TZ ms_MY af_ZA zu_ZA+PRODUCT_LOCALES := zh_CN hdpi+#en_US fr_FR it_IT es_ES de_DE nl_NL cs_CZ pl_PL ja_JP zh_TW zh_CN ru_RU ko_KR nb_NO es_US da_DK el_GR tr_TR pt_PT pt_BR rm_CH sv_SE bg_BG ca_ES en_GB fi_FI hi_IN hr_HR hu_HU in_ID iw_IL lt_LT lv_LV ro_RO sk_SK sl_SI sr_RS uk_UA vi_VN tl_PH ar_EG fa_IR th_TH sw_TZ ms_MY af_ZA zu_ZA # We don't have the fonts to display am_ET yetdiff --git a/target/product/locales_full.mk b/target/product/locales_full.mkindex cab2b91..7b95d4a 100644--- a/target/product/locales_full.mk+++ b/target/product/locales_full.mk@@ -1,3 +1,3 @@-PRODUCT_LOCALES := cs_CZ da_DK de_AT de_CH de_DE de_LI el_GR en_AU en_CA en_GB en_NZ en_SG en_US es_ES fr_CA fr_CH fr_BE fr_FR it_CH it_IT ja_JP ko_KR nb_NO nl_BE nl_NL pl_PL pt_PT ru_RU sv_SE tr_TR zh_CN zh_HK zh_TW+#PRODUCT_LOCALES := cs_CZ da_DK de_AT de_CH de_DE de_LI el_GR en_AU en_CA en_GB en_NZ en_SG en_US es_ES fr_CA fr_CH fr_BE fr_FR it_CH it_IT ja_JP ko_KR nb_NO nl_BE nl_NL pl_PL pt_PT ru_RU sv_SE tr_TR zh_CN zh_HK zh_TW  $(call inherit-product, build/target/product/languages_full.mk)

?

做完上面几步,可以开始编译了……

?

1, 配置编译环境

?

SOURCE_PATH$:source ./build/envsetup.sh

?

执行了下面几个文件

?

including device/samsung/maguro/vendorsetup.sh

including device/samsung/tuna/vendorsetup.sh

including device/ti/panda/vendorsetup.sh

including sdk/bash_completion/adb.bash


2, 设置编译选项

SOURCE_PATH$:lunch

You're building on Linux

Lunch menu... pick a combo:
? ? ?1. full-eng
? ? ?2. full_x86-eng
? ? ?3. vbox_x86-eng
? ? ?4. full_maguro-userdebug
? ? ?5. full_tuna-userdebug
? ? ?6. full_panda-eng

Which would you like? [full-eng] 1

?

?

============================================

PLATFORM_VERSION_CODENAME=REL

PLATFORM_VERSION=4.0.1

TARGET_PRODUCT=full

TARGET_BUILD_VARIANT=eng

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=ITL41D

============================================


呵呵,可以看到平台的配置。

?

3,开始编译

?

SOURCE_PATH$:make -j4

?

启用4线程编译吧!

?

等待中 ?…………

?

足足编译了4个小时,中间遇到磁盘不足。各位大能记得预留足够的磁盘空间。

?

?

终于编译完了。是不是迫不及待想看看效果呢?

?

4, 执行自己编译出来的android 4.0 吧!

?

设置sdk环境变量

SOURCE _PATH$:export PATH=~/Android/out/host/linux-x86/sdk/android-sdk_eng.root_linux-x86/tools:$PATH

?

执行编译出来的img

SOURCE_PATH$: $OUT/emulator -system system.img -data userdata.img -ramdisk ramdisk.img

?

5, 图出来咯

?

启动


?

进入系统


?

查看一下编译信息

?



ok 大功告成!

?

可以更深一步研究Android 4.0

?

?

转载请注明出处,谢谢!

?

?

1 楼 gzfreeman 2011-11-18  
请问用了多长时间?
2 楼 bluishoul 2011-11-21  
求镜像 呵呵 [email protected]
3 楼 地球小野花 2011-11-21  
bluishoul 写道
求镜像 呵呵 [email protected]

img包?
4 楼 地球小野花 2011-11-21  
gzfreeman 写道
请问用了多长时间?

几个小时。具体没计算。
5 楼 bluishoul 2011-11-22  
应该比较大吧 还是自己编译吧 但是我的ubuntu是装的wubi 而且实在4core的机子上装的32bit的 汗了..........
  相关解决方案