32位系统下编译Android2.3系统需要做得更改

在用32位系统编译android2.3时,make的时候会提示出错:

************************************************************

You are attempting to build on a 32-bit system.

Only 64-bit build environments are supported beyond froyo/2.2.

************************************************************

因为Android2.3默认是64位的系统上编译,需要手动修改build/core/main.mk,把这个判断部分注释掉:

#ifneq (64,$(findstring 64,$(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

重新make,如果是安装了JDK6版本,会又报错:

Docs droiddoc: out/target/common/docs/api-stubs

Could not load ‘clearsilver-jni’

java.library.path = out/host/linux-x86/lib

make: *** [out/target/common/docs/api-stubs-timestamp] Error 45

make: *** Waiting for unfinished jobs….

Could not load ‘clearsilver-jni’

java.library.path = out/host/linux-x86/lib

make: *** [out/target/common/docs/doc-comment-check-timestamp] Error 45

这是由于clearsilver在编译时如果检测到使用Java JDK 6,就使用64位编译,因为Google的一个员工更新了几个文件。这里可以看到详细的修改记录:http://android.git.kernel.org/?p=platform/external/clearsilver.git;a=commitdiff;h=d36910a8110d8377b22301274d2b5131a732a72b

修改这几个文件,该回到32位编译环境即可:

external/clearsilver/cgi/Android.mk

external/clearsilver/java-jni/Android.mk

external/clearsilver/util/Android.mk

external/clearsilver/cs/Android.mk

把编译选项-m64改成-m32即可

重新make,大概不到一个小时就make完了。


你可能感兴趣的:(android)