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

Side by Side Diff: SConstruct

Issue 99186: Create build structure for X64. (Closed)
Patch Set: Created 11 years, 7 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
« no previous file with comments | « no previous file | src/SConscript » ('j') | src/SConscript » ('J')
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 'CXXFLAGS': ['-DWIN32'], 124 'CXXFLAGS': ['-DWIN32'],
125 }, 125 },
126 'os:android': { 126 'os:android': {
127 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__', 127 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__',
128 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], 128 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'],
129 'CCFLAGS': ANDROID_FLAGS, 129 'CCFLAGS': ANDROID_FLAGS,
130 'WARNINGFLAGS': ['-Wall', '-Wno-unused', '-Werror=return-type', 130 'WARNINGFLAGS': ['-Wall', '-Wno-unused', '-Werror=return-type',
131 '-Wstrict-aliasing=2'], 131 '-Wstrict-aliasing=2'],
132 'CPPPATH': ANDROID_INCLUDES, 132 'CPPPATH': ANDROID_INCLUDES,
133 }, 133 },
134 'wordsize:32': {
135 'CCFLAGS': ['-m32'],
136 'CPPDEFINES': ['ILP32'],
137 'LINKFLAGS': ['-m32']
138 },
134 'wordsize:64': { 139 'wordsize:64': {
135 'CCFLAGS': ['-m32'], 140 'CCFLAGS': ['-m64'],
136 'LINKFLAGS': ['-m32'] 141 'CPPDEFINES': ['LP64'],
142 'LINKFLAGS': ['-m64']
143 },
144 'arch:ia32': {
145 'CPPDEFINES': ['V8_ARCH_IA32']
146 },
147 'arch:arm': {
148 'CPPDEFINES': ['V8_ARCH_ARM']
149 },
150 'arch:x64': {
151 'CPPDEFINES': ['V8_ARCH_X64']
137 }, 152 },
138 'prof:oprofile': { 153 'prof:oprofile': {
139 'CPPDEFINES': ['ENABLE_OPROFILE_AGENT'] 154 'CPPDEFINES': ['ENABLE_OPROFILE_AGENT']
140 } 155 },
Mads Ager (chromium) 2009/04/29 12:27:24 Is this comma needed?
Lasse Reichstein 2009/04/29 13:05:41 Not needed. I would prefer to have it everywhere (
141 }, 156 },
142 'msvc': { 157 'msvc': {
143 'all': { 158 'all': {
144 'DIALECTFLAGS': ['/nologo'], 159 'DIALECTFLAGS': ['/nologo'],
145 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], 160 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
146 'CXXFLAGS': ['$CCFLAGS', '/GR-', '/Gy'], 161 'CXXFLAGS': ['$CCFLAGS', '/GR-', '/Gy'],
147 'CPPDEFINES': ['WIN32', '_USE_32BIT_TIME_T'], 162 'CPPDEFINES': ['WIN32', '_USE_32BIT_TIME_T'],
148 'LINKFLAGS': ['/NOLOGO', '/MACHINE:X86', '/INCREMENTAL:NO', 163 'LINKFLAGS': ['/NOLOGO', '/MACHINE:X86', '/INCREMENTAL:NO',
149 '/NXCOMPAT', '/IGNORE:4221'], 164 '/NXCOMPAT', '/IGNORE:4221'],
150 'ARFLAGS': ['/NOLOGO'], 165 'ARFLAGS': ['/NOLOGO'],
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 V8_EXTRA_FLAGS = { 198 V8_EXTRA_FLAGS = {
184 'gcc': { 199 'gcc': {
185 'all': { 200 'all': {
186 'CXXFLAGS': [], #['-fvisibility=hidden'], 201 'CXXFLAGS': [], #['-fvisibility=hidden'],
187 'WARNINGFLAGS': ['-Wall', '-Werror', '-W', 202 'WARNINGFLAGS': ['-Wall', '-Werror', '-W',
188 '-Wno-unused-parameter'] 203 '-Wno-unused-parameter']
189 }, 204 },
190 'arch:arm': { 205 'arch:arm': {
191 'CPPDEFINES': ['ARM'] 206 'CPPDEFINES': ['ARM']
192 }, 207 },
193 'arch:android': { 208 'os:android': {
194 'CPPDEFINES': ['ARM'] 209 'CPPDEFINES': ['ARM']
195 }, 210 },
196 'os:win32': { 211 'os:win32': {
197 'WARNINGFLAGS': ['-pedantic', '-Wno-long-long'] 212 'WARNINGFLAGS': ['-pedantic', '-Wno-long-long']
198 }, 213 },
199 'os:linux': { 214 'os:linux': {
200 'WARNINGFLAGS': ['-pedantic'] 215 'WARNINGFLAGS': ['-pedantic']
201 }, 216 },
202 'os:macos': { 217 'os:macos': {
203 'WARNINGFLAGS': ['-pedantic'] 218 'WARNINGFLAGS': ['-pedantic']
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], 306 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'],
292 'CCFLAGS': ANDROID_FLAGS, 307 'CCFLAGS': ANDROID_FLAGS,
293 'CPPPATH': ANDROID_INCLUDES, 308 'CPPPATH': ANDROID_INCLUDES,
294 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'], 309 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'],
295 'LINKFLAGS': ANDROID_LINKFLAGS, 310 'LINKFLAGS': ANDROID_LINKFLAGS,
296 'LIBS': ['c', 'stdc++', 'm'], 311 'LIBS': ['c', 'stdc++', 'm'],
297 'mode:release': { 312 'mode:release': {
298 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] 313 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
299 } 314 }
300 }, 315 },
316 'wordsize:32': {
317 'CCFLAGS': ['-m32'],
318 'CPPDEFINES': ['ILP32'],
319 'LINKFLAGS': ['-m32']
320 },
301 'wordsize:64': { 321 'wordsize:64': {
302 'CCFLAGS': ['-m32'], 322 'CCFLAGS': ['-m64'],
303 'LINKFLAGS': ['-m32'] 323 'CPPDEFINES': ['LP64'],
324 'LINKFLAGS': ['-m64']
304 }, 325 },
305 }, 326 },
306 'msvc': { 327 'msvc': {
307 'all': { 328 'all': {
308 'CPPDEFINES': ['_HAS_EXCEPTIONS=0'], 329 'CPPDEFINES': ['_HAS_EXCEPTIONS=0'],
309 'LIBS': ['winmm', 'ws2_32'] 330 'LIBS': ['winmm', 'ws2_32']
310 }, 331 },
311 'library:shared': { 332 'library:shared': {
312 'CPPDEFINES': ['USING_V8_SHARED'] 333 'CPPDEFINES': ['USING_V8_SHARED']
313 } 334 }
(...skipping 28 matching lines...) Expand all
342 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], 363 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'],
343 'CCFLAGS': ANDROID_FLAGS, 364 'CCFLAGS': ANDROID_FLAGS,
344 'CPPPATH': ANDROID_INCLUDES, 365 'CPPPATH': ANDROID_INCLUDES,
345 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'], 366 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'],
346 'LINKFLAGS': ANDROID_LINKFLAGS, 367 'LINKFLAGS': ANDROID_LINKFLAGS,
347 'LIBS': ['c', 'stdc++', 'm'], 368 'LIBS': ['c', 'stdc++', 'm'],
348 'mode:release': { 369 'mode:release': {
349 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] 370 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
350 } 371 }
351 }, 372 },
373 'wordsize:32': {
374 'CCFLAGS': ['-m32'],
375 'CPPDEFINES': ['ILP32'],
376 'LINKFLAGS': ['-m32']
377 },
352 'wordsize:64': { 378 'wordsize:64': {
353 'CCFLAGS': ['-m32'], 379 'CCFLAGS': ['-m64'],
354 'LINKFLAGS': ['-m32'] 380 'CPPDEFINES': ['LP64'],
381 'LINKFLAGS': ['-m64']
355 }, 382 },
356 'mode:release': { 383 'mode:release': {
357 'CCFLAGS': ['-O2'] 384 'CCFLAGS': ['-O2']
358 }, 385 },
359 'mode:debug': { 386 'mode:debug': {
360 'CCFLAGS': ['-g', '-O0'] 387 'CCFLAGS': ['-g', '-O0']
361 }, 388 },
362 'prof:oprofile': { 389 'prof:oprofile': {
363 'LIBPATH': ['/usr/lib32', '/usr/lib32/oprofile'], 390 'LIBPATH': ['/usr/lib32', '/usr/lib32/oprofile'],
364 'LIBS': ['opagent'] 391 'LIBS': ['opagent']
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 OS_GUESS = utils.GuessOS() 486 OS_GUESS = utils.GuessOS()
460 TOOLCHAIN_GUESS = GuessToolchain(OS_GUESS) 487 TOOLCHAIN_GUESS = GuessToolchain(OS_GUESS)
461 ARCH_GUESS = utils.GuessArchitecture() 488 ARCH_GUESS = utils.GuessArchitecture()
462 WORDSIZE_GUESS = utils.GuessWordsize() 489 WORDSIZE_GUESS = utils.GuessWordsize()
463 490
464 491
465 SIMPLE_OPTIONS = { 492 SIMPLE_OPTIONS = {
466 'toolchain': { 493 'toolchain': {
467 'values': ['gcc', 'msvc'], 494 'values': ['gcc', 'msvc'],
468 'default': TOOLCHAIN_GUESS, 495 'default': TOOLCHAIN_GUESS,
469 'help': 'the toolchain to use' 496 'help': 'the toolchain to use (' + TOOLCHAIN_GUESS + ')'
470 }, 497 },
471 'os': { 498 'os': {
472 'values': ['freebsd', 'linux', 'macos', 'win32', 'android'], 499 'values': ['freebsd', 'linux', 'macos', 'win32', 'android'],
473 'default': OS_GUESS, 500 'default': OS_GUESS,
474 'help': 'the os to build for' 501 'help': 'the os to build for (' + OS_GUESS + ')'
475 }, 502 },
476 'arch': { 503 'arch': {
477 'values':['arm', 'ia32'], 504 'values':['arm', 'ia32', 'x64'],
478 'default': ARCH_GUESS, 505 'default': ARCH_GUESS,
479 'help': 'the architecture to build for' 506 'help': 'the architecture to build for (' + ARCH_GUESS + ')'
480 }, 507 },
481 'snapshot': { 508 'snapshot': {
482 'values': ['on', 'off', 'nobuild'], 509 'values': ['on', 'off', 'nobuild'],
483 'default': 'off', 510 'default': 'off',
484 'help': 'build using snapshots for faster start-up' 511 'help': 'build using snapshots for faster start-up'
485 }, 512 },
486 'prof': { 513 'prof': {
487 'values': ['on', 'off', 'oprofile'], 514 'values': ['on', 'off', 'oprofile'],
488 'default': 'off', 515 'default': 'off',
489 'help': 'enable profiling of build target' 516 'help': 'enable profiling of build target'
490 }, 517 },
491 'library': { 518 'library': {
492 'values': ['static', 'shared'], 519 'values': ['static', 'shared'],
493 'default': 'static', 520 'default': 'static',
494 'help': 'the type of library to produce' 521 'help': 'the type of library to produce'
495 }, 522 },
496 'msvcrt': { 523 'msvcrt': {
497 'values': ['static', 'shared'], 524 'values': ['static', 'shared'],
498 'default': 'static', 525 'default': 'static',
499 'help': 'the type of Microsoft Visual C++ runtime library to use' 526 'help': 'the type of Microsoft Visual C++ runtime library to use'
500 }, 527 },
501 'msvcltcg': { 528 'msvcltcg': {
502 'values': ['on', 'off'], 529 'values': ['on', 'off'],
503 'default': 'on', 530 'default': 'on',
504 'help': 'use Microsoft Visual C++ link-time code generation' 531 'help': 'use Microsoft Visual C++ link-time code generation'
505 }, 532 },
506 'wordsize': { 533 'wordsize': {
507 'values': ['64', '32'], 534 'values': ['64', '32'],
508 'default': WORDSIZE_GUESS, 535 'default': '32', # WORDSIZE_GUESS,
509 'help': 'the word size' 536 'help': 'the word size'
510 }, 537 },
511 'simulator': { 538 'simulator': {
512 'values': ['arm', 'none'], 539 'values': ['arm', 'none'],
513 'default': 'none', 540 'default': 'none',
514 'help': 'build with simulator' 541 'help': 'build with simulator'
515 }, 542 },
516 'disassembler': { 543 'disassembler': {
517 'values': ['on', 'off'], 544 'values': ['on', 'off'],
518 'default': 'off', 545 'default': 'off',
519 'help': 'enable the disassembler to inspect generated code' 546 'help': 'enable the disassembler to inspect generated code'
520 }, 547 },
521 'sourcesignatures': { 548 'sourcesignatures': {
522 'values': ['MD5', 'timestamp'], 549 'values': ['MD5', 'timestamp'],
523 'default': 'MD5', 550 'default': 'MD5',
524 'help': 'set how the build system detects file changes' 551 'help': 'set how the build system detects file changes'
525 }, 552 },
526 'console': { 553 'console': {
527 'values': ['dumb', 'readline'], 554 'values': ['dumb', 'readline'],
528 'default': 'dumb', 555 'default': 'dumb',
529 'help': 'the console to use for the d8 shell' 556 'help': 'the console to use for the d8 shell'
530 } 557 },
Mads Ager (chromium) 2009/04/29 12:27:24 comma needed?
531 } 558 }
532 559
533 560
534 def GetOptions(): 561 def GetOptions():
535 result = Options() 562 result = Options()
536 result.Add('mode', 'compilation mode (debug, release)', 'release') 563 result.Add('mode', 'compilation mode (debug, release)', 'release')
537 result.Add('sample', 'build sample (shell, process)', '') 564 result.Add('sample', 'build sample (shell, process)', '')
538 result.Add('env', 'override environment settings (NAME0:value0,NAME1:value1,.. .)', '') 565 result.Add('env', 'override environment settings (NAME0:value0,NAME1:value1,.. .)', '')
539 result.Add('importenv', 'import environment settings (NAME0,NAME1,...)', '') 566 result.Add('importenv', 'import environment settings (NAME0,NAME1,...)', '')
540 for (name, option) in SIMPLE_OPTIONS.iteritems(): 567 for (name, option) in SIMPLE_OPTIONS.iteritems():
(...skipping 17 matching lines...) Expand all
558 585
559 def VerifyOptions(env): 586 def VerifyOptions(env):
560 if not IsLegal(env, 'mode', ['debug', 'release']): 587 if not IsLegal(env, 'mode', ['debug', 'release']):
561 return False 588 return False
562 if not IsLegal(env, 'sample', ["shell", "process"]): 589 if not IsLegal(env, 'sample', ["shell", "process"]):
563 return False 590 return False
564 if env['os'] == 'win32' and env['library'] == 'shared' and env['prof'] == 'on' : 591 if env['os'] == 'win32' and env['library'] == 'shared' and env['prof'] == 'on' :
565 Abort("Profiling on windows only supported for static library.") 592 Abort("Profiling on windows only supported for static library.")
566 if env['prof'] == 'oprofile' and env['os'] != 'linux': 593 if env['prof'] == 'oprofile' and env['os'] != 'linux':
567 Abort("OProfile is only supported on Linux.") 594 Abort("OProfile is only supported on Linux.")
595 if env['wordsize'] == '64' and (env['os'] != 'linux' or env['arch'] != 'x64'):
596 Abort("64 bit compilation only allowed on Linux OS and x64 architecture.")
568 for (name, option) in SIMPLE_OPTIONS.iteritems(): 597 for (name, option) in SIMPLE_OPTIONS.iteritems():
569 if (not option.get('default')) and (name not in ARGUMENTS): 598 if (not option.get('default')) and (name not in ARGUMENTS):
570 message = ("A value for option %s must be specified (%s)." % 599 message = ("A value for option %s must be specified (%s)." %
571 (name, ", ".join(option['values']))) 600 (name, ", ".join(option['values'])))
572 Abort(message) 601 Abort(message)
573 if not env[name] in option['values']: 602 if not env[name] in option['values']:
574 message = ("Unknown %s value '%s'. Possible values are (%s)." % 603 message = ("Unknown %s value '%s'. Possible values are (%s)." %
575 (name, env[name], ", ".join(option['values']))) 604 (name, env[name], ", ".join(option['values'])))
576 Abort(message) 605 Abort(message)
577 606
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 # version of scons. Also, there's a bug in some revisions that 823 # version of scons. Also, there's a bug in some revisions that
795 # doesn't allow this flag to be set, so we swallow any exceptions. 824 # doesn't allow this flag to be set, so we swallow any exceptions.
796 # Lovely. 825 # Lovely.
797 try: 826 try:
798 SetOption('warn', 'no-deprecated') 827 SetOption('warn', 'no-deprecated')
799 except: 828 except:
800 pass 829 pass
801 830
802 831
803 Build() 832 Build()
OLDNEW
« no previous file with comments | « no previous file | src/SConscript » ('j') | src/SConscript » ('J')

Powered by Google App Engine
This is Rietveld 408576698