[email protected] | 89e43f65 | 2011-08-18 00:03:17 | [diff] [blame] | 1 | #!/usr/bin/python |
| 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 |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | """Shim to run nacl toolchain download script only if there is a nacl dir.""" |
| 7 | |
| 8 | import os |
| 9 | import sys |
| 10 | |
| 11 | |
[email protected] | cb43192 | 2011-08-26 21:49:58 | [diff] [blame^] | 12 | def Main(args): |
| 13 | # Handle chromeos=1 specially (until its building its own toolchain). |
| 14 | if 'chromeos=1' in os.environ.get('GYP_DEFINES', ''): |
| 15 | args = [ |
| 16 | '--nacl-newlib-only', |
| 17 | '--file-hash', 'linux_x86_newlib', |
| 18 | '8337d5ec327d857a49b500723ec9b792f4973abc', |
| 19 | '--base-url', ('https://commondatastorage.googleapis.com/' |
| 20 | 'nativeclient-archive2/special_chromeos'), |
| 21 | '--x86-version', '6561', |
| 22 | ] |
[email protected] | 89e43f65 | 2011-08-18 00:03:17 | [diff] [blame] | 23 | script_dir = os.path.dirname(os.path.abspath(__file__)) |
| 24 | src_dir = os.path.dirname(script_dir) |
| 25 | nacl_dir = os.path.join(src_dir, 'native_client') |
| 26 | nacl_build_dir = os.path.join(nacl_dir, 'build') |
| 27 | download_script = os.path.join(nacl_build_dir, 'download_toolchains.py') |
| 28 | if not os.path.exists(download_script): |
| 29 | print "Can't find '%s'" % download_script |
| 30 | print 'Presumably you are intentionally building without NativeClient.' |
| 31 | print 'Skipping NativeClient toolchain download.' |
| 32 | sys.exit(0) |
| 33 | sys.path.insert(0, nacl_build_dir) |
| 34 | import download_toolchains |
[email protected] | cb43192 | 2011-08-26 21:49:58 | [diff] [blame^] | 35 | download_toolchains.Main(args) |
[email protected] | 89e43f65 | 2011-08-18 00:03:17 | [diff] [blame] | 36 | |
| 37 | |
| 38 | if __name__ == '__main__': |
[email protected] | cb43192 | 2011-08-26 21:49:58 | [diff] [blame^] | 39 | Main(sys.argv[1:]) |