• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# Copyright (c) 2011 The Chromium Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6# This figures out the architecture of the version of Python we are building
7# pyautolib against.
8#
9#  python_arch.sh /usr/lib/libpython2.5.so.1.0
10#  python_arch.sh /path/to/sysroot/usr/lib/libpython2.4.so.1.0
11#
12
13python=$(readlink -f "$1")
14if [ ! -r "$python" ]; then
15  echo unknown
16  exit 0
17fi
18file_out=$(file "$python")
19if [ $? -ne 0 ]; then
20  echo unknown
21  exit 0
22fi
23
24echo $file_out | grep -qs "ARM"
25if [ $? -eq 0 ]; then
26  echo arm
27  exit 0
28fi
29
30echo $file_out | grep -qs "x86-64"
31if [ $? -eq 0 ]; then
32  echo x64
33  exit 0
34fi
35
36echo $file_out | grep -qs "Intel 80386"
37if [ $? -eq 0 ]; then
38  echo ia32
39  exit 0
40fi
41
42exit 1
43