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(args): | 12 def Main(args): |
13 # Handle chromeos=1 specially (until its building its own toolchain). | 13 # Handle chromeos=1 specially (until its building its own toolchain). |
14 if 'chromeos=1' in os.environ.get('GYP_DEFINES', ''): | 14 if 'chromeos=1' in os.environ.get('GYP_DEFINES', ''): |
15 args = [ | 15 args = [ |
16 '--nacl-newlib-only', | 16 '--nacl-newlib-only', |
17 '--file-hash', 'linux_x86_newlib', | 17 '--file-hash', 'linux_x86_newlib', |
18 '8337d5ec327d857a49b500723ec9b792f4973abc', | 18 '8337d5ec327d857a49b500723ec9b792f4973abc', |
19 '--base-url', ('https://commondatastorage.googleapis.com/' | 19 '--base-url', ('https://commondatastorage.googleapis.com/' |
20 'nativeclient-archive2/special_chromeos'), | 20 'nativeclient-archive2/special_chromeos'), |
21 '--x86-version', '6561', | 21 '--x86-version', '6561', |
22 ] | 22 ] |
| 23 print 'NOTE: Special handling for chromeos' |
| 24 print 'Running with these argument instead:' |
| 25 print args |
23 script_dir = os.path.dirname(os.path.abspath(__file__)) | 26 script_dir = os.path.dirname(os.path.abspath(__file__)) |
24 src_dir = os.path.dirname(script_dir) | 27 src_dir = os.path.dirname(script_dir) |
25 nacl_dir = os.path.join(src_dir, 'native_client') | 28 nacl_dir = os.path.join(src_dir, 'native_client') |
26 nacl_build_dir = os.path.join(nacl_dir, 'build') | 29 nacl_build_dir = os.path.join(nacl_dir, 'build') |
27 download_script = os.path.join(nacl_build_dir, 'download_toolchains.py') | 30 download_script = os.path.join(nacl_build_dir, 'download_toolchains.py') |
28 if not os.path.exists(download_script): | 31 if not os.path.exists(download_script): |
29 print "Can't find '%s'" % download_script | 32 print "Can't find '%s'" % download_script |
30 print 'Presumably you are intentionally building without NativeClient.' | 33 print 'Presumably you are intentionally building without NativeClient.' |
31 print 'Skipping NativeClient toolchain download.' | 34 print 'Skipping NativeClient toolchain download.' |
32 sys.exit(0) | 35 sys.exit(0) |
33 sys.path.insert(0, nacl_build_dir) | 36 sys.path.insert(0, nacl_build_dir) |
34 import download_toolchains | 37 import download_toolchains |
35 download_toolchains.Main(args) | 38 download_toolchains.Main(args) |
36 | 39 |
37 | 40 |
38 if __name__ == '__main__': | 41 if __name__ == '__main__': |
39 Main(sys.argv[1:]) | 42 Main(sys.argv[1:]) |
OLD | NEW |