Move detect_v8_host_arch out of gypfiles.

R=machenbach@chromium.org

Bug: v8:7335
Change-Id: I49317fed6c91064109d3adff06b0bba474e11f1d
Reviewed-on: https://chromium-review.googlesource.com/892865
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50975}
This commit is contained in:
Yang Guo 2018-01-31 08:44:54 +01:00 committed by Commit Bot
parent 9c4c717b5d
commit 8ffa1f10cb
3 changed files with 7 additions and 5 deletions

View File

@ -48,7 +48,8 @@ import gyp
# Add paths so that pymod_do_main(...) can import files.
sys.path.insert(
1, os.path.abspath(os.path.join(v8_root, 'tools', 'generate_shim_headers')))
sys.path.append(
os.path.abspath(os.path.join(v8_root, 'third_party', 'binutils')))
def GetOutputDirectory():
"""Returns the output directory that GYP will use."""

View File

@ -38,6 +38,9 @@ def main():
return 0
def DoMain(_):
return DetectHostArch();
def DetectHostArch():
"""Hook to be called from gyp without starting a separate python
interpreter."""
host_arch = platform.machine()

View File

@ -15,6 +15,7 @@ import re
import shutil
import subprocess
import sys
from detect_v8_host_arch import DetectHostArch
BINUTILS_DIR = os.path.abspath(os.path.dirname(__file__))
@ -22,9 +23,6 @@ BINUTILS_FILE = 'binutils.tar.bz2'
BINUTILS_TOOLS = ['bin/ld.gold', 'bin/objcopy', 'bin/objdump']
BINUTILS_OUT = 'Release'
DETECT_HOST_ARCH = os.path.abspath(os.path.join(
BINUTILS_DIR, '../../gypfiles/detect_v8_host_arch.py'))
def ReadFile(filename):
with file(filename, 'r') as f:
@ -48,7 +46,7 @@ def GetArch():
return 'x64'
return arch
return subprocess.check_output(['python', DETECT_HOST_ARCH]).strip()
return DetectHostArch()
def FetchAndExtract(arch):