OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 # Exit early if disable_nacl=1. | 13 # Exit early if disable_nacl=1. |
14 if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''): | 14 if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''): |
| 15 print 'NACL is disabled. Skipping NativeClient toolchain download.' |
15 return 0 | 16 return 0 |
16 script_dir = os.path.dirname(os.path.abspath(__file__)) | 17 script_dir = os.path.dirname(os.path.abspath(__file__)) |
17 src_dir = os.path.dirname(script_dir) | 18 src_dir = os.path.dirname(script_dir) |
18 nacl_dir = os.path.join(src_dir, 'native_client') | 19 nacl_dir = os.path.join(src_dir, 'native_client') |
19 nacl_build_dir = os.path.join(nacl_dir, 'build') | 20 nacl_build_dir = os.path.join(nacl_dir, 'build') |
20 download_script = os.path.join(nacl_build_dir, 'download_toolchains.py') | 21 download_script = os.path.join(nacl_build_dir, 'download_toolchains.py') |
21 if not os.path.exists(download_script): | 22 if not os.path.exists(download_script): |
22 print "Can't find '%s'" % download_script | 23 print "Can't find '%s'" % download_script |
23 print 'Presumably you are intentionally building without NativeClient.' | 24 print 'Presumably you are intentionally building without NativeClient.' |
24 print 'Skipping NativeClient toolchain download.' | 25 print 'Skipping NativeClient toolchain download.' |
(...skipping 29 matching lines...) Expand all Loading... |
54 # a chrome location to avoid branching NaCl if just a toolchain needs | 55 # a chrome location to avoid branching NaCl if just a toolchain needs |
55 # to be bumped. | 56 # to be bumped. |
56 args.append(os.path.join(nacl_dir, 'TOOL_REVISIONS')) | 57 args.append(os.path.join(nacl_dir, 'TOOL_REVISIONS')) |
57 | 58 |
58 download_toolchains.main(args) | 59 download_toolchains.main(args) |
59 return 0 | 60 return 0 |
60 | 61 |
61 | 62 |
62 if __name__ == '__main__': | 63 if __name__ == '__main__': |
63 sys.exit(Main(sys.argv[1:])) | 64 sys.exit(Main(sys.argv[1:])) |
OLD | NEW |