OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Shim to run nacl toolchain download script only if there is a nacl dir.""" | 6 """Shim to run nacl toolchain download script only if there is a nacl dir.""" |
7 | 7 |
8 import os | 8 import os |
9 import sys | 9 import sys |
10 | 10 |
11 | 11 |
12 def Main(): | 12 def Main(): |
13 # Handle chromeos=1 specially (until its building its own toolchain). | |
noelallen_use_chromium
2011/08/26 21:05:35
Wow, that is one ugly hack. :(
I assume the real
| |
14 if 'chromeos=1' in os.environ.get('GYP_DEFINES', ''): | |
15 sys.argv = [ | |
16 sys.argv[0], | |
17 '--nacl-newlib-only', | |
18 '--file-hash', 'linux_x86_newlib', | |
19 '8337d5ec327d857a49b500723ec9b792f4973abc', | |
20 '--base-url', ('https://commondatastorage.googleapis.com/' | |
21 'nativeclient-archive2/special_chromeos'), | |
22 '--x86-version', '6561', | |
23 ] | |
13 script_dir = os.path.dirname(os.path.abspath(__file__)) | 24 script_dir = os.path.dirname(os.path.abspath(__file__)) |
14 src_dir = os.path.dirname(script_dir) | 25 src_dir = os.path.dirname(script_dir) |
15 nacl_dir = os.path.join(src_dir, 'native_client') | 26 nacl_dir = os.path.join(src_dir, 'native_client') |
16 nacl_build_dir = os.path.join(nacl_dir, 'build') | 27 nacl_build_dir = os.path.join(nacl_dir, 'build') |
17 download_script = os.path.join(nacl_build_dir, 'download_toolchains.py') | 28 download_script = os.path.join(nacl_build_dir, 'download_toolchains.py') |
18 if not os.path.exists(download_script): | 29 if not os.path.exists(download_script): |
19 print "Can't find '%s'" % download_script | 30 print "Can't find '%s'" % download_script |
20 print 'Presumably you are intentionally building without NativeClient.' | 31 print 'Presumably you are intentionally building without NativeClient.' |
21 print 'Skipping NativeClient toolchain download.' | 32 print 'Skipping NativeClient toolchain download.' |
22 sys.exit(0) | 33 sys.exit(0) |
23 sys.path.insert(0, nacl_build_dir) | 34 sys.path.insert(0, nacl_build_dir) |
24 import download_toolchains | 35 import download_toolchains |
25 download_toolchains.Main() | 36 download_toolchains.Main() |
26 | 37 |
27 | 38 |
28 if __name__ == '__main__': | 39 if __name__ == '__main__': |
29 Main() | 40 Main() |
OLD | NEW |