summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/common.gypi9
-rwxr-xr-xbuild/linux/python_arch.sh38
-rw-r--r--chrome/chrome_tests.gypi2
3 files changed, 45 insertions, 4 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 6c702ef..5f3223c2 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -91,6 +91,9 @@
# Set Neon compilation flags (only meaningful if armv7==1).
'arm_neon%': 1,
+
+ # The system root for cross-compiles. Default: none.
+ 'sysroot%': '',
},
# Define branding and buildtype on the basis of their settings within the
@@ -107,6 +110,7 @@
'python_ver%': '<(python_ver)',
'armv7%': '<(armv7)',
'arm_neon%': '<(arm_neon)',
+ 'sysroot%': '<(sysroot)',
# The release channel that this build targets. This is used to restrict
# channel-specific build options, like which installer packages to create.
@@ -187,9 +191,6 @@
# but that doesn't work as we'd like.
'msvs_debug_link_incremental%': '2',
- # The system root for cross-compiles. Default: none.
- 'sysroot%': '',
-
# This is the location of the sandbox binary. Chrome looks for this before
# running the zygote process. If found, and SUID, it will be used to
# sandbox the zygote process and, thus, all renderer processes.
@@ -219,6 +220,8 @@
# This will set gcc_version to XY if you are running gcc X.Y.*.
# This is used to tweak build flags for gcc 4.4.
'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
+ # Figure out the python architecture to decide if we build pyauto.
+ 'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/bin/python<(python_ver))',
'conditions': [
['branding=="Chrome" or linux_chromium_breakpad==1', {
'linux_breakpad%': 1,
diff --git a/build/linux/python_arch.sh b/build/linux/python_arch.sh
new file mode 100755
index 0000000..e3b0657
--- /dev/null
+++ b/build/linux/python_arch.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+# Copyright (c) 2010 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This figures out the architecture of the version of Python we are building
+# pyautolib against.
+#
+# python_arch.sh /usr/bin/python2.5
+# python_arch.sh /path/to/sysroot/usr/bin/python2.4
+#
+
+set -e
+
+python=$(readlink -f "$1")
+file_out=$(file "$python")
+
+set +e
+
+echo $file_out | grep -qs "ARM"
+if [ $? -eq 0 ]; then
+ echo arm
+ exit 0
+fi
+
+echo $file_out | grep -qs "x86-64"
+if [ $? -eq 0 ]; then
+ echo x64
+ exit 0
+fi
+
+echo $file_out | grep -qs "Intel 80386"
+if [ $? -eq 0 ]; then
+ echo ia32
+ exit 0
+fi
+
+exit 1
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index b18ff4c..3865a04 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -1879,7 +1879,7 @@
]}, # 'targets'
], # OS=="win"
# Build on linux x86_64 only if linux_fpic==1
- ['OS=="mac" or chromeos==1 or (OS=="linux" and target_arch==host_arch and (target_arch!="x64" or linux_fpic==1))', {
+ ['OS=="mac" or (OS=="linux" and target_arch==python_arch and (target_arch!="x64" or linux_fpic==1))', {
'targets': [
# TODO(nirnimesh): enable for win - crbug.com/32285
{