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

Unified Diff: SConstruct

Issue 6794050: Revert "[Arguments] Merge (7442,7496] from bleeding_edge." (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/arguments
Patch Set: Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ChangeLog ('k') | include/v8.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: SConstruct
diff --git a/SConstruct b/SConstruct
index d92dd021992dbde84e3ec0d01d0ec3302edb216f..2287c8005f2e464cc33b91a2fbddbbd2744aae05 100644
--- a/SConstruct
+++ b/SConstruct
@@ -27,7 +27,6 @@
import platform
import re
-import subprocess
import sys
import os
from os.path import join, dirname, abspath
@@ -146,9 +145,6 @@ LIBRARY_FLAGS = {
# Use visibility=default to disable this.
'CXXFLAGS': ['-fvisibility=hidden']
},
- 'strictaliasing:off': {
- 'CCFLAGS': ['-fno-strict-aliasing']
- },
'mode:debug': {
'CCFLAGS': ['-g', '-O0'],
'CPPDEFINES': ['ENABLE_DISASSEMBLER', 'DEBUG'],
@@ -830,16 +826,8 @@ def Abort(message):
sys.exit(1)
-def GuessOS(env):
- return utils.GuessOS()
-
-
-def GuessArch(env):
- return utils.GuessArchitecture()
-
-
-def GuessToolchain(env):
- tools = env['TOOLS']
+def GuessToolchain(os):
+ tools = Environment()['TOOLS']
if 'gcc' in tools:
return 'gcc'
elif 'msvc' in tools:
@@ -848,9 +836,7 @@ def GuessToolchain(env):
return None
-def GuessVisibility(env):
- os = env['os']
- toolchain = env['toolchain'];
+def GuessVisibility(os, toolchain):
if (os == 'win32' or os == 'cygwin') and toolchain == 'gcc':
# MinGW / Cygwin can't do it.
return 'default'
@@ -860,41 +846,28 @@ def GuessVisibility(env):
return 'hidden'
-def GuessStrictAliasing(env):
- # There seems to be a problem with gcc 4.5.x.
- # See http://code.google.com/p/v8/issues/detail?id=884
- # It can be worked around by disabling strict aliasing.
- toolchain = env['toolchain'];
- if toolchain == 'gcc':
- env = Environment(tools=['gcc'])
- # The gcc version should be available in env['CCVERSION'],
- # but when scons detects msvc this value is not set.
- version = subprocess.Popen([env['CC'], '-dumpversion'],
- stdout=subprocess.PIPE).communicate()[0]
- if version.find('4.5') == 0:
- return 'off'
- return 'default'
+OS_GUESS = utils.GuessOS()
+TOOLCHAIN_GUESS = GuessToolchain(OS_GUESS)
+ARCH_GUESS = utils.GuessArchitecture()
+VISIBILITY_GUESS = GuessVisibility(OS_GUESS, TOOLCHAIN_GUESS)
-PLATFORM_OPTIONS = {
- 'arch': {
- 'values': ['arm', 'ia32', 'x64', 'mips'],
- 'guess': GuessArch,
- 'help': 'the architecture to build for'
+SIMPLE_OPTIONS = {
+ 'toolchain': {
+ 'values': ['gcc', 'msvc'],
+ 'default': TOOLCHAIN_GUESS,
+ 'help': 'the toolchain to use (%s)' % TOOLCHAIN_GUESS
},
'os': {
'values': ['freebsd', 'linux', 'macos', 'win32', 'android', 'openbsd', 'solaris', 'cygwin'],
- 'guess': GuessOS,
- 'help': 'the os to build for'
+ 'default': OS_GUESS,
+ 'help': 'the os to build for (%s)' % OS_GUESS
+ },
+ 'arch': {
+ 'values':['arm', 'ia32', 'x64', 'mips'],
+ 'default': ARCH_GUESS,
+ 'help': 'the architecture to build for (%s)' % ARCH_GUESS
},
- 'toolchain': {
- 'values': ['gcc', 'msvc'],
- 'guess': GuessToolchain,
- 'help': 'the toolchain to use'
- }
-}
-
-SIMPLE_OPTIONS = {
'regexp': {
'values': ['native', 'interpreted'],
'default': 'native',
@@ -1008,13 +981,8 @@ SIMPLE_OPTIONS = {
},
'visibility': {
'values': ['default', 'hidden'],
- 'guess': GuessVisibility,
- 'help': 'shared library symbol visibility'
- },
- 'strictaliasing': {
- 'values': ['default', 'off'],
- 'guess': GuessStrictAliasing,
- 'help': 'assume strict aliasing while optimizing'
+ 'default': VISIBILITY_GUESS,
+ 'help': 'shared library symbol visibility (%s)' % VISIBILITY_GUESS
},
'pgo': {
'values': ['off', 'instrument', 'optimize'],
@@ -1033,22 +1001,6 @@ SIMPLE_OPTIONS = {
}
}
-ALL_OPTIONS = dict(PLATFORM_OPTIONS, **SIMPLE_OPTIONS)
-
-
-def AddOptions(options, result):
- guess_env = Environment(options=result)
- for (name, option) in options.iteritems():
- if 'guess' in option:
- # Option has a guess function
- guess = option.get('guess')
- default = guess(guess_env)
- else:
- # Option has a fixed default
- default = option.get('default')
- help = '%s (%s)' % (option.get('help'), ", ".join(option['values']))
- result.Add(name, help, default)
-
def GetOptions():
result = Options()
@@ -1057,23 +1009,12 @@ def GetOptions():
result.Add('cache', 'directory to use for scons build cache', '')
result.Add('env', 'override environment settings (NAME0:value0,NAME1:value1,...)', '')
result.Add('importenv', 'import environment settings (NAME0,NAME1,...)', '')
- AddOptions(PLATFORM_OPTIONS, result)
- AddOptions(SIMPLE_OPTIONS, result)
+ for (name, option) in SIMPLE_OPTIONS.iteritems():
+ help = '%s (%s)' % (name, ", ".join(option['values']))
+ result.Add(name, help, option.get('default'))
return result
-def GetTools(opts):
- env = Environment(options=opts)
- os = env['os']
- toolchain = env['toolchain']
- if os == 'win32' and toolchain == 'gcc':
- return ['mingw']
- elif os == 'win32' and toolchain == 'msvc':
- return ['msvc', 'mslink', 'mslib', 'msvs']
- else:
- return ['default']
-
-
def GetVersionComponents():
MAJOR_VERSION_PATTERN = re.compile(r"#define\s+MAJOR_VERSION\s+(.*)")
MINOR_VERSION_PATTERN = re.compile(r"#define\s+MINOR_VERSION\s+(.*)")
@@ -1153,8 +1094,8 @@ def VerifyOptions(env):
print env['arch']
print env['simulator']
Abort("Option unalignedaccesses only supported for the ARM architecture.")
- for (name, option) in ALL_OPTIONS.iteritems():
- if (not name in env):
+ for (name, option) in SIMPLE_OPTIONS.iteritems():
+ if (not option.get('default')) and (name not in ARGUMENTS):
message = ("A value for option %s must be specified (%s)." %
(name, ", ".join(option['values'])))
Abort(message)
@@ -1284,9 +1225,9 @@ def ParseEnvOverrides(arg, imports):
return overrides
-def BuildSpecific(env, mode, env_overrides, tools):
+def BuildSpecific(env, mode, env_overrides):
options = {'mode': mode}
- for option in ALL_OPTIONS:
+ for option in SIMPLE_OPTIONS:
options[option] = env[option]
PostprocessOptions(options, env['os'])
@@ -1340,7 +1281,7 @@ def BuildSpecific(env, mode, env_overrides, tools):
(object_files, shell_files, mksnapshot, preparser_files) = env.SConscript(
join('src', 'SConscript'),
build_dir=join('obj', target_id),
- exports='context tools',
+ exports='context',
duplicate=False
)
@@ -1367,21 +1308,21 @@ def BuildSpecific(env, mode, env_overrides, tools):
context.library_targets.append(library)
context.library_targets.append(preparser_library)
- d8_env = Environment(tools=tools)
+ d8_env = Environment()
d8_env.Replace(**context.flags['d8'])
context.ApplyEnvOverrides(d8_env)
shell = d8_env.Program('d8' + suffix, object_files + shell_files)
context.d8_targets.append(shell)
for sample in context.samples:
- sample_env = Environment(tools=tools)
+ sample_env = Environment()
sample_env.Replace(**context.flags['sample'])
sample_env.Prepend(LIBS=[library_name])
context.ApplyEnvOverrides(sample_env)
sample_object = sample_env.SConscript(
join('samples', 'SConscript'),
build_dir=join('obj', 'sample', sample, target_id),
- exports='sample context tools',
+ exports='sample context',
duplicate=False
)
sample_name = sample + suffix
@@ -1394,7 +1335,7 @@ def BuildSpecific(env, mode, env_overrides, tools):
cctest_program = cctest_env.SConscript(
join('test', 'cctest', 'SConscript'),
build_dir=join('obj', 'test', target_id),
- exports='context object_files tools',
+ exports='context object_files',
duplicate=False
)
context.cctest_targets.append(cctest_program)
@@ -1409,7 +1350,7 @@ def BuildSpecific(env, mode, env_overrides, tools):
exports='context',
duplicate=False
)
- preparser_name = join('obj', 'preparser', target_id, 'preparser')
+ preparser_name = join('obj', 'preparser', target_id, 'preparser' + suffix)
preparser_program = preparser_env.Program(preparser_name, preparser_object);
preparser_env.Depends(preparser_program, preparser_library)
context.preparser_targets.append(preparser_program)
@@ -1419,9 +1360,7 @@ def BuildSpecific(env, mode, env_overrides, tools):
def Build():
opts = GetOptions()
- tools = GetTools(opts)
- env = Environment(options=opts, tools=tools)
-
+ env = Environment(options=opts)
Help(opts.GenerateHelpText(env))
VerifyOptions(env)
env_overrides = ParseEnvOverrides(env['env'], env['importenv'])
@@ -1436,7 +1375,7 @@ def Build():
d8s = []
modes = SplitList(env['mode'])
for mode in modes:
- context = BuildSpecific(env.Copy(), mode, env_overrides, tools)
+ context = BuildSpecific(env.Copy(), mode, env_overrides)
libraries += context.library_targets
mksnapshots += context.mksnapshot_targets
cctests += context.cctest_targets
« no previous file with comments | « ChangeLog ('k') | include/v8.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698