OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 import argparse | 6 import argparse |
7 import multiprocessing | 7 import multiprocessing |
8 import os | 8 import os |
9 import posixpath | 9 import posixpath |
10 import sys | 10 import sys |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 MAKE = 'nacl_sdk/make_3.99.90-26-gf80222c/make.exe' | 26 MAKE = 'nacl_sdk/make_3.99.90-26-gf80222c/make.exe' |
27 LIB_DICT = { | 27 LIB_DICT = { |
28 'linux': [], | 28 'linux': [], |
29 'mac': [], | 29 'mac': [], |
30 'win': ['x86_32'] | 30 'win': ['x86_32'] |
31 } | 31 } |
32 VALID_TOOLCHAINS = [ | 32 VALID_TOOLCHAINS = [ |
33 'bionic', | 33 'bionic', |
34 'newlib', | 34 'newlib', |
| 35 'clang-newlib', |
35 'glibc', | 36 'glibc', |
36 'pnacl', | 37 'pnacl', |
37 'win', | 38 'win', |
38 'linux', | 39 'linux', |
39 'mac', | 40 'mac', |
40 ] | 41 ] |
41 | 42 |
42 # Global verbosity setting. | 43 # Global verbosity setting. |
43 # If set to True (normally via a command line arg) then build_projects will | 44 # If set to True (normally via a command line arg) then build_projects will |
44 # add V=1 to all calls to 'make' | 45 # add V=1 to all calls to 'make' |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 with open(make_exe, 'wb') as f: | 93 with open(make_exe, 'wb') as f: |
93 f.write(urllib2.urlopen(make_url).read()) | 94 f.write(urllib2.urlopen(make_url).read()) |
94 | 95 |
95 | 96 |
96 def ValidateToolchains(toolchains): | 97 def ValidateToolchains(toolchains): |
97 invalid_toolchains = set(toolchains) - set(VALID_TOOLCHAINS) | 98 invalid_toolchains = set(toolchains) - set(VALID_TOOLCHAINS) |
98 if invalid_toolchains: | 99 if invalid_toolchains: |
99 buildbot_common.ErrorExit('Invalid toolchain(s): %s' % ( | 100 buildbot_common.ErrorExit('Invalid toolchain(s): %s' % ( |
100 ', '.join(invalid_toolchains))) | 101 ', '.join(invalid_toolchains))) |
101 | 102 |
| 103 |
102 def GetDeps(projects): | 104 def GetDeps(projects): |
103 out = {} | 105 out = {} |
104 | 106 |
105 # Build list of all project names | 107 # Build list of all project names |
106 localtargets = [proj['NAME'] for proj in projects] | 108 localtargets = [proj['NAME'] for proj in projects] |
107 | 109 |
108 # For each project | 110 # For each project |
109 for proj in projects: | 111 for proj in projects: |
110 deplist = [] | 112 deplist = [] |
111 # generate a list of dependencies | 113 # generate a list of dependencies |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 del os.environ['NACL_SDK_ROOT'] | 293 del os.environ['NACL_SDK_ROOT'] |
292 | 294 |
293 pepper_ver = str(int(build_version.ChromeMajorVersion())) | 295 pepper_ver = str(int(build_version.ChromeMajorVersion())) |
294 pepperdir = os.path.join(OUT_DIR, 'pepper_' + pepper_ver) | 296 pepperdir = os.path.join(OUT_DIR, 'pepper_' + pepper_ver) |
295 | 297 |
296 if not options.toolchain: | 298 if not options.toolchain: |
297 # Order matters here: the default toolchain for an example's Makefile will | 299 # Order matters here: the default toolchain for an example's Makefile will |
298 # be the first toolchain in this list that is available in the example. | 300 # be the first toolchain in this list that is available in the example. |
299 # e.g. If an example supports newlib and glibc, then the default will be | 301 # e.g. If an example supports newlib and glibc, then the default will be |
300 # newlib. | 302 # newlib. |
301 options.toolchain = ['pnacl', 'newlib', 'glibc', 'host'] | 303 options.toolchain = ['pnacl', 'newlib', 'glibc', 'host', 'clang-newlib'] |
302 if options.experimental or options.bionic: | 304 if options.experimental or options.bionic: |
303 options.toolchain.append('bionic') | 305 options.toolchain.append('bionic') |
304 | 306 |
305 if 'host' in options.toolchain: | 307 if 'host' in options.toolchain: |
306 options.toolchain.remove('host') | 308 options.toolchain.remove('host') |
307 options.toolchain.append(getos.GetPlatform()) | 309 options.toolchain.append(getos.GetPlatform()) |
308 Trace('Adding platform: ' + getos.GetPlatform()) | 310 Trace('Adding platform: ' + getos.GetPlatform()) |
309 | 311 |
310 ValidateToolchains(options.toolchain) | 312 ValidateToolchains(options.toolchain) |
311 | 313 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 | 348 |
347 | 349 |
348 if __name__ == '__main__': | 350 if __name__ == '__main__': |
349 script_name = os.path.basename(sys.argv[0]) | 351 script_name = os.path.basename(sys.argv[0]) |
350 try: | 352 try: |
351 sys.exit(main(sys.argv[1:])) | 353 sys.exit(main(sys.argv[1:])) |
352 except parse_dsc.ValidationError as e: | 354 except parse_dsc.ValidationError as e: |
353 buildbot_common.ErrorExit('%s: %s' % (script_name, e)) | 355 buildbot_common.ErrorExit('%s: %s' % (script_name, e)) |
354 except KeyboardInterrupt: | 356 except KeyboardInterrupt: |
355 buildbot_common.ErrorExit('%s: interrupted' % script_name) | 357 buildbot_common.ErrorExit('%s: interrupted' % script_name) |
OLD | NEW |