blob: 4cb8b46d105971ff8d3f1c589e978ea23ede65c3 [file] [log] [blame]
[email protected]89e43f652011-08-18 00:03:171#!/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
8import os
9import sys
10
11
[email protected]cb431922011-08-26 21:49:5812def 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]89e43f652011-08-18 00:03:1723 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]cb431922011-08-26 21:49:5835 download_toolchains.Main(args)
[email protected]89e43f652011-08-18 00:03:1736
37
38if __name__ == '__main__':
[email protected]cb431922011-08-26 21:49:5839 Main(sys.argv[1:])