summaryrefslogtreecommitdiffstats
path: root/build/linux
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-04 16:42:23 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-04 16:42:23 +0000
commit4d83eb7d97c4b0f530eb82ad3cf6a1952d4183f4 (patch)
tree49055561af0bdb31ac64379adcd50fe726a49900 /build/linux
parentbbef41f026b0c7aecac8169e40020b892163fd08 (diff)
downloadchromium_src-4d83eb7d97c4b0f530eb82ad3cf6a1952d4183f4.zip
chromium_src-4d83eb7d97c4b0f530eb82ad3cf6a1952d4183f4.tar.gz
chromium_src-4d83eb7d97c4b0f530eb82ad3cf6a1952d4183f4.tar.bz2
Build pyauto only if the architecture of python binary matches.
BUG=none TEST=Building 32-bit pyauto on 64-bit Linux with a 32-bit sysroot works. Review URL: http://codereview.chromium.org/660443 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40630 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/linux')
-rwxr-xr-xbuild/linux/python_arch.sh38
1 files changed, 38 insertions, 0 deletions
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