Check getconf to get the bittedness of the local system.

This checks the bittedness of the local system using getconf instead of "file
/sbin/init". "file" isn't on some ChromeOS roots.

BUG=
R=thakis@chromium.org
TBR=thakis

Review URL: https://codereview.chromium.org/100053008

git-svn-id: http://src.chromium.org/svn/trunk/src/build@238493 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
brettw@chromium.org 2013-12-04 00:05:44 +00:00
Родитель e45bc881d5
Коммит 2709ce9769
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -131,9 +131,8 @@ def RunGN(supplemental_includes):
if sys.platform == 'win32':
gnpath += 'win/gn.exe'
elif sys.platform.startswith('linux'):
# On Linux we have 32-bit and 64-bit versions. Checking /sbin/init avoids
# uname's confusion when running a 32-bit userland on a 64-bit kernel.
if subprocess.check_output(["file", "/sbin/init"]).find("ELF 64-bit") >= 0:
# On Linux we have 32-bit and 64-bit versions.
if subprocess.check_output(["getconf", "LONG_BIT"]).find("64") >= 0:
gnpath += 'linux/gn'
else:
gnpath += 'linux/gn32'