8/30/2011

Android 2.3 Gingerbread with x86


因為Android 2.3 Gingerbard original code是預設在x64上compile

所以如果你的Linux不是x64的話,是不會讓你compile的。

其實只要改幾個.mk而己 :

project build/
diff --git a/core/main.mk b/core/main.mk
index f761ba5..4ee4bf9 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -68,7 +68,7 @@ $(info Checking build tools versions...)

ifeq ($(BUILD_OS),linux)
build_arch := $(shell uname -m)
-ifneq (64,$(findstring 64,$(build_arch)))
+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.)

project external/clearsilver/
diff --git a/cgi/Android.mk b/cgi/Android.mk
index 21c534b..37b8246 100644
--- a/cgi/Android.mk
+++ b/cgi/Android.mk
@@ -13,8 +13,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_CFLAGS := -fPIC

# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64

+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32


LOCAL_NO_DEFAULT_COMPILER_FLAGS := true

diff --git a/cs/Android.mk b/cs/Android.mk
index 9f0e30a..275845d 100644
--- a/cs/Android.mk
+++ b/cs/Android.mk
@@ -9,8 +9,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_CFLAGS := -fPIC

# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64

+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32

LOCAL_NO_DEFAULT_COMPILER_FLAGS := true

diff --git a/java-jni/Android.mk b/java-jni/Android.mk
index 21b4fd1..c1d38d2 100644
--- a/java-jni/Android.mk
+++ b/java-jni/Android.mk
@@ -34,8 +34,8 @@ LOCAL_C_INCLUDES := \
LOCAL_CFLAGS += -fPIC

# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64

+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32

LOCAL_NO_DEFAULT_COMPILER_FLAGS := true

diff --git a/util/Android.mk b/util/Android.mk
index 386f379..b694ef4 100644
--- a/util/Android.mk
+++ b/util/Android.mk
@@ -18,8 +18,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_CFLAGS := -fPIC

# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64

+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32


LOCAL_NO_DEFAULT_COMPILER_FLAGS := true

No comments:

Post a Comment