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

Side by Side Diff: SConstruct

Issue 6691054: [Arguments] Merge (7442,7496] from bleeding_edge. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/arguments
Patch Set: Created 9 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
« no previous file with comments | « ChangeLog ('k') | include/v8.h » ('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 2010 the V8 project authors. All rights reserved. 1 # Copyright 2010 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
11 # with the distribution. 11 # with the distribution.
12 # * Neither the name of Google Inc. nor the names of its 12 # * Neither the name of Google Inc. nor the names of its
13 # contributors may be used to endorse or promote products derived 13 # contributors may be used to endorse or promote products derived
14 # from this software without specific prior written permission. 14 # from this software without specific prior written permission.
15 # 15 #
16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 import platform 28 import platform
29 import re 29 import re
30 import subprocess
30 import sys 31 import sys
31 import os 32 import os
32 from os.path import join, dirname, abspath 33 from os.path import join, dirname, abspath
33 from types import DictType, StringTypes 34 from types import DictType, StringTypes
34 root_dir = dirname(File('SConstruct').rfile().abspath) 35 root_dir = dirname(File('SConstruct').rfile().abspath)
35 sys.path.insert(0, join(root_dir, 'tools')) 36 sys.path.insert(0, join(root_dir, 'tools'))
36 import js2c, utils 37 import js2c, utils
37 38
38 # ANDROID_TOP is the top of the Android checkout, fetched from the environment 39 # ANDROID_TOP is the top of the Android checkout, fetched from the environment
39 # variable 'TOP'. You will also need to set the CXX, CC, AR and RANLIB 40 # variable 'TOP'. You will also need to set the CXX, CC, AR and RANLIB
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 }, 139 },
139 'gcc': { 140 'gcc': {
140 'all': { 141 'all': {
141 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], 142 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
142 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'], 143 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'],
143 }, 144 },
144 'visibility:hidden': { 145 'visibility:hidden': {
145 # Use visibility=default to disable this. 146 # Use visibility=default to disable this.
146 'CXXFLAGS': ['-fvisibility=hidden'] 147 'CXXFLAGS': ['-fvisibility=hidden']
147 }, 148 },
149 'strictaliasing:off': {
150 'CCFLAGS': ['-fno-strict-aliasing']
151 },
148 'mode:debug': { 152 'mode:debug': {
149 'CCFLAGS': ['-g', '-O0'], 153 'CCFLAGS': ['-g', '-O0'],
150 'CPPDEFINES': ['ENABLE_DISASSEMBLER', 'DEBUG'], 154 'CPPDEFINES': ['ENABLE_DISASSEMBLER', 'DEBUG'],
151 'os:android': { 155 'os:android': {
152 'CCFLAGS': ['-mthumb'] 156 'CCFLAGS': ['-mthumb']
153 } 157 }
154 }, 158 },
155 'mode:release': { 159 'mode:release': {
156 'CCFLAGS': ['-O3', '-fomit-frame-pointer', '-fdata-sections', 160 'CCFLAGS': ['-O3', '-fomit-frame-pointer', '-fdata-sections',
157 '-ffunction-sections'], 161 '-ffunction-sections'],
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 'release': '', 823 'release': '',
820 'debug': '_g' 824 'debug': '_g'
821 } 825 }
822 826
823 827
824 def Abort(message): 828 def Abort(message):
825 print message 829 print message
826 sys.exit(1) 830 sys.exit(1)
827 831
828 832
829 def GuessToolchain(os): 833 def GuessOS(env):
830 tools = Environment()['TOOLS'] 834 return utils.GuessOS()
835
836
837 def GuessArch(env):
838 return utils.GuessArchitecture()
839
840
841 def GuessToolchain(env):
842 tools = env['TOOLS']
831 if 'gcc' in tools: 843 if 'gcc' in tools:
832 return 'gcc' 844 return 'gcc'
833 elif 'msvc' in tools: 845 elif 'msvc' in tools:
834 return 'msvc' 846 return 'msvc'
835 else: 847 else:
836 return None 848 return None
837 849
838 850
839 def GuessVisibility(os, toolchain): 851 def GuessVisibility(env):
852 os = env['os']
853 toolchain = env['toolchain'];
840 if (os == 'win32' or os == 'cygwin') and toolchain == 'gcc': 854 if (os == 'win32' or os == 'cygwin') and toolchain == 'gcc':
841 # MinGW / Cygwin can't do it. 855 # MinGW / Cygwin can't do it.
842 return 'default' 856 return 'default'
843 elif os == 'solaris': 857 elif os == 'solaris':
844 return 'default' 858 return 'default'
845 else: 859 else:
846 return 'hidden' 860 return 'hidden'
847 861
848 862
849 OS_GUESS = utils.GuessOS() 863 def GuessStrictAliasing(env):
850 TOOLCHAIN_GUESS = GuessToolchain(OS_GUESS) 864 # There seems to be a problem with gcc 4.5.x.
851 ARCH_GUESS = utils.GuessArchitecture() 865 # See http://code.google.com/p/v8/issues/detail?id=884
852 VISIBILITY_GUESS = GuessVisibility(OS_GUESS, TOOLCHAIN_GUESS) 866 # It can be worked around by disabling strict aliasing.
867 toolchain = env['toolchain'];
868 if toolchain == 'gcc':
869 env = Environment(tools=['gcc'])
870 # The gcc version should be available in env['CCVERSION'],
871 # but when scons detects msvc this value is not set.
872 version = subprocess.Popen([env['CC'], '-dumpversion'],
873 stdout=subprocess.PIPE).communicate()[0]
874 if version.find('4.5') == 0:
875 return 'off'
876 return 'default'
853 877
854 878
855 SIMPLE_OPTIONS = { 879 PLATFORM_OPTIONS = {
856 'toolchain': { 880 'arch': {
857 'values': ['gcc', 'msvc'], 881 'values': ['arm', 'ia32', 'x64', 'mips'],
858 'default': TOOLCHAIN_GUESS, 882 'guess': GuessArch,
859 'help': 'the toolchain to use (%s)' % TOOLCHAIN_GUESS 883 'help': 'the architecture to build for'
860 }, 884 },
861 'os': { 885 'os': {
862 'values': ['freebsd', 'linux', 'macos', 'win32', 'android', 'openbsd', 'sola ris', 'cygwin'], 886 'values': ['freebsd', 'linux', 'macos', 'win32', 'android', 'openbsd', 'sola ris', 'cygwin'],
863 'default': OS_GUESS, 887 'guess': GuessOS,
864 'help': 'the os to build for (%s)' % OS_GUESS 888 'help': 'the os to build for'
865 }, 889 },
866 'arch': { 890 'toolchain': {
867 'values':['arm', 'ia32', 'x64', 'mips'], 891 'values': ['gcc', 'msvc'],
868 'default': ARCH_GUESS, 892 'guess': GuessToolchain,
869 'help': 'the architecture to build for (%s)' % ARCH_GUESS 893 'help': 'the toolchain to use'
870 }, 894 }
895 }
896
897 SIMPLE_OPTIONS = {
871 'regexp': { 898 'regexp': {
872 'values': ['native', 'interpreted'], 899 'values': ['native', 'interpreted'],
873 'default': 'native', 900 'default': 'native',
874 'help': 'Whether to use native or interpreted regexp implementation' 901 'help': 'Whether to use native or interpreted regexp implementation'
875 }, 902 },
876 'snapshot': { 903 'snapshot': {
877 'values': ['on', 'off', 'nobuild'], 904 'values': ['on', 'off', 'nobuild'],
878 'default': 'off', 905 'default': 'off',
879 'help': 'build using snapshots for faster start-up' 906 'help': 'build using snapshots for faster start-up'
880 }, 907 },
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 'default': 'dumb', 1001 'default': 'dumb',
975 'help': 'the console to use for the d8 shell' 1002 'help': 'the console to use for the d8 shell'
976 }, 1003 },
977 'verbose': { 1004 'verbose': {
978 'values': ['on', 'off'], 1005 'values': ['on', 'off'],
979 'default': 'off', 1006 'default': 'off',
980 'help': 'more output from compiler and linker' 1007 'help': 'more output from compiler and linker'
981 }, 1008 },
982 'visibility': { 1009 'visibility': {
983 'values': ['default', 'hidden'], 1010 'values': ['default', 'hidden'],
984 'default': VISIBILITY_GUESS, 1011 'guess': GuessVisibility,
985 'help': 'shared library symbol visibility (%s)' % VISIBILITY_GUESS 1012 'help': 'shared library symbol visibility'
1013 },
1014 'strictaliasing': {
1015 'values': ['default', 'off'],
1016 'guess': GuessStrictAliasing,
1017 'help': 'assume strict aliasing while optimizing'
986 }, 1018 },
987 'pgo': { 1019 'pgo': {
988 'values': ['off', 'instrument', 'optimize'], 1020 'values': ['off', 'instrument', 'optimize'],
989 'default': 'off', 1021 'default': 'off',
990 'help': 'select profile guided optimization variant', 1022 'help': 'select profile guided optimization variant',
991 }, 1023 },
992 'mipsabi': { 1024 'mipsabi': {
993 'values': ['hardfloat', 'softfloat', 'none'], 1025 'values': ['hardfloat', 'softfloat', 'none'],
994 'default': 'hardfloat', 1026 'default': 'hardfloat',
995 'help': 'generate calling conventiont according to selected mips ABI' 1027 'help': 'generate calling conventiont according to selected mips ABI'
996 }, 1028 },
997 'mips_arch_variant': { 1029 'mips_arch_variant': {
998 'values': ['mips32r2', 'mips32r1'], 1030 'values': ['mips32r2', 'mips32r1'],
999 'default': 'mips32r2', 1031 'default': 'mips32r2',
1000 'help': 'mips variant' 1032 'help': 'mips variant'
1001 } 1033 }
1002 } 1034 }
1003 1035
1036 ALL_OPTIONS = dict(PLATFORM_OPTIONS, **SIMPLE_OPTIONS)
1037
1038
1039 def AddOptions(options, result):
1040 guess_env = Environment(options=result)
1041 for (name, option) in options.iteritems():
1042 if 'guess' in option:
1043 # Option has a guess function
1044 guess = option.get('guess')
1045 default = guess(guess_env)
1046 else:
1047 # Option has a fixed default
1048 default = option.get('default')
1049 help = '%s (%s)' % (option.get('help'), ", ".join(option['values']))
1050 result.Add(name, help, default)
1051
1004 1052
1005 def GetOptions(): 1053 def GetOptions():
1006 result = Options() 1054 result = Options()
1007 result.Add('mode', 'compilation mode (debug, release)', 'release') 1055 result.Add('mode', 'compilation mode (debug, release)', 'release')
1008 result.Add('sample', 'build sample (shell, process, lineprocessor)', '') 1056 result.Add('sample', 'build sample (shell, process, lineprocessor)', '')
1009 result.Add('cache', 'directory to use for scons build cache', '') 1057 result.Add('cache', 'directory to use for scons build cache', '')
1010 result.Add('env', 'override environment settings (NAME0:value0,NAME1:value1,.. .)', '') 1058 result.Add('env', 'override environment settings (NAME0:value0,NAME1:value1,.. .)', '')
1011 result.Add('importenv', 'import environment settings (NAME0,NAME1,...)', '') 1059 result.Add('importenv', 'import environment settings (NAME0,NAME1,...)', '')
1012 for (name, option) in SIMPLE_OPTIONS.iteritems(): 1060 AddOptions(PLATFORM_OPTIONS, result)
1013 help = '%s (%s)' % (name, ", ".join(option['values'])) 1061 AddOptions(SIMPLE_OPTIONS, result)
1014 result.Add(name, help, option.get('default'))
1015 return result 1062 return result
1016 1063
1017 1064
1065 def GetTools(opts):
1066 env = Environment(options=opts)
1067 os = env['os']
1068 toolchain = env['toolchain']
1069 if os == 'win32' and toolchain == 'gcc':
1070 return ['mingw']
1071 elif os == 'win32' and toolchain == 'msvc':
1072 return ['msvc', 'mslink', 'mslib', 'msvs']
1073 else:
1074 return ['default']
1075
1076
1018 def GetVersionComponents(): 1077 def GetVersionComponents():
1019 MAJOR_VERSION_PATTERN = re.compile(r"#define\s+MAJOR_VERSION\s+(.*)") 1078 MAJOR_VERSION_PATTERN = re.compile(r"#define\s+MAJOR_VERSION\s+(.*)")
1020 MINOR_VERSION_PATTERN = re.compile(r"#define\s+MINOR_VERSION\s+(.*)") 1079 MINOR_VERSION_PATTERN = re.compile(r"#define\s+MINOR_VERSION\s+(.*)")
1021 BUILD_NUMBER_PATTERN = re.compile(r"#define\s+BUILD_NUMBER\s+(.*)") 1080 BUILD_NUMBER_PATTERN = re.compile(r"#define\s+BUILD_NUMBER\s+(.*)")
1022 PATCH_LEVEL_PATTERN = re.compile(r"#define\s+PATCH_LEVEL\s+(.*)") 1081 PATCH_LEVEL_PATTERN = re.compile(r"#define\s+PATCH_LEVEL\s+(.*)")
1023 1082
1024 patterns = [MAJOR_VERSION_PATTERN, 1083 patterns = [MAJOR_VERSION_PATTERN,
1025 MINOR_VERSION_PATTERN, 1084 MINOR_VERSION_PATTERN,
1026 BUILD_NUMBER_PATTERN, 1085 BUILD_NUMBER_PATTERN,
1027 PATCH_LEVEL_PATTERN] 1086 PATCH_LEVEL_PATTERN]
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 if env['soname'] == 'on' and env['library'] == 'static': 1146 if env['soname'] == 'on' and env['library'] == 'static':
1088 Abort("Shared Object soname not applicable for static library.") 1147 Abort("Shared Object soname not applicable for static library.")
1089 if env['os'] != 'win32' and env['pgo'] != 'off': 1148 if env['os'] != 'win32' and env['pgo'] != 'off':
1090 Abort("Profile guided optimization only supported on Windows.") 1149 Abort("Profile guided optimization only supported on Windows.")
1091 if env['cache'] and not os.path.isdir(env['cache']): 1150 if env['cache'] and not os.path.isdir(env['cache']):
1092 Abort("The specified cache directory does not exist.") 1151 Abort("The specified cache directory does not exist.")
1093 if not (env['arch'] == 'arm' or env['simulator'] == 'arm') and ('unalignedacce sses' in ARGUMENTS): 1152 if not (env['arch'] == 'arm' or env['simulator'] == 'arm') and ('unalignedacce sses' in ARGUMENTS):
1094 print env['arch'] 1153 print env['arch']
1095 print env['simulator'] 1154 print env['simulator']
1096 Abort("Option unalignedaccesses only supported for the ARM architecture.") 1155 Abort("Option unalignedaccesses only supported for the ARM architecture.")
1097 for (name, option) in SIMPLE_OPTIONS.iteritems(): 1156 for (name, option) in ALL_OPTIONS.iteritems():
1098 if (not option.get('default')) and (name not in ARGUMENTS): 1157 if (not name in env):
1099 message = ("A value for option %s must be specified (%s)." % 1158 message = ("A value for option %s must be specified (%s)." %
1100 (name, ", ".join(option['values']))) 1159 (name, ", ".join(option['values'])))
1101 Abort(message) 1160 Abort(message)
1102 if not env[name] in option['values']: 1161 if not env[name] in option['values']:
1103 message = ("Unknown %s value '%s'. Possible values are (%s)." % 1162 message = ("Unknown %s value '%s'. Possible values are (%s)." %
1104 (name, env[name], ", ".join(option['values']))) 1163 (name, env[name], ", ".join(option['values'])))
1105 Abort(message) 1164 Abort(message)
1106 1165
1107 1166
1108 class BuildContext(object): 1167 class BuildContext(object):
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 if var in os.environ: 1277 if var in os.environ:
1219 overrides[var] = os.environ[var] 1278 overrides[var] = os.environ[var]
1220 for override in arg.split(','): 1279 for override in arg.split(','):
1221 pos = override.find(':') 1280 pos = override.find(':')
1222 if pos == -1: 1281 if pos == -1:
1223 continue 1282 continue
1224 overrides[override[:pos].strip()] = override[pos+1:].strip() 1283 overrides[override[:pos].strip()] = override[pos+1:].strip()
1225 return overrides 1284 return overrides
1226 1285
1227 1286
1228 def BuildSpecific(env, mode, env_overrides): 1287 def BuildSpecific(env, mode, env_overrides, tools):
1229 options = {'mode': mode} 1288 options = {'mode': mode}
1230 for option in SIMPLE_OPTIONS: 1289 for option in ALL_OPTIONS:
1231 options[option] = env[option] 1290 options[option] = env[option]
1232 PostprocessOptions(options, env['os']) 1291 PostprocessOptions(options, env['os'])
1233 1292
1234 context = BuildContext(options, env_overrides, samples=SplitList(env['sample'] )) 1293 context = BuildContext(options, env_overrides, samples=SplitList(env['sample'] ))
1235 1294
1236 # Remove variables which can't be imported from the user's external 1295 # Remove variables which can't be imported from the user's external
1237 # environment into a construction environment. 1296 # environment into a construction environment.
1238 user_environ = os.environ.copy() 1297 user_environ = os.environ.copy()
1239 try: 1298 try:
1240 del user_environ['ENV'] 1299 del user_environ['ENV']
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 if context.options['soname'] == 'on': 1333 if context.options['soname'] == 'on':
1275 soname = GetSpecificSONAME() 1334 soname = GetSpecificSONAME()
1276 if soname == '': 1335 if soname == '':
1277 soname = 'lib' + library_name + '.so' 1336 soname = 'lib' + library_name + '.so'
1278 env['SONAME'] = soname 1337 env['SONAME'] = soname
1279 1338
1280 # Build the object files by invoking SCons recursively. 1339 # Build the object files by invoking SCons recursively.
1281 (object_files, shell_files, mksnapshot, preparser_files) = env.SConscript( 1340 (object_files, shell_files, mksnapshot, preparser_files) = env.SConscript(
1282 join('src', 'SConscript'), 1341 join('src', 'SConscript'),
1283 build_dir=join('obj', target_id), 1342 build_dir=join('obj', target_id),
1284 exports='context', 1343 exports='context tools',
1285 duplicate=False 1344 duplicate=False
1286 ) 1345 )
1287 1346
1288 context.mksnapshot_targets.append(mksnapshot) 1347 context.mksnapshot_targets.append(mksnapshot)
1289 1348
1290 # Link the object files into a library. 1349 # Link the object files into a library.
1291 env.Replace(**context.flags['v8']) 1350 env.Replace(**context.flags['v8'])
1292 1351
1293 context.ApplyEnvOverrides(env) 1352 context.ApplyEnvOverrides(env)
1294 if context.options['library'] == 'static': 1353 if context.options['library'] == 'static':
1295 library = env.StaticLibrary(library_name, object_files) 1354 library = env.StaticLibrary(library_name, object_files)
1296 preparser_library = env.StaticLibrary(preparser_library_name, 1355 preparser_library = env.StaticLibrary(preparser_library_name,
1297 preparser_files) 1356 preparser_files)
1298 else: 1357 else:
1299 # There seems to be a glitch in the way scons decides where to put 1358 # There seems to be a glitch in the way scons decides where to put
1300 # PDB files when compiling using MSVC so we specify it manually. 1359 # PDB files when compiling using MSVC so we specify it manually.
1301 # This should not affect any other platforms. 1360 # This should not affect any other platforms.
1302 pdb_name = library_name + '.dll.pdb' 1361 pdb_name = library_name + '.dll.pdb'
1303 library = env.SharedLibrary(library_name, object_files, PDB=pdb_name) 1362 library = env.SharedLibrary(library_name, object_files, PDB=pdb_name)
1304 preparser_pdb_name = preparser_library_name + '.dll.pdb'; 1363 preparser_pdb_name = preparser_library_name + '.dll.pdb';
1305 preparser_library = env.SharedLibrary(preparser_library_name, 1364 preparser_library = env.SharedLibrary(preparser_library_name,
1306 preparser_files, 1365 preparser_files,
1307 PDB=preparser_pdb_name) 1366 PDB=preparser_pdb_name)
1308 context.library_targets.append(library) 1367 context.library_targets.append(library)
1309 context.library_targets.append(preparser_library) 1368 context.library_targets.append(preparser_library)
1310 1369
1311 d8_env = Environment() 1370 d8_env = Environment(tools=tools)
1312 d8_env.Replace(**context.flags['d8']) 1371 d8_env.Replace(**context.flags['d8'])
1313 context.ApplyEnvOverrides(d8_env) 1372 context.ApplyEnvOverrides(d8_env)
1314 shell = d8_env.Program('d8' + suffix, object_files + shell_files) 1373 shell = d8_env.Program('d8' + suffix, object_files + shell_files)
1315 context.d8_targets.append(shell) 1374 context.d8_targets.append(shell)
1316 1375
1317 for sample in context.samples: 1376 for sample in context.samples:
1318 sample_env = Environment() 1377 sample_env = Environment(tools=tools)
1319 sample_env.Replace(**context.flags['sample']) 1378 sample_env.Replace(**context.flags['sample'])
1320 sample_env.Prepend(LIBS=[library_name]) 1379 sample_env.Prepend(LIBS=[library_name])
1321 context.ApplyEnvOverrides(sample_env) 1380 context.ApplyEnvOverrides(sample_env)
1322 sample_object = sample_env.SConscript( 1381 sample_object = sample_env.SConscript(
1323 join('samples', 'SConscript'), 1382 join('samples', 'SConscript'),
1324 build_dir=join('obj', 'sample', sample, target_id), 1383 build_dir=join('obj', 'sample', sample, target_id),
1325 exports='sample context', 1384 exports='sample context tools',
1326 duplicate=False 1385 duplicate=False
1327 ) 1386 )
1328 sample_name = sample + suffix 1387 sample_name = sample + suffix
1329 sample_program = sample_env.Program(sample_name, sample_object) 1388 sample_program = sample_env.Program(sample_name, sample_object)
1330 sample_env.Depends(sample_program, library) 1389 sample_env.Depends(sample_program, library)
1331 context.sample_targets.append(sample_program) 1390 context.sample_targets.append(sample_program)
1332 1391
1333 cctest_env = env.Copy() 1392 cctest_env = env.Copy()
1334 cctest_env.Prepend(LIBS=[library_name]) 1393 cctest_env.Prepend(LIBS=[library_name])
1335 cctest_program = cctest_env.SConscript( 1394 cctest_program = cctest_env.SConscript(
1336 join('test', 'cctest', 'SConscript'), 1395 join('test', 'cctest', 'SConscript'),
1337 build_dir=join('obj', 'test', target_id), 1396 build_dir=join('obj', 'test', target_id),
1338 exports='context object_files', 1397 exports='context object_files tools',
1339 duplicate=False 1398 duplicate=False
1340 ) 1399 )
1341 context.cctest_targets.append(cctest_program) 1400 context.cctest_targets.append(cctest_program)
1342 1401
1343 preparser_env = env.Copy() 1402 preparser_env = env.Copy()
1344 preparser_env.Replace(**context.flags['preparser']) 1403 preparser_env.Replace(**context.flags['preparser'])
1345 preparser_env.Prepend(LIBS=[preparser_library_name]) 1404 preparser_env.Prepend(LIBS=[preparser_library_name])
1346 context.ApplyEnvOverrides(preparser_env) 1405 context.ApplyEnvOverrides(preparser_env)
1347 preparser_object = preparser_env.SConscript( 1406 preparser_object = preparser_env.SConscript(
1348 join('preparser', 'SConscript'), 1407 join('preparser', 'SConscript'),
1349 build_dir=join('obj', 'preparser', target_id), 1408 build_dir=join('obj', 'preparser', target_id),
1350 exports='context', 1409 exports='context',
1351 duplicate=False 1410 duplicate=False
1352 ) 1411 )
1353 preparser_name = join('obj', 'preparser', target_id, 'preparser' + suffix) 1412 preparser_name = join('obj', 'preparser', target_id, 'preparser')
1354 preparser_program = preparser_env.Program(preparser_name, preparser_object); 1413 preparser_program = preparser_env.Program(preparser_name, preparser_object);
1355 preparser_env.Depends(preparser_program, preparser_library) 1414 preparser_env.Depends(preparser_program, preparser_library)
1356 context.preparser_targets.append(preparser_program) 1415 context.preparser_targets.append(preparser_program)
1357 1416
1358 return context 1417 return context
1359 1418
1360 1419
1361 def Build(): 1420 def Build():
1362 opts = GetOptions() 1421 opts = GetOptions()
1363 env = Environment(options=opts) 1422 tools = GetTools(opts)
1423 env = Environment(options=opts, tools=tools)
1424
1364 Help(opts.GenerateHelpText(env)) 1425 Help(opts.GenerateHelpText(env))
1365 VerifyOptions(env) 1426 VerifyOptions(env)
1366 env_overrides = ParseEnvOverrides(env['env'], env['importenv']) 1427 env_overrides = ParseEnvOverrides(env['env'], env['importenv'])
1367 1428
1368 SourceSignatures(env['sourcesignatures']) 1429 SourceSignatures(env['sourcesignatures'])
1369 1430
1370 libraries = [] 1431 libraries = []
1371 mksnapshots = [] 1432 mksnapshots = []
1372 cctests = [] 1433 cctests = []
1373 samples = [] 1434 samples = []
1374 preparsers = [] 1435 preparsers = []
1375 d8s = [] 1436 d8s = []
1376 modes = SplitList(env['mode']) 1437 modes = SplitList(env['mode'])
1377 for mode in modes: 1438 for mode in modes:
1378 context = BuildSpecific(env.Copy(), mode, env_overrides) 1439 context = BuildSpecific(env.Copy(), mode, env_overrides, tools)
1379 libraries += context.library_targets 1440 libraries += context.library_targets
1380 mksnapshots += context.mksnapshot_targets 1441 mksnapshots += context.mksnapshot_targets
1381 cctests += context.cctest_targets 1442 cctests += context.cctest_targets
1382 samples += context.sample_targets 1443 samples += context.sample_targets
1383 preparsers += context.preparser_targets 1444 preparsers += context.preparser_targets
1384 d8s += context.d8_targets 1445 d8s += context.d8_targets
1385 1446
1386 env.Alias('library', libraries) 1447 env.Alias('library', libraries)
1387 env.Alias('mksnapshot', mksnapshots) 1448 env.Alias('mksnapshot', mksnapshots)
1388 env.Alias('cctests', cctests) 1449 env.Alias('cctests', cctests)
(...skipping 14 matching lines...) Expand all
1403 # version of scons. Also, there's a bug in some revisions that 1464 # version of scons. Also, there's a bug in some revisions that
1404 # doesn't allow this flag to be set, so we swallow any exceptions. 1465 # doesn't allow this flag to be set, so we swallow any exceptions.
1405 # Lovely. 1466 # Lovely.
1406 try: 1467 try:
1407 SetOption('warn', 'no-deprecated') 1468 SetOption('warn', 'no-deprecated')
1408 except: 1469 except:
1409 pass 1470 pass
1410 1471
1411 1472
1412 Build() 1473 Build()
OLDNEW
« 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