michael@0: #!/bin/sh michael@0: # Copyright (c) 2011 The Chromium Authors. All rights reserved. michael@0: # Use of this source code is governed by a BSD-style license that can be michael@0: # found in the LICENSE file. michael@0: michael@0: # This figures out the architecture of the version of Python we are building michael@0: # pyautolib against. michael@0: # michael@0: # python_arch.sh /usr/lib/libpython2.5.so.1.0 michael@0: # python_arch.sh /path/to/sysroot/usr/lib/libpython2.4.so.1.0 michael@0: # michael@0: michael@0: python=$(readlink -f "$1") michael@0: if [ ! -r "$python" ]; then michael@0: echo unknown michael@0: exit 0 michael@0: fi michael@0: file_out=$(file "$python") michael@0: if [ $? -ne 0 ]; then michael@0: echo unknown michael@0: exit 0 michael@0: fi michael@0: michael@0: echo $file_out | grep -qs "ARM" michael@0: if [ $? -eq 0 ]; then michael@0: echo arm michael@0: exit 0 michael@0: fi michael@0: michael@0: echo $file_out | grep -qs "x86-64" michael@0: if [ $? -eq 0 ]; then michael@0: echo x64 michael@0: exit 0 michael@0: fi michael@0: michael@0: echo $file_out | grep -qs "Intel 80386" michael@0: if [ $? -eq 0 ]; then michael@0: echo ia32 michael@0: exit 0 michael@0: fi michael@0: michael@0: exit 1