Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: native_client_sdk/src/build_tools/build_projects.py

Issue 176923017: [NaCl SDK] Compile for naclio for Bionic (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix missing files Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 11 matching lines...) Expand all
22 sys.path.append(os.path.join(SDK_SRC_DIR, 'tools')) 22 sys.path.append(os.path.join(SDK_SRC_DIR, 'tools'))
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
Sam Clegg 2014/03/27 00:10:02 Extra newline here for some reason?
noelallen1 2014/03/27 18:13:48 Done.
32 VALID_TOOLCHAINS = [ 33 VALID_TOOLCHAINS = [
33 'bionic', 34 'bionic',
34 'newlib', 35 '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
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 # build. 179 # build.
179 env['X86_32_CFLAGS'] = '-m32' 180 env['X86_32_CFLAGS'] = '-m32'
180 env['X86_32_CXXFLAGS'] = '-m32' 181 env['X86_32_CXXFLAGS'] = '-m32'
181 jobs = '50' 182 jobs = '50'
182 else: 183 else:
183 jobs = str(multiprocessing.cpu_count()) 184 jobs = str(multiprocessing.cpu_count())
184 185
185 make_cmd = [make, '-j', jobs] 186 make_cmd = [make, '-j', jobs]
186 187
187 make_cmd.append('CONFIG='+config) 188 make_cmd.append('CONFIG='+config)
189 make_cmd.append('ENABLE_BIONIC=1')
Sam Clegg 2014/03/27 00:10:02 Is it OK to add this unconditionally?
noelallen1 2014/03/27 18:13:48 Yes, every project we provide overrides the VALID_
188 if not deps: 190 if not deps:
189 make_cmd.append('IGNORE_DEPS=1') 191 make_cmd.append('IGNORE_DEPS=1')
190 192
191 if verbose: 193 if verbose:
192 make_cmd.append('V=1') 194 make_cmd.append('V=1')
193 195
194 if args: 196 if args:
195 make_cmd += args 197 make_cmd += args
196 else: 198 else:
197 make_cmd.append('TOOLCHAIN=all') 199 make_cmd.append('TOOLCHAIN=all')
(...skipping 19 matching lines...) Expand all
217 def main(argv): 219 def main(argv):
218 parser = optparse.OptionParser() 220 parser = optparse.OptionParser()
219 parser.add_option('-c', '--clobber', 221 parser.add_option('-c', '--clobber',
220 help='Clobber project directories before copying new files', 222 help='Clobber project directories before copying new files',
221 action='store_true', default=False) 223 action='store_true', default=False)
222 parser.add_option('-b', '--build', 224 parser.add_option('-b', '--build',
223 help='Build the projects.', action='store_true') 225 help='Build the projects.', action='store_true')
224 parser.add_option('--config', 226 parser.add_option('--config',
225 help='Choose configuration to build (Debug or Release). Builds both ' 227 help='Choose configuration to build (Debug or Release). Builds both '
226 'by default') 228 'by default')
229 parser.add_option('--bionic',
230 help='Enable bionic projects', action='store_true')
227 parser.add_option('-x', '--experimental', 231 parser.add_option('-x', '--experimental',
228 help='Build experimental projects', action='store_true') 232 help='Build experimental projects', action='store_true')
229 parser.add_option('-t', '--toolchain', 233 parser.add_option('-t', '--toolchain',
230 help='Build using toolchain. Can be passed more than once.', 234 help='Build using toolchain. Can be passed more than once.',
231 action='append', default=[]) 235 action='append', default=[])
232 parser.add_option('-d', '--dest', 236 parser.add_option('-d', '--dest',
233 help='Select which build destinations (project types) are valid.', 237 help='Select which build destinations (project types) are valid.',
234 action='append') 238 action='append')
235 parser.add_option('-v', '--verbose', action='store_true') 239 parser.add_option('-v', '--verbose', action='store_true')
236 240
(...skipping 15 matching lines...) Expand all
252 256
253 pepper_ver = str(int(build_version.ChromeMajorVersion())) 257 pepper_ver = str(int(build_version.ChromeMajorVersion()))
254 pepperdir = os.path.join(OUT_DIR, 'pepper_' + pepper_ver) 258 pepperdir = os.path.join(OUT_DIR, 'pepper_' + pepper_ver)
255 259
256 if not options.toolchain: 260 if not options.toolchain:
257 # Order matters here: the default toolchain for an example's Makefile will 261 # 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. 262 # 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 263 # e.g. If an example supports newlib and glibc, then the default will be
260 # newlib. 264 # newlib.
261 options.toolchain = ['pnacl', 'newlib', 'glibc', 'host'] 265 options.toolchain = ['pnacl', 'newlib', 'glibc', 'host']
262 if options.experimental: 266 if options.experimental or options.bionic:
263 options.toolchain.append('bionic') 267 options.toolchain.append('bionic')
264 268
265 if 'host' in options.toolchain: 269 if 'host' in options.toolchain:
266 options.toolchain.remove('host') 270 options.toolchain.remove('host')
267 options.toolchain.append(getos.GetPlatform()) 271 options.toolchain.append(getos.GetPlatform())
268 print 'Adding platform: ' + getos.GetPlatform() 272 print 'Adding platform: ' + getos.GetPlatform()
269 273
270 ValidateToolchains(options.toolchain) 274 ValidateToolchains(options.toolchain)
271 275
272 filters = {} 276 filters = {}
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 312
309 313
310 if __name__ == '__main__': 314 if __name__ == '__main__':
311 script_name = os.path.basename(sys.argv[0]) 315 script_name = os.path.basename(sys.argv[0])
312 try: 316 try:
313 sys.exit(main(sys.argv)) 317 sys.exit(main(sys.argv))
314 except parse_dsc.ValidationError as e: 318 except parse_dsc.ValidationError as e:
315 buildbot_common.ErrorExit('%s: %s' % (script_name, e)) 319 buildbot_common.ErrorExit('%s: %s' % (script_name, e))
316 except KeyboardInterrupt: 320 except KeyboardInterrupt:
317 buildbot_common.ErrorExit('%s: interrupted' % script_name) 321 buildbot_common.ErrorExit('%s: interrupted' % script_name)
OLDNEW
« no previous file with comments | « no previous file | native_client_sdk/src/build_tools/build_sdk.py » ('j') | native_client_sdk/src/build_tools/build_sdk.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698