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

Side by Side Diff: SConstruct

Issue 11275184: First draft of the sh4 port Base URL: http://github.com/v8/v8.git@master
Patch Set: Created 8 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
« no previous file with comments | « no previous file | src/SConscript » ('j') | src/full-codegen.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2012 the V8 project authors. All rights reserved. 1 # Copyright 2012 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 }, 173 },
174 'simulator:none': { 174 'simulator:none': {
175 'CCFLAGS': ['-mfloat-abi=hard'], 175 'CCFLAGS': ['-mfloat-abi=hard'],
176 } 176 }
177 } 177 }
178 }, 178 },
179 'simulator:arm': { 179 'simulator:arm': {
180 'CCFLAGS': ['-m32'], 180 'CCFLAGS': ['-m32'],
181 'LINKFLAGS': ['-m32'], 181 'LINKFLAGS': ['-m32'],
182 }, 182 },
183 'arch:sh4': {
Jakob Kummerow 2012/11/07 11:18:24 Building V8 with SCons is deprecated (and already
remi.duraffort 2012/11/07 11:59:26 OK. Im just wondering how to cross compile using G
Jakob Kummerow 2012/11/07 13:25:12 GYP should be completely transparent to cross-comp
184 'CCFLAGS': ['-mieee', '-fno-strict-aliasing'],
185 'CPPDEFINES': ['V8_TARGET_ARCH_SH4']
186 },
183 'arch:mips': { 187 'arch:mips': {
184 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'], 188 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'],
185 'mips_arch_variant:mips32r2': { 189 'mips_arch_variant:mips32r2': {
186 'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2'] 190 'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2']
187 }, 191 },
188 'mips_arch_variant:loongson': { 192 'mips_arch_variant:loongson': {
189 'CPPDEFINES': ['_MIPS_ARCH_LOONGSON'] 193 'CPPDEFINES': ['_MIPS_ARCH_LOONGSON']
190 }, 194 },
191 'simulator:none': { 195 'simulator:none': {
192 'CCFLAGS': ['-EL'], 196 'CCFLAGS': ['-EL'],
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 'os:macos': { 331 'os:macos': {
328 'WARNINGFLAGS': ['-pedantic'] 332 'WARNINGFLAGS': ['-pedantic']
329 }, 333 },
330 'arch:arm': { 334 'arch:arm': {
331 # This is to silence warnings about ABI changes that some versions of the 335 # This is to silence warnings about ABI changes that some versions of the
332 # CodeSourcery G++ tool chain produce for each occurrence of varargs. 336 # CodeSourcery G++ tool chain produce for each occurrence of varargs.
333 'WARNINGFLAGS': ['-Wno-abi'] 337 'WARNINGFLAGS': ['-Wno-abi']
334 }, 338 },
335 'disassembler:on': { 339 'disassembler:on': {
336 'CPPDEFINES': ['ENABLE_DISASSEMBLER'] 340 'CPPDEFINES': ['ENABLE_DISASSEMBLER']
341 },
342 'arch:sh4': {
343 'gpl_disassembler:on': {
344 'CPPDEFINES': ['USE_KERNEL_DISASM']
345 }
337 } 346 }
338 }, 347 },
339 'msvc': { 348 'msvc': {
340 'all': { 349 'all': {
341 'WARNINGFLAGS': ['/W3', '/WX', '/wd4351', '/wd4355', '/wd4800'] 350 'WARNINGFLAGS': ['/W3', '/WX', '/wd4351', '/wd4355', '/wd4800']
342 }, 351 },
343 'library:shared': { 352 'library:shared': {
344 'CPPDEFINES': ['BUILDING_V8_SHARED'], 353 'CPPDEFINES': ['BUILDING_V8_SHARED'],
345 'LIBS': ['winmm', 'ws2_32'] 354 'LIBS': ['winmm', 'ws2_32']
346 }, 355 },
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 } 833 }
825 } 834 }
826 } 835 }
827 } 836 }
828 837
829 838
830 D8_FLAGS = { 839 D8_FLAGS = {
831 'all': { 840 'all': {
832 'library:shared': { 841 'library:shared': {
833 'CPPDEFINES': ['V8_SHARED'], 842 'CPPDEFINES': ['V8_SHARED'],
834 'LIBS': ['v8'],
835 'LIBPATH': ['.'] 843 'LIBPATH': ['.']
836 }, 844 },
837 }, 845 },
838 'gcc': { 846 'gcc': {
839 'all': { 847 'all': {
840 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], 848 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
841 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'], 849 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'],
842 'LINKFLAGS': ['$CCFLAGS'], 850 'LINKFLAGS': ['$CCFLAGS'],
843 }, 851 },
844 'console:readline': { 852 'console:readline': {
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 # but when scons detects msvc this value is not set. 995 # but when scons detects msvc this value is not set.
988 version = subprocess.Popen([env['CC'], '-dumpversion'], 996 version = subprocess.Popen([env['CC'], '-dumpversion'],
989 stdout=subprocess.PIPE).communicate()[0] 997 stdout=subprocess.PIPE).communicate()[0]
990 if version.find('4.5') == 0: 998 if version.find('4.5') == 0:
991 return 'off' 999 return 'off'
992 return 'default' 1000 return 'default'
993 1001
994 1002
995 PLATFORM_OPTIONS = { 1003 PLATFORM_OPTIONS = {
996 'arch': { 1004 'arch': {
997 'values': ['arm', 'ia32', 'x64', 'mips'], 1005 'values': ['arm', 'ia32', 'x64', 'mips', 'sh4'],
998 'guess': GuessArch, 1006 'guess': GuessArch,
999 'help': 'the architecture to build for' 1007 'help': 'the architecture to build for'
1000 }, 1008 },
1001 'os': { 1009 'os': {
1002 'values': ['freebsd', 'linux', 'macos', 'win32', 'openbsd', 'solaris', 'cygw in', 'netbsd'], 1010 'values': ['freebsd', 'linux', 'macos', 'win32', 'openbsd', 'solaris', 'cygw in', 'netbsd'],
1003 'guess': GuessOS, 1011 'guess': GuessOS,
1004 'help': 'the os to build for' 1012 'help': 'the os to build for'
1005 }, 1013 },
1006 'toolchain': { 1014 'toolchain': {
1007 'values': ['gcc', 'msvc'], 1015 'values': ['gcc', 'msvc'],
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 'vfp3': { 1158 'vfp3': {
1151 'values': ['on', 'off'], 1159 'values': ['on', 'off'],
1152 'default': 'on', 1160 'default': 'on',
1153 'help': 'use vfp3 instructions when building the snapshot [Arm only]' 1161 'help': 'use vfp3 instructions when building the snapshot [Arm only]'
1154 }, 1162 },
1155 'fpu': { 1163 'fpu': {
1156 'values': ['on', 'off'], 1164 'values': ['on', 'off'],
1157 'default': 'on', 1165 'default': 'on',
1158 'help': 'use fpu instructions when building the snapshot [MIPS only]' 1166 'help': 'use fpu instructions when building the snapshot [MIPS only]'
1159 }, 1167 },
1168 'backtracesupport': {
1169 'values': ['on', 'off'],
1170 'default': 'off',
1171 'help': 'enable backtrace support for debug'
1172 },
1173 'logging': {
1174 'values': ['on', 'off'],
1175 'default': 'off',
1176 'help': 'enable logging and profiling'
1177 },
1178 'gpl_disassembler': {
1179 'values': [ 'on', 'off'],
1180 'default': 'off',
1181 'help': 'enable the disassembler from the linux kernel: This code is GPL, ma king libv8 GPL if activated'
1182 },
1160 'I_know_I_should_build_with_GYP': { 1183 'I_know_I_should_build_with_GYP': {
1161 'values': ['yes', 'no'], 1184 'values': ['yes', 'no'],
1162 'default': 'no', 1185 'default': 'no',
1163 'help': 'grace period: temporarily override SCons deprecation' 1186 'help': 'grace period: temporarily override SCons deprecation'
1164 } 1187 }
1165
1166 } 1188 }
1167 1189
1168 ALL_OPTIONS = dict(PLATFORM_OPTIONS, **SIMPLE_OPTIONS) 1190 ALL_OPTIONS = dict(PLATFORM_OPTIONS, **SIMPLE_OPTIONS)
1169 1191
1170 1192
1171 def AddOptions(options, result): 1193 def AddOptions(options, result):
1172 guess_env = Environment(options=result) 1194 guess_env = Environment(options=result)
1173 for (name, option) in options.iteritems(): 1195 for (name, option) in options.iteritems():
1174 if 'guess' in option: 1196 if 'guess' in option:
1175 # Option has a guess function 1197 # Option has a guess function
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 # Adjust architecture if the simulator option has been set 1427 # Adjust architecture if the simulator option has been set
1406 if (options['simulator'] != 'none') and (options['arch'] != options['simulator ']): 1428 if (options['simulator'] != 'none') and (options['arch'] != options['simulator ']):
1407 if 'arch' in ARGUMENTS: 1429 if 'arch' in ARGUMENTS:
1408 # Print a warning if arch has explicitly been set 1430 # Print a warning if arch has explicitly been set
1409 print "Warning: forcing architecture to match simulator (%s)" % options['s imulator'] 1431 print "Warning: forcing architecture to match simulator (%s)" % options['s imulator']
1410 options['arch'] = options['simulator'] 1432 options['arch'] = options['simulator']
1411 if (options['prof'] != 'off') and (options['profilingsupport'] == 'off'): 1433 if (options['prof'] != 'off') and (options['profilingsupport'] == 'off'):
1412 # Print a warning if profiling is enabled without profiling support 1434 # Print a warning if profiling is enabled without profiling support
1413 print "Warning: forcing profilingsupport on when prof is on" 1435 print "Warning: forcing profilingsupport on when prof is on"
1414 options['profilingsupport'] = 'on' 1436 options['profilingsupport'] = 'on'
1437 if (options['prof'] != 'off') and (options['logging'] == 'off'):
1438 # Print a warning if profiling is enabled without logging
1439 print "Warning: forcing logging on when prof is on"
1440 options['logging'] = 'on'
1415 if os == 'win32' and options['pgo'] != 'off' and options['msvcltcg'] == 'off': 1441 if os == 'win32' and options['pgo'] != 'off' and options['msvcltcg'] == 'off':
1416 if 'msvcltcg' in ARGUMENTS: 1442 if 'msvcltcg' in ARGUMENTS:
1417 print "Warning: forcing msvcltcg on as it is required for pgo (%s)" % opti ons['pgo'] 1443 print "Warning: forcing msvcltcg on as it is required for pgo (%s)" % opti ons['pgo']
1418 options['msvcltcg'] = 'on' 1444 options['msvcltcg'] = 'on'
1419 if (options['mipsabi'] != 'none') and (options['arch'] != 'mips') and (options ['simulator'] != 'mips'): 1445 if (options['mipsabi'] != 'none') and (options['arch'] != 'mips') and (options ['simulator'] != 'mips'):
1420 options['mipsabi'] = 'none' 1446 options['mipsabi'] = 'none'
1421 if options['liveobjectlist'] == 'on': 1447 if options['liveobjectlist'] == 'on':
1422 if (options['debuggersupport'] != 'on') or (options['mode'] == 'release'): 1448 if (options['debuggersupport'] != 'on') or (options['mode'] == 'release'):
1423 # Print a warning that liveobjectlist will implicitly enable the debugger 1449 # Print a warning that liveobjectlist will implicitly enable the debugger
1424 print "Warning: forcing debuggersupport on for liveobjectlist" 1450 print "Warning: forcing debuggersupport on for liveobjectlist"
1425 options['debuggersupport'] = 'on' 1451 options['debuggersupport'] = 'on'
1426 options['inspector'] = 'on' 1452 options['inspector'] = 'on'
1427 options['objectprint'] = 'on' 1453 options['objectprint'] = 'on'
1454 if options['backtracesupport'] == 'on':
1455 if (options['mode'] == 'release'):
1456 # Print a warning that backtrace is deactivated in non release mode
1457 print "Warning: forcing backtracesupport off in release mode"
1458 options['backtracesupport'] = 'off'
1459 # Print a warning if the gpl_disassembler is used in release mode
1460 if options['gpl_disassembler'] == 'on' and options['mode'] == 'release':
1461 print "Warning: the GPL disassembler is enabled, making libv8 GPL too !"
1428 1462
1429 1463
1430 def ParseEnvOverrides(arg, imports): 1464 def ParseEnvOverrides(arg, imports):
1431 # The environment overrides are in the format NAME0:value0,NAME1:value1,... 1465 # The environment overrides are in the format NAME0:value0,NAME1:value1,...
1432 # The environment imports are in the format NAME0,NAME1,... 1466 # The environment imports are in the format NAME0,NAME1,...
1433 overrides = {} 1467 overrides = {}
1434 for var in imports.split(','): 1468 for var in imports.split(','):
1435 if var in os.environ: 1469 if var in os.environ:
1436 overrides[var] = os.environ[var] 1470 overrides[var] = os.environ[var]
1437 for override in arg.split(','): 1471 for override in arg.split(','):
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 PDB=preparser_pdb_name, 1561 PDB=preparser_pdb_name,
1528 SONAME=preparser_soname) 1562 SONAME=preparser_soname)
1529 context.library_targets.append(library) 1563 context.library_targets.append(library)
1530 context.library_targets.append(preparser_library) 1564 context.library_targets.append(preparser_library)
1531 1565
1532 context.ApplyEnvOverrides(d8_env) 1566 context.ApplyEnvOverrides(d8_env)
1533 if context.options['library'] == 'static': 1567 if context.options['library'] == 'static':
1534 shell = d8_env.Program('d8' + suffix, object_files + shell_files) 1568 shell = d8_env.Program('d8' + suffix, object_files + shell_files)
1535 else: 1569 else:
1536 shell = d8_env.Program('d8' + suffix, shell_files) 1570 shell = d8_env.Program('d8' + suffix, shell_files)
1571 d8_env.Prepend(LIBS=[library_name])
1537 d8_env.Depends(shell, library) 1572 d8_env.Depends(shell, library)
1538 context.d8_targets.append(shell) 1573 context.d8_targets.append(shell)
1539 1574
1540 for sample in context.samples: 1575 for sample in context.samples:
1541 sample_env = Environment(tools=tools) 1576 sample_env = Environment(tools=tools)
1542 sample_env.Replace(**context.flags['sample']) 1577 sample_env.Replace(**context.flags['sample'])
1543 sample_env.Prepend(LIBS=[library_name]) 1578 sample_env.Prepend(LIBS=[library_name])
1544 context.ApplyEnvOverrides(sample_env) 1579 context.ApplyEnvOverrides(sample_env)
1545 sample_object = sample_env.SConscript( 1580 sample_object = sample_env.SConscript(
1546 join('samples', 'SConscript'), 1581 join('samples', 'SConscript'),
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 # env.Copy without getting warnings for compatibility with older 1662 # env.Copy without getting warnings for compatibility with older
1628 # version of scons. Also, there's a bug in some revisions that 1663 # version of scons. Also, there's a bug in some revisions that
1629 # doesn't allow this flag to be set, so we swallow any exceptions. 1664 # doesn't allow this flag to be set, so we swallow any exceptions.
1630 # Lovely. 1665 # Lovely.
1631 try: 1666 try:
1632 SetOption('warn', 'no-deprecated') 1667 SetOption('warn', 'no-deprecated')
1633 except: 1668 except:
1634 pass 1669 pass
1635 1670
1636 Build() 1671 Build()
OLDNEW
« no previous file with comments | « no previous file | src/SConscript » ('j') | src/full-codegen.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698