Ubuntu 11.04 32bit 编译Android 2.3源码
最近在自己的机器上配置Android 2.3的编译环境,由于之前安装的32位Ubuntu系统,直接升级到11.04,懒得重装64位的系统,所以编译时遇到了不少问题:
1.Makefile中编译环境的检查过不去:提示安装64位系统
可以把操作系统的检查部分修改为
ifneq (64,$(findstring 64,$(build_arch)))
#line below is add to compatible 32bit system
ifneq (i686,$(findstring i686,$(build_arch)))
$(warning ************************************************************)
$(warning You are attempting to build on a 32-bit system.)
$(warning Only 64-bit build environments are supported beyond froyo/2.2.)
$(warning ************************************************************)
$(error stop)
endif
endif
2.编译过程中提示找不到libz.a和libz.so
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libz.a when searching for -lz
/usr/bin/ld: skipping incompatible //usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible //usr/lib/libz.a when searching for -lz
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
百度了一下,多是安装lib32z1-dev,我在命令行里sudo apt-get install lib32z1-dev,却提示E: 未发现软件包 lib32z1-dev;
应该安装lib64z1-dev,sudo apt-get install lib32z1-dev,在新立得软件包管理器中也可以安装。
安装成功后可以继续编译。