Chromium Code Reviews| 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 multiprocessing | 6 import multiprocessing |
| 7 import optparse | 7 import optparse |
| 8 import os | 8 import os |
| 9 import posixpath | 9 import posixpath |
| 10 import sys | 10 import sys |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 # build. | 178 # build. |
| 179 env['X86_32_CFLAGS'] = '-m32' | 179 env['X86_32_CFLAGS'] = '-m32' |
| 180 env['X86_32_CXXFLAGS'] = '-m32' | 180 env['X86_32_CXXFLAGS'] = '-m32' |
| 181 jobs = '50' | 181 jobs = '50' |
| 182 else: | 182 else: |
| 183 jobs = str(multiprocessing.cpu_count()) | 183 jobs = str(multiprocessing.cpu_count()) |
| 184 | 184 |
| 185 make_cmd = [make, '-j', jobs] | 185 make_cmd = [make, '-j', jobs] |
| 186 | 186 |
| 187 make_cmd.append('CONFIG='+config) | 187 make_cmd.append('CONFIG='+config) |
| 188 # We always ENABLE_BIONIC in case we need it. If neither --bionic nor | |
| 189 # -t bionic have been provided ont he command line, then VALID_TOOLCHAINS | |
|
binji
2014/04/02 18:35:53
on the
noelallen1
2014/04/03 17:58:52
Done.
| |
| 190 # will not contain a bionic target. | |
| 191 make_cmd.append('ENABLE_BIONIC=1') | |
| 188 if not deps: | 192 if not deps: |
| 189 make_cmd.append('IGNORE_DEPS=1') | 193 make_cmd.append('IGNORE_DEPS=1') |
| 190 | 194 |
| 191 if verbose: | 195 if verbose: |
| 192 make_cmd.append('V=1') | 196 make_cmd.append('V=1') |
| 193 | 197 |
| 194 if args: | 198 if args: |
| 195 make_cmd += args | 199 make_cmd += args |
| 196 else: | 200 else: |
| 197 make_cmd.append('TOOLCHAIN=all') | 201 make_cmd.append('TOOLCHAIN=all') |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 217 def main(argv): | 221 def main(argv): |
| 218 parser = optparse.OptionParser() | 222 parser = optparse.OptionParser() |
| 219 parser.add_option('-c', '--clobber', | 223 parser.add_option('-c', '--clobber', |
| 220 help='Clobber project directories before copying new files', | 224 help='Clobber project directories before copying new files', |
| 221 action='store_true', default=False) | 225 action='store_true', default=False) |
| 222 parser.add_option('-b', '--build', | 226 parser.add_option('-b', '--build', |
| 223 help='Build the projects.', action='store_true') | 227 help='Build the projects.', action='store_true') |
| 224 parser.add_option('--config', | 228 parser.add_option('--config', |
| 225 help='Choose configuration to build (Debug or Release). Builds both ' | 229 help='Choose configuration to build (Debug or Release). Builds both ' |
| 226 'by default') | 230 'by default') |
| 231 parser.add_option('--bionic', | |
| 232 help='Enable bionic projects', action='store_true') | |
| 227 parser.add_option('-x', '--experimental', | 233 parser.add_option('-x', '--experimental', |
| 228 help='Build experimental projects', action='store_true') | 234 help='Build experimental projects', action='store_true') |
| 229 parser.add_option('-t', '--toolchain', | 235 parser.add_option('-t', '--toolchain', |
| 230 help='Build using toolchain. Can be passed more than once.', | 236 help='Build using toolchain. Can be passed more than once.', |
| 231 action='append', default=[]) | 237 action='append', default=[]) |
| 232 parser.add_option('-d', '--dest', | 238 parser.add_option('-d', '--dest', |
| 233 help='Select which build destinations (project types) are valid.', | 239 help='Select which build destinations (project types) are valid.', |
| 234 action='append') | 240 action='append') |
| 235 parser.add_option('-v', '--verbose', action='store_true') | 241 parser.add_option('-v', '--verbose', action='store_true') |
| 236 | 242 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 252 | 258 |
| 253 pepper_ver = str(int(build_version.ChromeMajorVersion())) | 259 pepper_ver = str(int(build_version.ChromeMajorVersion())) |
| 254 pepperdir = os.path.join(OUT_DIR, 'pepper_' + pepper_ver) | 260 pepperdir = os.path.join(OUT_DIR, 'pepper_' + pepper_ver) |
| 255 | 261 |
| 256 if not options.toolchain: | 262 if not options.toolchain: |
| 257 # Order matters here: the default toolchain for an example's Makefile will | 263 # Order matters here: the default toolchain for an example's Makefile will |
| 258 # be the first toolchain in this list that is available in the example. | 264 # be the first toolchain in this list that is available in the example. |
| 259 # e.g. If an example supports newlib and glibc, then the default will be | 265 # e.g. If an example supports newlib and glibc, then the default will be |
| 260 # newlib. | 266 # newlib. |
| 261 options.toolchain = ['pnacl', 'newlib', 'glibc', 'host'] | 267 options.toolchain = ['pnacl', 'newlib', 'glibc', 'host'] |
| 262 if options.experimental: | 268 if options.experimental or options.bionic: |
| 263 options.toolchain.append('bionic') | 269 options.toolchain.append('bionic') |
| 264 | 270 |
| 265 if 'host' in options.toolchain: | 271 if 'host' in options.toolchain: |
| 266 options.toolchain.remove('host') | 272 options.toolchain.remove('host') |
| 267 options.toolchain.append(getos.GetPlatform()) | 273 options.toolchain.append(getos.GetPlatform()) |
| 268 print 'Adding platform: ' + getos.GetPlatform() | 274 print 'Adding platform: ' + getos.GetPlatform() |
| 269 | 275 |
| 270 ValidateToolchains(options.toolchain) | 276 ValidateToolchains(options.toolchain) |
| 271 | 277 |
| 272 filters = {} | 278 filters = {} |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 | 314 |
| 309 | 315 |
| 310 if __name__ == '__main__': | 316 if __name__ == '__main__': |
| 311 script_name = os.path.basename(sys.argv[0]) | 317 script_name = os.path.basename(sys.argv[0]) |
| 312 try: | 318 try: |
| 313 sys.exit(main(sys.argv)) | 319 sys.exit(main(sys.argv)) |
| 314 except parse_dsc.ValidationError as e: | 320 except parse_dsc.ValidationError as e: |
| 315 buildbot_common.ErrorExit('%s: %s' % (script_name, e)) | 321 buildbot_common.ErrorExit('%s: %s' % (script_name, e)) |
| 316 except KeyboardInterrupt: | 322 except KeyboardInterrupt: |
| 317 buildbot_common.ErrorExit('%s: interrupted' % script_name) | 323 buildbot_common.ErrorExit('%s: interrupted' % script_name) |
| OLD | NEW |