提交 2c28984e authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Require Python 2 (fixes #33)

上级 78c5a39f
#!/usr/bin/env python2
#!/usr/bin/env python
# File inspired in https://github.com/indutny/bud
......@@ -7,6 +7,11 @@ import os
import subprocess
import sys
version = sys.version_info[0]
if version != 2:
raise RuntimeError('gyp requires Python 2, but this is Python ' + str(version))
CC = os.environ.get('CC', 'cc')
script_dir = os.path.dirname(__file__)
root = os.path.normpath(os.path.join(script_dir, '..'))
......@@ -20,7 +25,6 @@ except ImportError:
print(' ./scripts/get_dep.sh gyp');
sys.exit(42)
def host_arch():
machine = platform.machine()
if machine == 'i386': return 'ia32'
......@@ -29,7 +33,6 @@ def host_arch():
if machine.startswith('mips'): return 'mips'
return machine # Return as-is and hope for the best.
def compiler_version():
proc = subprocess.Popen(CC.split() + ['--version'], stdout=subprocess.PIPE)
is_clang = 'clang' in proc.communicate()[0].split('\n')[0]
......@@ -39,14 +42,12 @@ def compiler_version():
version = tuple(version)
return (version, is_clang)
def run_gyp(args):
rc = gyp.main(args)
if rc != 0:
print 'Error running GYP'
sys.exit(rc)
if __name__ == '__main__':
args = sys.argv[1:]
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论