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

Side by Side Diff: SConstruct

Issue 11564: Added support for building V8 on Windows with either the shared or static ver... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years, 1 month 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
« no previous file with comments | « no previous file | src/dtoa-config.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2008 the V8 project authors. All rights reserved. 1 # Copyright 2008 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 'DIALECTFLAGS': ['/nologo'], 64 'DIALECTFLAGS': ['/nologo'],
65 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], 65 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
66 'CXXFLAGS': ['$CCFLAGS', '/GR-', '/Gy'], 66 'CXXFLAGS': ['$CCFLAGS', '/GR-', '/Gy'],
67 'CPPDEFINES': ['WIN32', '_USE_32BIT_TIME_T', 'PCRE_STATIC'], 67 'CPPDEFINES': ['WIN32', '_USE_32BIT_TIME_T', 'PCRE_STATIC'],
68 'LINKFLAGS': ['/NOLOGO', '/MACHINE:X86', '/INCREMENTAL:NO', 68 'LINKFLAGS': ['/NOLOGO', '/MACHINE:X86', '/INCREMENTAL:NO',
69 '/NXCOMPAT', '/IGNORE:4221'], 69 '/NXCOMPAT', '/IGNORE:4221'],
70 'ARFLAGS': ['/NOLOGO'], 70 'ARFLAGS': ['/NOLOGO'],
71 'CCPDBFLAGS': ['/Zi'] 71 'CCPDBFLAGS': ['/Zi']
72 }, 72 },
73 'mode:debug': { 73 'mode:debug': {
74 'CCFLAGS': ['/Od', '/Gm', '/MTd'], 74 'CCFLAGS': ['/Od', '/Gm'],
75 'CPPDEFINES': ['_DEBUG', 'ENABLE_DISASSEMBLER', 'DEBUG'], 75 'CPPDEFINES': ['_DEBUG', 'ENABLE_DISASSEMBLER', 'DEBUG'],
76 'LINKFLAGS': ['/DEBUG'] 76 'LINKFLAGS': ['/DEBUG'],
77 'msvcrt:static': {
78 'CCFLAGS': ['/MTd']
79 },
80 'msvcrt:shared': {
81 'CCFLAGS': ['/MDd']
82 }
77 }, 83 },
78 'mode:release': { 84 'mode:release': {
79 'CCFLAGS': ['/O2', '/MT', '/GL'], 85 'CCFLAGS': ['/O2', '/GL'],
80 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF', '/LTCG'], 86 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF', '/LTCG'],
81 'ARFLAGS': ['/LTCG'] 87 'ARFLAGS': ['/LTCG'],
82 } 88 'msvcrt:static': {
89 'CCFLAGS': ['/MT']
90 },
91 'msvcrt:shared': {
92 'CCFLAGS': ['/MD']
93 }
94 },
83 } 95 }
84 } 96 }
85 97
86 98
87 V8_EXTRA_FLAGS = { 99 V8_EXTRA_FLAGS = {
88 'gcc': { 100 'gcc': {
89 'all': { 101 'all': {
90 'CXXFLAGS': [], #['-fvisibility=hidden'], 102 'CXXFLAGS': [], #['-fvisibility=hidden'],
91 'WARNINGFLAGS': ['-pedantic', '-Wall', '-Werror', '-W', 103 'WARNINGFLAGS': ['-pedantic', '-Wall', '-Werror', '-W',
92 '-Wno-unused-parameter'] 104 '-Wno-unused-parameter']
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 'CCFLAGS': ['/nologo'], 214 'CCFLAGS': ['/nologo'],
203 'LINKFLAGS': ['/nologo'], 215 'LINKFLAGS': ['/nologo'],
204 }, 216 },
205 'library:shared': { 217 'library:shared': {
206 'CPPDEFINES': ['USING_V8_SHARED'] 218 'CPPDEFINES': ['USING_V8_SHARED']
207 }, 219 },
208 'prof:on': { 220 'prof:on': {
209 'LINKFLAGS': ['/MAP'] 221 'LINKFLAGS': ['/MAP']
210 }, 222 },
211 'mode:release': { 223 'mode:release': {
212 'CCFLAGS': ['/O2', '/MT'], 224 'CCFLAGS': ['/O2'],
213 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF', '/LTCG'] 225 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF', '/LTCG'],
226 'msvcrt:static': {
227 'CCFLAGS': ['/MT']
228 },
229 'msvcrt:shared': {
230 'CCFLAGS': ['/MD']
231 }
214 }, 232 },
215 'mode:debug': { 233 'mode:debug': {
216 'CCFLAGS': ['/Od', '/MTd'], 234 'CCFLAGS': ['/Od'],
217 'LINKFLAGS': ['/DEBUG'] 235 'LINKFLAGS': ['/DEBUG'],
236 'msvcrt:static': {
237 'CCFLAGS': ['/MTd']
238 },
239 'msvcrt:shared': {
240 'CCFLAGS': ['/MDd']
241 }
218 } 242 }
219 } 243 }
220 } 244 }
221 245
222 246
223 D8_FLAGS = { 247 D8_FLAGS = {
224 'gcc': { 248 'gcc': {
225 'console:readline': { 249 'console:readline': {
226 'LIBS': ['readline'] 250 'LIBS': ['readline']
227 } 251 }
228 }, 252 },
229 'msvc': { }
230 } 253 }
231 254
232 255
233 SUFFIXES = { 256 SUFFIXES = {
234 'release': '', 257 'release': '',
235 'debug': '_g' 258 'debug': '_g'
236 } 259 }
237 260
238 261
239 def Abort(message): 262 def Abort(message):
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 'prof': { 304 'prof': {
282 'values': ['on', 'off'], 305 'values': ['on', 'off'],
283 'default': 'off', 306 'default': 'off',
284 'help': 'enable profiling of build target' 307 'help': 'enable profiling of build target'
285 }, 308 },
286 'library': { 309 'library': {
287 'values': ['static', 'shared'], 310 'values': ['static', 'shared'],
288 'default': 'static', 311 'default': 'static',
289 'help': 'the type of library to produce' 312 'help': 'the type of library to produce'
290 }, 313 },
314 'msvcrt': {
315 'values': ['static', 'shared'],
316 'default': 'static',
317 'help': 'the type of MSVCRT library to use'
318 },
291 'wordsize': { 319 'wordsize': {
292 'values': ['64', '32'], 320 'values': ['64', '32'],
293 'default': WORDSIZE_GUESS, 321 'default': WORDSIZE_GUESS,
294 'help': 'the word size' 322 'help': 'the word size'
295 }, 323 },
296 'simulator': { 324 'simulator': {
297 'values': ['arm', 'none'], 325 'values': ['arm', 'none'],
298 'default': 'none', 326 'default': 'none',
299 'help': 'build with simulator' 327 'help': 'build with simulator'
300 }, 328 },
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 self.options = options 396 self.options = options
369 self.env_overrides = env_overrides 397 self.env_overrides = env_overrides
370 self.samples = samples 398 self.samples = samples
371 self.use_snapshot = (options['snapshot'] == 'on') 399 self.use_snapshot = (options['snapshot'] == 'on')
372 self.flags = None 400 self.flags = None
373 401
374 def AddRelevantFlags(self, initial, flags): 402 def AddRelevantFlags(self, initial, flags):
375 result = initial.copy() 403 result = initial.copy()
376 self.AppendFlags(result, flags.get('all')) 404 self.AppendFlags(result, flags.get('all'))
377 toolchain = self.options['toolchain'] 405 toolchain = self.options['toolchain']
378 self.AppendFlags(result, flags[toolchain].get('all')) 406 if toolchain in flags:
407 self.AppendFlags(result, flags[toolchain].get('all'))
408 for option in sorted(self.options.keys()):
409 value = self.options[option]
410 self.AppendFlags(result, flags[toolchain].get(option + ':' + value))
411 return result
412
413 def AddRelevantSubFlags(self, options, flags):
414 self.AppendFlags(options, flags.get('all'))
379 for option in sorted(self.options.keys()): 415 for option in sorted(self.options.keys()):
380 value = self.options[option] 416 value = self.options[option]
381 self.AppendFlags(result, flags[toolchain].get(option + ':' + value)) 417 self.AppendFlags(options, flags.get(option + ':' + value))
382 return result
383 418
384 def GetRelevantSources(self, source): 419 def GetRelevantSources(self, source):
385 result = [] 420 result = []
386 result += source.get('all', []) 421 result += source.get('all', [])
387 for (name, value) in self.options.iteritems(): 422 for (name, value) in self.options.iteritems():
388 result += source.get(name + ':' + value, []) 423 result += source.get(name + ':' + value, [])
389 return sorted(result) 424 return sorted(result)
390 425
391 def AppendFlags(self, options, added): 426 def AppendFlags(self, options, added):
392 if not added: 427 if not added:
393 return 428 return
394 for (key, value) in added.iteritems(): 429 for (key, value) in added.iteritems():
395 if not key in options: 430 if key.find(':') != -1:
396 options[key] = value 431 self.AddRelevantSubFlags(options, { key: value })
397 else: 432 else:
398 prefix = options[key] 433 if not key in options:
399 if isinstance(prefix, StringTypes): prefix = prefix.split() 434 options[key] = value
400 options[key] = prefix + value 435 else:
436 prefix = options[key]
437 if isinstance(prefix, StringTypes): prefix = prefix.split()
438 options[key] = prefix + value
401 439
402 def ConfigureObject(self, env, input, **kw): 440 def ConfigureObject(self, env, input, **kw):
403 if self.options['library'] == 'static': 441 if self.options['library'] == 'static':
404 return env.StaticObject(input, **kw) 442 return env.StaticObject(input, **kw)
405 else: 443 else:
406 return env.SharedObject(input, **kw) 444 return env.SharedObject(input, **kw)
407 445
408 def ApplyEnvOverrides(self, env): 446 def ApplyEnvOverrides(self, env):
409 if not self.env_overrides: 447 if not self.env_overrides:
410 return 448 return
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 # version of scons. Also, there's a bug in some revisions that 591 # version of scons. Also, there's a bug in some revisions that
554 # doesn't allow this flag to be set, so we swallow any exceptions. 592 # doesn't allow this flag to be set, so we swallow any exceptions.
555 # Lovely. 593 # Lovely.
556 try: 594 try:
557 SetOption('warn', 'no-deprecated') 595 SetOption('warn', 'no-deprecated')
558 except: 596 except:
559 pass 597 pass
560 598
561 599
562 Build() 600 Build()
OLDNEW
« no previous file with comments | « no previous file | src/dtoa-config.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698