summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorjames.wei@intel.com <james.wei@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-03 04:00:39 +0000
committerjames.wei@intel.com <james.wei@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-03 04:00:39 +0000
commitcc4dfbd4ad14325fa084c4fe422e962dc93c85a1 (patch)
tree7ff98fc3e728a644e26e9e10161aad629c9d302a /build
parenta35402e8f5574e6ec1f222dc69b8f3a498a5c3f2 (diff)
downloadchromium_src-cc4dfbd4ad14325fa084c4fe422e962dc93c85a1.zip
chromium_src-cc4dfbd4ad14325fa084c4fe422e962dc93c85a1.tar.gz
chromium_src-cc4dfbd4ad14325fa084c4fe422e962dc93c85a1.tar.bz2
This patch is to enable x86 android build.
patch includes two parts: 1. gyp files modification to include x86 android build. 2. add android config files for yasm which is copied from linux ones. enable android x86 build This patch is cloned from the issue #10198027 for ownership issue. https://chromiumcodereview.appspot.com/10198027/ BUG=125160 TEST= Review URL: http://codereview.chromium.org/10271039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135087 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-xbuild/android/envsetup.sh42
-rw-r--r--build/common.gypi22
2 files changed, 39 insertions, 25 deletions
diff --git a/build/android/envsetup.sh b/build/android/envsetup.sh
index fdf328e..77faec8 100755
--- a/build/android/envsetup.sh
+++ b/build/android/envsetup.sh
@@ -45,7 +45,25 @@ case "${host_os}" in
return 1
esac
-export ANDROID_TOOLCHAIN="${ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/${toolchain_dir}/bin/"
+# The following defines will affect ARM code generation of both C/C++ compiler
+# and V8 mksnapshot.
+case "${TARGET_PRODUCT-full}" in
+ "full")
+ DEFINES=" target_arch=arm"
+ DEFINES+=" arm_neon=0 armv7=1 arm_thumb=1 arm_fpu=vfpv3-d16"
+ toolchain_arch="arm-linux-androideabi-4.4.3"
+ ;;
+ *x86*)
+ DEFINES=" target_arch=ia32 use_libffmpeg=0"
+ toolchain_arch="x86-4.4.3"
+ ;;
+ *)
+ echo "TARGET_PRODUCT: ${TARGET_PRODUCT} is not supported." >& 2
+ return 1
+esac
+
+toolchain_path="${ANDROID_NDK_ROOT}/toolchains/${toolchain_arch}/prebuilt/"
+export ANDROID_TOOLCHAIN="${toolchain_path}/${toolchain_dir}/bin/"
export ANDROID_SDK_VERSION="15"
@@ -97,7 +115,7 @@ export STRIP=$(echo ${ANDROID_TOOLCHAIN}/*-strip)
# The set of GYP_DEFINES to pass to gyp. Use 'readlink -e' on directories
# to canonicalize them (remove double '/', remove trailing '/', etc).
-DEFINES="OS=android"
+DEFINES+=" OS=android"
DEFINES+=" android_build_type=0" # Currently, Only '0' is supportted.
DEFINES+=" host_os=${host_os}"
DEFINES+=" linux_fpic=1"
@@ -113,26 +131,6 @@ DEFINES+=" build_ffmpegsumo=0"
DEFINES+=" gtest_target_type=executable"
DEFINES+=" branding=Chromium"
-# If the TARGET_PRODUCT wasn't set, use 'full' by default.
-if [ -z "${TARGET_PRODUCT}" ]; then
- TARGET_PRODUCT="full"
-fi
-
-# The following defines will affect ARM code generation of both C/C++ compiler
-# and V8 mksnapshot.
-case "${TARGET_PRODUCT}" in
- "full")
- DEFINES+=" target_arch=arm"
- DEFINES+=" arm_neon=0 armv7=1 arm_thumb=1 arm_fpu=vfpv3-d16"
- ;;
- *x86*)
- DEFINES+=" target_arch=ia32 use_libffmpeg=0"
- ;;
- *)
- echo "TARGET_PRODUCT: ${TARGET_PRODUCT} is not supported." >& 2
- return 1
-esac
-
export GYP_DEFINES="${DEFINES}"
# Use the "android" flavor of the Makefile generator for both Linux and OS X.
diff --git a/build/common.gypi b/build/common.gypi
index 45cd2f8..587100e 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -823,7 +823,16 @@
'variables': {
'variables': {
'android_ndk_root%': '<!(/bin/echo -n $ANDROID_NDK_ROOT)',
- 'target_arch%': 'arm', # target_arch in android terms.
+ # Android uses x86 instead of ia32 for their target_arch
+ # designation.
+ # TODO(wistoch): Adjust the target_arch naming scheme to avoid
+ # confusion.
+ # http://crbug.com/125329
+ 'conditions': [
+ ['target_arch == "ia32"', {
+ 'target_arch': 'x86',
+ }],
+ ],
# Switch between different build types, currently only '0' is
# supported.
@@ -978,7 +987,7 @@
],
}],
- ['os_posix==1 and chromeos==0 and target_arch!="arm"', {
+ ['os_posix==1 and chromeos==0 and OS!="android"', {
'use_cups%': 1,
}, {
'use_cups%': 0,
@@ -2381,10 +2390,17 @@
'ldflags': [
'-nostdlib',
'-Wl,--no-undefined',
- '-Wl,--icf=safe', # Enable identical code folding to reduce size
# Don't export symbols from statically linked libraries.
'-Wl,--exclude-libs=ALL',
],
+ 'conditions': [
+ ['target_arch == "arm"', {
+ 'ldflags': [
+ # Enable identical code folding to reduce size.
+ '-Wl,--icf=safe',
+ ],
+ }],
+ ],
'libraries': [
'-l<(android_stlport_library)',
# Manually link the libgcc.a that the cross compiler uses.