Android培训班(85)升级到4.0版本

ICS总算发布了,从2.3.7升级到4.0.3版本。下面就是升级的命令:
$ mkdir ~/bin
$ PATH=~/bin:$PATH

这里创建bin目录,以便放置下载软件repo.


  • $ mkdir 工作目录
    $ cd 工作目录
这里创建工作目录,用来保存下载源码。


$ repo init -u https://android.googlesource.com/platform/manifest
这行是获取主分支里的代码,如果你的系统是ubuntu 11.10需要使用主分布的代码来编译,如果是以前android版本会编译不通过。

$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
这行是取分支的方法,比如只需要某个版本的代码,就可以添加分支来下载。

$ repo sync
这一行才是真正地从代码下载下来。

下载的代码大小为5G到6G之间,因此下载的时间比较长,我这里下载了一个晚上。为了加快速度,好像也可以使用repo sync -j10的参数。

编译完成后,占用的空间大小为23G左右。

使用下面的命令行进行编译:

rm -rf out/
source build/envsetup.sh
lunch full-eng
make
 

为了加快编译速度,也可以使用make -j8的方式,这样使用8个线程编译,不过有时会出错,因为线程之间不同步的原因,可以多输入几次就行了。

在编译过程中,还是发现有一个BUG,如下:

external/mesa3d/src/glsl/linker.cpp:623:33: warning:   by ‘virtual ir_visitor_status remap_variables(ir_instruction*, gl_shader*, hash_table*)::remap_visitor::visit(ir_dereference_variable*)’ [-Woverloaded-virtual]
external/mesa3d/src/glsl/linker.cpp: In function ‘void assign_varying_locations(gl_shader_program*, gl_shader*, gl_shader*)’:
external/mesa3d/src/glsl/linker.cpp:1394:49: error: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1394:50: error: ‘varyings’ was not declared in this scope
external/mesa3d/src/glsl/linker.cpp:1394:58: error: ‘offsetof’ was not declared in this scope
external/mesa3d/src/glsl/linker.cpp:1395:48: error: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1412:47: error: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1412:48: error: ‘position’ was not declared in this scope
external/mesa3d/src/glsl/linker.cpp:1414:47: error: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1414:48: error: ‘pointSize’ was not declared in this scope
external/mesa3d/src/glsl/linker.cpp:1424:47: error: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1424:48: error: ‘position’ was not declared in this scope
external/mesa3d/src/glsl/linker.cpp:1428:47: error: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1428:48: error: ‘frontFacingPointCoord’ was not declared in this scope
external/mesa3d/src/glsl/linker.cpp:1431:47: error: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1431:48: error: ‘frontFacingPointCoord’ was not declared in this scope
external/mesa3d/src/glsl/linker.cpp: In function ‘void link_shaders(const gl_context*, gl_shader_program*)’:
external/mesa3d/src/glsl/linker.cpp:1734:49: error: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1734:50: error: ‘fragColor’ was not declared in this scope
external/mesa3d/src/glsl/linker.cpp:1734:59: error: ‘offsetof’ was not declared in this scope
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] Error 1

解决这个问题需要修改文件如下:

把 "#include <stddef.h>" 添加到 linker.cpp 文件头部。
 
这样就可以编译完成了。




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

caimouse

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值