| 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 12 matching lines...) Expand all Loading... |
| 23 import getos | 23 import getos |
| 24 | 24 |
| 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', | |
| 34 'newlib', | 33 'newlib', |
| 35 'clang-newlib', | 34 'clang-newlib', |
| 36 'glibc', | 35 'glibc', |
| 37 'pnacl', | 36 'pnacl', |
| 38 'win', | 37 'win', |
| 39 'linux', | 38 'linux', |
| 40 'mac', | 39 'mac', |
| 41 ] | 40 ] |
| 42 | 41 |
| 43 # Global verbosity setting. | 42 # Global verbosity setting. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 # build. | 205 # build. |
| 207 env['X86_32_CFLAGS'] = '-m32' | 206 env['X86_32_CFLAGS'] = '-m32' |
| 208 env['X86_32_CXXFLAGS'] = '-m32' | 207 env['X86_32_CXXFLAGS'] = '-m32' |
| 209 jobs = '50' | 208 jobs = '50' |
| 210 else: | 209 else: |
| 211 jobs = str(multiprocessing.cpu_count()) | 210 jobs = str(multiprocessing.cpu_count()) |
| 212 | 211 |
| 213 make_cmd = [make, '-j', jobs] | 212 make_cmd = [make, '-j', jobs] |
| 214 | 213 |
| 215 make_cmd.append('CONFIG='+config) | 214 make_cmd.append('CONFIG='+config) |
| 216 # We always ENABLE_BIONIC in case we need it. If neither --bionic nor | |
| 217 # -t bionic have been provided on the command line, then VALID_TOOLCHAINS | |
| 218 # will not contain a bionic target. | |
| 219 make_cmd.append('ENABLE_BIONIC=1') | |
| 220 if not deps: | 215 if not deps: |
| 221 make_cmd.append('IGNORE_DEPS=1') | 216 make_cmd.append('IGNORE_DEPS=1') |
| 222 | 217 |
| 223 if verbose: | 218 if verbose: |
| 224 make_cmd.append('V=1') | 219 make_cmd.append('V=1') |
| 225 | 220 |
| 226 if args: | 221 if args: |
| 227 make_cmd += args | 222 make_cmd += args |
| 228 else: | 223 else: |
| 229 make_cmd.append('TOOLCHAIN=all') | 224 make_cmd.append('TOOLCHAIN=all') |
| (...skipping 19 matching lines...) Expand all Loading... |
| 249 parser = argparse.ArgumentParser(description=__doc__) | 244 parser = argparse.ArgumentParser(description=__doc__) |
| 250 parser.add_argument('-c', '--clobber', | 245 parser.add_argument('-c', '--clobber', |
| 251 help='Clobber project directories before copying new files', | 246 help='Clobber project directories before copying new files', |
| 252 action='store_true', default=False) | 247 action='store_true', default=False) |
| 253 parser.add_argument('-b', '--build', | 248 parser.add_argument('-b', '--build', |
| 254 help='Build the projects. Otherwise the projects are only copied.', | 249 help='Build the projects. Otherwise the projects are only copied.', |
| 255 action='store_true') | 250 action='store_true') |
| 256 parser.add_argument('--config', | 251 parser.add_argument('--config', |
| 257 help='Choose configuration to build (Debug or Release). Builds both ' | 252 help='Choose configuration to build (Debug or Release). Builds both ' |
| 258 'by default') | 253 'by default') |
| 259 parser.add_argument('--bionic', | |
| 260 help='Enable bionic projects', action='store_true') | |
| 261 parser.add_argument('-x', '--experimental', | 254 parser.add_argument('-x', '--experimental', |
| 262 help='Build experimental projects', action='store_true') | 255 help='Build experimental projects', action='store_true') |
| 263 parser.add_argument('-t', '--toolchain', | 256 parser.add_argument('-t', '--toolchain', |
| 264 help='Build using toolchain. Can be passed more than once.', | 257 help='Build using toolchain. Can be passed more than once.', |
| 265 action='append', default=[]) | 258 action='append', default=[]) |
| 266 parser.add_argument('-d', '--dest', | 259 parser.add_argument('-d', '--dest', |
| 267 help='Select which build destinations (project types) are valid.', | 260 help='Select which build destinations (project types) are valid.', |
| 268 action='append') | 261 action='append') |
| 269 parser.add_argument('projects', nargs='*', | 262 parser.add_argument('projects', nargs='*', |
| 270 help='Select which projects to build.') | 263 help='Select which projects to build.') |
| (...skipping 23 matching lines...) Expand all Loading... |
| 294 | 287 |
| 295 pepper_ver = str(int(build_version.ChromeMajorVersion())) | 288 pepper_ver = str(int(build_version.ChromeMajorVersion())) |
| 296 pepperdir = os.path.join(OUT_DIR, 'pepper_' + pepper_ver) | 289 pepperdir = os.path.join(OUT_DIR, 'pepper_' + pepper_ver) |
| 297 | 290 |
| 298 if not options.toolchain: | 291 if not options.toolchain: |
| 299 # Order matters here: the default toolchain for an example's Makefile will | 292 # Order matters here: the default toolchain for an example's Makefile will |
| 300 # be the first toolchain in this list that is available in the example. | 293 # be the first toolchain in this list that is available in the example. |
| 301 # e.g. If an example supports newlib and glibc, then the default will be | 294 # e.g. If an example supports newlib and glibc, then the default will be |
| 302 # newlib. | 295 # newlib. |
| 303 options.toolchain = ['pnacl', 'newlib', 'glibc', 'host', 'clang-newlib'] | 296 options.toolchain = ['pnacl', 'newlib', 'glibc', 'host', 'clang-newlib'] |
| 304 if options.experimental or options.bionic: | |
| 305 options.toolchain.append('bionic') | |
| 306 | 297 |
| 307 if 'host' in options.toolchain: | 298 if 'host' in options.toolchain: |
| 308 options.toolchain.remove('host') | 299 options.toolchain.remove('host') |
| 309 options.toolchain.append(getos.GetPlatform()) | 300 options.toolchain.append(getos.GetPlatform()) |
| 310 Trace('Adding platform: ' + getos.GetPlatform()) | 301 Trace('Adding platform: ' + getos.GetPlatform()) |
| 311 | 302 |
| 312 ValidateToolchains(options.toolchain) | 303 ValidateToolchains(options.toolchain) |
| 313 | 304 |
| 314 filters = {} | 305 filters = {} |
| 315 if options.toolchain: | 306 if options.toolchain: |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 | 339 |
| 349 | 340 |
| 350 if __name__ == '__main__': | 341 if __name__ == '__main__': |
| 351 script_name = os.path.basename(sys.argv[0]) | 342 script_name = os.path.basename(sys.argv[0]) |
| 352 try: | 343 try: |
| 353 sys.exit(main(sys.argv[1:])) | 344 sys.exit(main(sys.argv[1:])) |
| 354 except parse_dsc.ValidationError as e: | 345 except parse_dsc.ValidationError as e: |
| 355 buildbot_common.ErrorExit('%s: %s' % (script_name, e)) | 346 buildbot_common.ErrorExit('%s: %s' % (script_name, e)) |
| 356 except KeyboardInterrupt: | 347 except KeyboardInterrupt: |
| 357 buildbot_common.ErrorExit('%s: interrupted' % script_name) | 348 buildbot_common.ErrorExit('%s: interrupted' % script_name) |
| OLD | NEW |