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

Side by Side Diff: SConstruct

Issue 6759025: Version 3.2.6 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
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-profiler.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
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 'unalignedaccesses:off' : { 217 'unalignedaccesses:off' : {
218 'CPPDEFINES' : ['CAN_USE_UNALIGNED_ACCESSES=0'] 218 'CPPDEFINES' : ['CAN_USE_UNALIGNED_ACCESSES=0']
219 } 219 }
220 }, 220 },
221 'simulator:arm': { 221 'simulator:arm': {
222 'CCFLAGS': ['-m32'], 222 'CCFLAGS': ['-m32'],
223 'LINKFLAGS': ['-m32'], 223 'LINKFLAGS': ['-m32'],
224 }, 224 },
225 'arch:mips': { 225 'arch:mips': {
226 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'], 226 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'],
227 'mips_arch_variant:mips32r2': {
228 'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2']
229 },
227 'simulator:none': { 230 'simulator:none': {
228 'CCFLAGS': ['-EL', '-mips32r2', '-Wa,-mips32r2', '-fno-inline'], 231 'CCFLAGS': ['-EL'],
229 'LDFLAGS': ['-EL'] 232 'LINKFLAGS': ['-EL'],
233 'mips_arch_variant:mips32r2': {
234 'CCFLAGS': ['-mips32r2', '-Wa,-mips32r2']
235 },
236 'mips_arch_variant:mips32r1': {
237 'CCFLAGS': ['-mips32', '-Wa,-mips32']
238 },
239 'library:static': {
240 'LINKFLAGS': ['-static', '-static-libgcc']
241 },
242 'mipsabi:softfloat': {
243 'CCFLAGS': ['-msoft-float'],
244 'LINKFLAGS': ['-msoft-float']
245 },
246 'mipsabi:hardfloat': {
247 'CCFLAGS': ['-mhard-float'],
248 'LINKFLAGS': ['-mhard-float']
249 }
230 } 250 }
231 }, 251 },
232 'simulator:mips': { 252 'simulator:mips': {
233 'CCFLAGS': ['-m32'], 253 'CCFLAGS': ['-m32'],
234 'LINKFLAGS': ['-m32'], 254 'LINKFLAGS': ['-m32'],
255 'mipsabi:softfloat': {
256 'CPPDEFINES': ['__mips_soft_float=1'],
257 }
235 }, 258 },
236 'arch:x64': { 259 'arch:x64': {
237 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], 260 'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
238 'CCFLAGS': ['-m64'], 261 'CCFLAGS': ['-m64'],
239 'LINKFLAGS': ['-m64'], 262 'LINKFLAGS': ['-m64'],
240 }, 263 },
241 'gdbjit:on': { 264 'gdbjit:on': {
242 'CPPDEFINES': ['ENABLE_GDB_JIT_INTERFACE'] 265 'CPPDEFINES': ['ENABLE_GDB_JIT_INTERFACE']
243 } 266 }
244 }, 267 },
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 'LIBS': ['winmm', 'ws2_32'] 361 'LIBS': ['winmm', 'ws2_32']
339 }, 362 },
340 'arch:arm': { 363 'arch:arm': {
341 'CPPDEFINES': ['V8_TARGET_ARCH_ARM'], 364 'CPPDEFINES': ['V8_TARGET_ARCH_ARM'],
342 # /wd4996 is to silence the warning about sscanf 365 # /wd4996 is to silence the warning about sscanf
343 # used by the arm simulator. 366 # used by the arm simulator.
344 'WARNINGFLAGS': ['/wd4996'] 367 'WARNINGFLAGS': ['/wd4996']
345 }, 368 },
346 'arch:mips': { 369 'arch:mips': {
347 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'], 370 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'],
371 'mips_arch_variant:mips32r2': {
372 'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2']
373 },
348 }, 374 },
349 'disassembler:on': { 375 'disassembler:on': {
350 'CPPDEFINES': ['ENABLE_DISASSEMBLER'] 376 'CPPDEFINES': ['ENABLE_DISASSEMBLER']
351 } 377 }
352 } 378 }
353 } 379 }
354 380
355 381
356 MKSNAPSHOT_EXTRA_FLAGS = { 382 MKSNAPSHOT_EXTRA_FLAGS = {
357 'gcc': { 383 'gcc': {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 'LIBPATH': ['.'], 497 'LIBPATH': ['.'],
472 'CCFLAGS': ['-fno-rtti', '-fno-exceptions'] 498 'CCFLAGS': ['-fno-rtti', '-fno-exceptions']
473 }, 499 },
474 'os:linux': { 500 'os:linux': {
475 'LIBS': ['pthread'], 501 'LIBS': ['pthread'],
476 }, 502 },
477 'os:macos': { 503 'os:macos': {
478 'LIBS': ['pthread'], 504 'LIBS': ['pthread'],
479 }, 505 },
480 'os:freebsd': { 506 'os:freebsd': {
481 'LIBPATH' : ['/usr/local/lib'], 507 'LIBPATH' : ['/usr/local/lib'],
482 'LIBS': ['execinfo', 'pthread'] 508 'LIBS': ['execinfo', 'pthread']
483 }, 509 },
484 'os:solaris': { 510 'os:solaris': {
485 'LIBPATH' : ['/usr/local/lib'], 511 'LIBPATH' : ['/usr/local/lib'],
486 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], 512 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'],
487 'LINKFLAGS': ['-mt'] 513 'LINKFLAGS': ['-mt']
488 }, 514 },
489 'os:openbsd': { 515 'os:openbsd': {
490 'LIBPATH' : ['/usr/local/lib'], 516 'LIBPATH' : ['/usr/local/lib'],
491 'LIBS': ['execinfo', 'pthread'] 517 'LIBS': ['execinfo', 'pthread']
492 }, 518 },
493 'os:win32': { 519 'os:win32': {
494 'LIBS': ['winmm', 'ws2_32'] 520 'LIBS': ['winmm', 'ws2_32']
495 }, 521 },
496 'os:android': { 522 'os:android': {
497 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__', 523 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__',
498 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], 524 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'],
499 'CCFLAGS': ANDROID_FLAGS, 525 'CCFLAGS': ANDROID_FLAGS,
500 'CPPPATH': ANDROID_INCLUDES, 526 'CPPPATH': ANDROID_INCLUDES,
501 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib', 527 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib',
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 'CCFLAGS': ['/MTd'] 622 'CCFLAGS': ['/MTd']
597 }, 623 },
598 'msvcrt:shared': { 624 'msvcrt:shared': {
599 'CCFLAGS': ['/MDd'] 625 'CCFLAGS': ['/MDd']
600 } 626 }
601 } 627 }
602 } 628 }
603 } 629 }
604 630
605 631
632 PREPARSER_FLAGS = {
633 'all': {
634 'CPPPATH': [join(abspath('.'), 'include'), join(abspath('.'), 'src')]
635 },
636 'gcc': {
637 'all': {
638 'LIBPATH': ['.'],
639 'CCFLAGS': ['-fno-rtti', '-fno-exceptions']
640 },
641 'os:win32': {
642 'LIBS': ['winmm', 'ws2_32']
643 },
644 'os:android': {
645 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__',
646 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'],
647 'CCFLAGS': ANDROID_FLAGS,
648 'CPPPATH': ANDROID_INCLUDES,
649 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib',
650 ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4. 0/lib/gcc/arm-eabi/4.4.0/interwork'],
651 'LINKFLAGS': ANDROID_LINKFLAGS,
652 'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'],
653 'mode:release': {
654 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
655 }
656 },
657 'arch:arm': {
658 'LINKFLAGS': ARM_LINK_FLAGS
659 },
660 'arch:ia32': {
661 'CCFLAGS': ['-m32'],
662 'LINKFLAGS': ['-m32']
663 },
664 'arch:x64': {
665 'CCFLAGS': ['-m64'],
666 'LINKFLAGS': ['-m64']
667 },
668 'arch:mips': {
669 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'],
670 'mips_arch_variant:mips32r2': {
671 'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2']
672 },
673 'simulator:none': {
674 'CCFLAGS': ['-EL'],
675 'LINKFLAGS': ['-EL'],
676 'mips_arch_variant:mips32r2': {
677 'CCFLAGS': ['-mips32r2', '-Wa,-mips32r2']
678 },
679 'mips_arch_variant:mips32r1': {
680 'CCFLAGS': ['-mips32', '-Wa,-mips32']
681 },
682 'library:static': {
683 'LINKFLAGS': ['-static', '-static-libgcc']
684 },
685 'mipsabi:softfloat': {
686 'CCFLAGS': ['-msoft-float'],
687 'LINKFLAGS': ['-msoft-float']
688 },
689 'mipsabi:hardfloat': {
690 'CCFLAGS': ['-mhard-float'],
691 'LINKFLAGS': ['-mhard-float']
692 }
693 }
694 },
695 'simulator:arm': {
696 'CCFLAGS': ['-m32'],
697 'LINKFLAGS': ['-m32']
698 },
699 'simulator:mips': {
700 'CCFLAGS': ['-m32'],
701 'LINKFLAGS': ['-m32'],
702 'mipsabi:softfloat': {
703 'CPPDEFINES': ['__mips_soft_float=1'],
704 }
705 },
706 'mode:release': {
707 'CCFLAGS': ['-O2']
708 },
709 'mode:debug': {
710 'CCFLAGS': ['-g', '-O0'],
711 'CPPDEFINES': ['DEBUG']
712 },
713 },
714 'msvc': {
715 'all': {
716 'LIBS': ['winmm', 'ws2_32']
717 },
718 'verbose:off': {
719 'CCFLAGS': ['/nologo'],
720 'LINKFLAGS': ['/NOLOGO']
721 },
722 'verbose:on': {
723 'LINKFLAGS': ['/VERBOSE']
724 },
725 'library:shared': {
726 'CPPDEFINES': ['USING_V8_SHARED']
727 },
728 'prof:on': {
729 'LINKFLAGS': ['/MAP']
730 },
731 'mode:release': {
732 'CCFLAGS': ['/O2'],
733 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'],
734 'msvcrt:static': {
735 'CCFLAGS': ['/MT']
736 },
737 'msvcrt:shared': {
738 'CCFLAGS': ['/MD']
739 },
740 'msvcltcg:on': {
741 'CCFLAGS': ['/GL'],
742 'pgo:off': {
743 'LINKFLAGS': ['/LTCG'],
744 },
745 },
746 'pgo:instrument': {
747 'LINKFLAGS': ['/LTCG:PGI']
748 },
749 'pgo:optimize': {
750 'LINKFLAGS': ['/LTCG:PGO']
751 }
752 },
753 'arch:ia32': {
754 'CPPDEFINES': ['V8_TARGET_ARCH_IA32', 'WIN32'],
755 'LINKFLAGS': ['/MACHINE:X86']
756 },
757 'arch:x64': {
758 'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'],
759 'LINKFLAGS': ['/MACHINE:X64', '/STACK:2091752']
760 },
761 'mode:debug': {
762 'CCFLAGS': ['/Od'],
763 'LINKFLAGS': ['/DEBUG'],
764 'CPPDEFINES': ['DEBUG'],
765 'msvcrt:static': {
766 'CCFLAGS': ['/MTd']
767 },
768 'msvcrt:shared': {
769 'CCFLAGS': ['/MDd']
770 }
771 }
772 }
773 }
774
775
606 D8_FLAGS = { 776 D8_FLAGS = {
607 'gcc': { 777 'gcc': {
608 'console:readline': { 778 'console:readline': {
609 'LIBS': ['readline'] 779 'LIBS': ['readline']
610 }, 780 },
611 'os:linux': { 781 'os:linux': {
612 'LIBS': ['pthread'], 782 'LIBS': ['pthread'],
613 }, 783 },
614 'os:macos': { 784 'os:macos': {
615 'LIBS': ['pthread'], 785 'LIBS': ['pthread'],
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 }, 981 },
812 'visibility': { 982 'visibility': {
813 'values': ['default', 'hidden'], 983 'values': ['default', 'hidden'],
814 'default': VISIBILITY_GUESS, 984 'default': VISIBILITY_GUESS,
815 'help': 'shared library symbol visibility (%s)' % VISIBILITY_GUESS 985 'help': 'shared library symbol visibility (%s)' % VISIBILITY_GUESS
816 }, 986 },
817 'pgo': { 987 'pgo': {
818 'values': ['off', 'instrument', 'optimize'], 988 'values': ['off', 'instrument', 'optimize'],
819 'default': 'off', 989 'default': 'off',
820 'help': 'select profile guided optimization variant', 990 'help': 'select profile guided optimization variant',
991 },
992 'mipsabi': {
993 'values': ['hardfloat', 'softfloat', 'none'],
994 'default': 'hardfloat',
995 'help': 'generate calling conventiont according to selected mips ABI'
996 },
997 'mips_arch_variant': {
998 'values': ['mips32r2', 'mips32r1'],
999 'default': 'mips32r2',
1000 'help': 'mips variant'
821 } 1001 }
822 } 1002 }
823 1003
824 1004
825 def GetOptions(): 1005 def GetOptions():
826 result = Options() 1006 result = Options()
827 result.Add('mode', 'compilation mode (debug, release)', 'release') 1007 result.Add('mode', 'compilation mode (debug, release)', 'release')
828 result.Add('sample', 'build sample (shell, process, lineprocessor)', '') 1008 result.Add('sample', 'build sample (shell, process, lineprocessor)', '')
829 result.Add('cache', 'directory to use for scons build cache', '') 1009 result.Add('cache', 'directory to use for scons build cache', '')
830 result.Add('env', 'override environment settings (NAME0:value0,NAME1:value1,.. .)', '') 1010 result.Add('env', 'override environment settings (NAME0:value0,NAME1:value1,.. .)', '')
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 1109
930 def __init__(self, options, env_overrides, samples): 1110 def __init__(self, options, env_overrides, samples):
931 self.library_targets = [] 1111 self.library_targets = []
932 self.mksnapshot_targets = [] 1112 self.mksnapshot_targets = []
933 self.cctest_targets = [] 1113 self.cctest_targets = []
934 self.sample_targets = [] 1114 self.sample_targets = []
935 self.d8_targets = [] 1115 self.d8_targets = []
936 self.options = options 1116 self.options = options
937 self.env_overrides = env_overrides 1117 self.env_overrides = env_overrides
938 self.samples = samples 1118 self.samples = samples
1119 self.preparser_targets = []
939 self.use_snapshot = (options['snapshot'] != 'off') 1120 self.use_snapshot = (options['snapshot'] != 'off')
940 self.build_snapshot = (options['snapshot'] == 'on') 1121 self.build_snapshot = (options['snapshot'] == 'on')
941 self.flags = None 1122 self.flags = None
942 1123
943 def AddRelevantFlags(self, initial, flags): 1124 def AddRelevantFlags(self, initial, flags):
944 result = initial.copy() 1125 result = initial.copy()
945 toolchain = self.options['toolchain'] 1126 toolchain = self.options['toolchain']
946 if toolchain in flags: 1127 if toolchain in flags:
947 self.AppendFlags(result, flags[toolchain].get('all')) 1128 self.AppendFlags(result, flags[toolchain].get('all'))
948 for option in sorted(self.options.keys()): 1129 for option in sorted(self.options.keys()):
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 print "Warning: forcing architecture to match simulator (%s)" % options['s imulator'] 1188 print "Warning: forcing architecture to match simulator (%s)" % options['s imulator']
1008 options['arch'] = options['simulator'] 1189 options['arch'] = options['simulator']
1009 if (options['prof'] != 'off') and (options['profilingsupport'] == 'off'): 1190 if (options['prof'] != 'off') and (options['profilingsupport'] == 'off'):
1010 # Print a warning if profiling is enabled without profiling support 1191 # Print a warning if profiling is enabled without profiling support
1011 print "Warning: forcing profilingsupport on when prof is on" 1192 print "Warning: forcing profilingsupport on when prof is on"
1012 options['profilingsupport'] = 'on' 1193 options['profilingsupport'] = 'on'
1013 if os == 'win32' and options['pgo'] != 'off' and options['msvcltcg'] == 'off': 1194 if os == 'win32' and options['pgo'] != 'off' and options['msvcltcg'] == 'off':
1014 if 'msvcltcg' in ARGUMENTS: 1195 if 'msvcltcg' in ARGUMENTS:
1015 print "Warning: forcing msvcltcg on as it is required for pgo (%s)" % opti ons['pgo'] 1196 print "Warning: forcing msvcltcg on as it is required for pgo (%s)" % opti ons['pgo']
1016 options['msvcltcg'] = 'on' 1197 options['msvcltcg'] = 'on'
1017 if options['arch'] == 'mips': 1198 if (options['simulator'] == 'mips' and options['mipsabi'] != 'softfloat'):
1018 if ('regexp' in ARGUMENTS) and options['regexp'] == 'native': 1199 # Print a warning if soft-float ABI is not selected for mips simulator
1019 # Print a warning if native regexp is specified for mips 1200 print "Warning: forcing soft-float mips ABI when running on simulator"
1020 print "Warning: forcing regexp to interpreted for mips" 1201 options['mipsabi'] = 'softfloat'
1021 options['regexp'] = 'interpreted' 1202 if (options['mipsabi'] != 'none') and (options['arch'] != 'mips') and (optio ns['simulator'] != 'mips'):
1203 options['mipsabi'] = 'none'
1022 if options['liveobjectlist'] == 'on': 1204 if options['liveobjectlist'] == 'on':
1023 if (options['debuggersupport'] != 'on') or (options['mode'] == 'release'): 1205 if (options['debuggersupport'] != 'on') or (options['mode'] == 'release'):
1024 # Print a warning that liveobjectlist will implicitly enable the debugger 1206 # Print a warning that liveobjectlist will implicitly enable the debugger
1025 print "Warning: forcing debuggersupport on for liveobjectlist" 1207 print "Warning: forcing debuggersupport on for liveobjectlist"
1026 options['debuggersupport'] = 'on' 1208 options['debuggersupport'] = 'on'
1027 options['inspector'] = 'on' 1209 options['inspector'] = 'on'
1028 options['objectprint'] = 'on' 1210 options['objectprint'] = 'on'
1029 1211
1030 1212
1031 def ParseEnvOverrides(arg, imports): 1213 def ParseEnvOverrides(arg, imports):
(...skipping 26 matching lines...) Expand all
1058 del user_environ['ENV'] 1240 del user_environ['ENV']
1059 except KeyError: 1241 except KeyError:
1060 pass 1242 pass
1061 1243
1062 library_flags = context.AddRelevantFlags(user_environ, LIBRARY_FLAGS) 1244 library_flags = context.AddRelevantFlags(user_environ, LIBRARY_FLAGS)
1063 v8_flags = context.AddRelevantFlags(library_flags, V8_EXTRA_FLAGS) 1245 v8_flags = context.AddRelevantFlags(library_flags, V8_EXTRA_FLAGS)
1064 mksnapshot_flags = context.AddRelevantFlags(library_flags, MKSNAPSHOT_EXTRA_FL AGS) 1246 mksnapshot_flags = context.AddRelevantFlags(library_flags, MKSNAPSHOT_EXTRA_FL AGS)
1065 dtoa_flags = context.AddRelevantFlags(library_flags, DTOA_EXTRA_FLAGS) 1247 dtoa_flags = context.AddRelevantFlags(library_flags, DTOA_EXTRA_FLAGS)
1066 cctest_flags = context.AddRelevantFlags(v8_flags, CCTEST_EXTRA_FLAGS) 1248 cctest_flags = context.AddRelevantFlags(v8_flags, CCTEST_EXTRA_FLAGS)
1067 sample_flags = context.AddRelevantFlags(user_environ, SAMPLE_FLAGS) 1249 sample_flags = context.AddRelevantFlags(user_environ, SAMPLE_FLAGS)
1250 preparser_flags = context.AddRelevantFlags(user_environ, PREPARSER_FLAGS)
1068 d8_flags = context.AddRelevantFlags(library_flags, D8_FLAGS) 1251 d8_flags = context.AddRelevantFlags(library_flags, D8_FLAGS)
1069 1252
1070 context.flags = { 1253 context.flags = {
1071 'v8': v8_flags, 1254 'v8': v8_flags,
1072 'mksnapshot': mksnapshot_flags, 1255 'mksnapshot': mksnapshot_flags,
1073 'dtoa': dtoa_flags, 1256 'dtoa': dtoa_flags,
1074 'cctest': cctest_flags, 1257 'cctest': cctest_flags,
1075 'sample': sample_flags, 1258 'sample': sample_flags,
1076 'd8': d8_flags 1259 'd8': d8_flags,
1260 'preparser': preparser_flags
1077 } 1261 }
1078 1262
1079 # Generate library base name. 1263 # Generate library base name.
1080 target_id = mode 1264 target_id = mode
1081 suffix = SUFFIXES[target_id] 1265 suffix = SUFFIXES[target_id]
1082 library_name = 'v8' + suffix 1266 library_name = 'v8' + suffix
1267 preparser_library_name = 'v8preparser' + suffix
1083 version = GetVersion() 1268 version = GetVersion()
1084 if context.options['soname'] == 'on': 1269 if context.options['soname'] == 'on':
1085 # When building shared object with SONAME version the library name. 1270 # When building shared object with SONAME version the library name.
1086 library_name += '-' + version 1271 library_name += '-' + version
1087 1272
1088 # Generate library SONAME if required by the build. 1273 # Generate library SONAME if required by the build.
1089 if context.options['soname'] == 'on': 1274 if context.options['soname'] == 'on':
1090 soname = GetSpecificSONAME() 1275 soname = GetSpecificSONAME()
1091 if soname == '': 1276 if soname == '':
1092 soname = 'lib' + library_name + '.so' 1277 soname = 'lib' + library_name + '.so'
1093 env['SONAME'] = soname 1278 env['SONAME'] = soname
1094 1279
1095 # Build the object files by invoking SCons recursively. 1280 # Build the object files by invoking SCons recursively.
1096 (object_files, shell_files, mksnapshot) = env.SConscript( 1281 (object_files, shell_files, mksnapshot, preparser_files) = env.SConscript(
1097 join('src', 'SConscript'), 1282 join('src', 'SConscript'),
1098 build_dir=join('obj', target_id), 1283 build_dir=join('obj', target_id),
1099 exports='context', 1284 exports='context',
1100 duplicate=False 1285 duplicate=False
1101 ) 1286 )
1102 1287
1103 context.mksnapshot_targets.append(mksnapshot) 1288 context.mksnapshot_targets.append(mksnapshot)
1104 1289
1105 # Link the object files into a library. 1290 # Link the object files into a library.
1106 env.Replace(**context.flags['v8']) 1291 env.Replace(**context.flags['v8'])
1107 1292
1108 context.ApplyEnvOverrides(env) 1293 context.ApplyEnvOverrides(env)
1109 if context.options['library'] == 'static': 1294 if context.options['library'] == 'static':
1110 library = env.StaticLibrary(library_name, object_files) 1295 library = env.StaticLibrary(library_name, object_files)
1296 preparser_library = env.StaticLibrary(preparser_library_name,
1297 preparser_files)
1111 else: 1298 else:
1112 # There seems to be a glitch in the way scons decides where to put 1299 # There seems to be a glitch in the way scons decides where to put
1113 # PDB files when compiling using MSVC so we specify it manually. 1300 # PDB files when compiling using MSVC so we specify it manually.
1114 # This should not affect any other platforms. 1301 # This should not affect any other platforms.
1115 pdb_name = library_name + '.dll.pdb' 1302 pdb_name = library_name + '.dll.pdb'
1116 library = env.SharedLibrary(library_name, object_files, PDB=pdb_name) 1303 library = env.SharedLibrary(library_name, object_files, PDB=pdb_name)
1304 preparser_pdb_name = preparser_library_name + '.dll.pdb';
1305 preparser_library = env.SharedLibrary(preparser_library_name,
1306 preparser_files,
1307 PDB=preparser_pdb_name)
1117 context.library_targets.append(library) 1308 context.library_targets.append(library)
1309 context.library_targets.append(preparser_library)
1118 1310
1119 d8_env = Environment() 1311 d8_env = Environment()
1120 d8_env.Replace(**context.flags['d8']) 1312 d8_env.Replace(**context.flags['d8'])
1121 context.ApplyEnvOverrides(d8_env) 1313 context.ApplyEnvOverrides(d8_env)
1122 shell = d8_env.Program('d8' + suffix, object_files + shell_files) 1314 shell = d8_env.Program('d8' + suffix, object_files + shell_files)
1123 context.d8_targets.append(shell) 1315 context.d8_targets.append(shell)
1124 1316
1125 for sample in context.samples: 1317 for sample in context.samples:
1126 sample_env = Environment() 1318 sample_env = Environment()
1127 sample_env.Replace(**context.flags['sample']) 1319 sample_env.Replace(**context.flags['sample'])
(...skipping 13 matching lines...) Expand all
1141 cctest_env = env.Copy() 1333 cctest_env = env.Copy()
1142 cctest_env.Prepend(LIBS=[library_name]) 1334 cctest_env.Prepend(LIBS=[library_name])
1143 cctest_program = cctest_env.SConscript( 1335 cctest_program = cctest_env.SConscript(
1144 join('test', 'cctest', 'SConscript'), 1336 join('test', 'cctest', 'SConscript'),
1145 build_dir=join('obj', 'test', target_id), 1337 build_dir=join('obj', 'test', target_id),
1146 exports='context object_files', 1338 exports='context object_files',
1147 duplicate=False 1339 duplicate=False
1148 ) 1340 )
1149 context.cctest_targets.append(cctest_program) 1341 context.cctest_targets.append(cctest_program)
1150 1342
1343 preparser_env = env.Copy()
1344 preparser_env.Replace(**context.flags['preparser'])
1345 preparser_env.Prepend(LIBS=[preparser_library_name])
1346 context.ApplyEnvOverrides(preparser_env)
1347 preparser_object = preparser_env.SConscript(
1348 join('preparser', 'SConscript'),
1349 build_dir=join('obj', 'preparser', target_id),
1350 exports='context',
1351 duplicate=False
1352 )
1353 preparser_name = join('obj', 'preparser', target_id, 'preparser' + suffix)
1354 preparser_program = preparser_env.Program(preparser_name, preparser_object);
1355 preparser_env.Depends(preparser_program, preparser_library)
1356 context.preparser_targets.append(preparser_program)
1357
1151 return context 1358 return context
1152 1359
1153 1360
1154 def Build(): 1361 def Build():
1155 opts = GetOptions() 1362 opts = GetOptions()
1156 env = Environment(options=opts) 1363 env = Environment(options=opts)
1157 Help(opts.GenerateHelpText(env)) 1364 Help(opts.GenerateHelpText(env))
1158 VerifyOptions(env) 1365 VerifyOptions(env)
1159 env_overrides = ParseEnvOverrides(env['env'], env['importenv']) 1366 env_overrides = ParseEnvOverrides(env['env'], env['importenv'])
1160 1367
1161 SourceSignatures(env['sourcesignatures']) 1368 SourceSignatures(env['sourcesignatures'])
1162 1369
1163 libraries = [] 1370 libraries = []
1164 mksnapshots = [] 1371 mksnapshots = []
1165 cctests = [] 1372 cctests = []
1166 samples = [] 1373 samples = []
1374 preparsers = []
1167 d8s = [] 1375 d8s = []
1168 modes = SplitList(env['mode']) 1376 modes = SplitList(env['mode'])
1169 for mode in modes: 1377 for mode in modes:
1170 context = BuildSpecific(env.Copy(), mode, env_overrides) 1378 context = BuildSpecific(env.Copy(), mode, env_overrides)
1171 libraries += context.library_targets 1379 libraries += context.library_targets
1172 mksnapshots += context.mksnapshot_targets 1380 mksnapshots += context.mksnapshot_targets
1173 cctests += context.cctest_targets 1381 cctests += context.cctest_targets
1174 samples += context.sample_targets 1382 samples += context.sample_targets
1383 preparsers += context.preparser_targets
1175 d8s += context.d8_targets 1384 d8s += context.d8_targets
1176 1385
1177 env.Alias('library', libraries) 1386 env.Alias('library', libraries)
1178 env.Alias('mksnapshot', mksnapshots) 1387 env.Alias('mksnapshot', mksnapshots)
1179 env.Alias('cctests', cctests) 1388 env.Alias('cctests', cctests)
1180 env.Alias('sample', samples) 1389 env.Alias('sample', samples)
1181 env.Alias('d8', d8s) 1390 env.Alias('d8', d8s)
1391 env.Alias('preparser', preparsers)
1182 1392
1183 if env['sample']: 1393 if env['sample']:
1184 env.Default('sample') 1394 env.Default('sample')
1185 else: 1395 else:
1186 env.Default('library') 1396 env.Default('library')
1187 1397
1188 if env['cache']: 1398 if env['cache']:
1189 CacheDir(env['cache']) 1399 CacheDir(env['cache'])
1190 1400
1191 # We disable deprecation warnings because we need to be able to use 1401 # We disable deprecation warnings because we need to be able to use
1192 # env.Copy without getting warnings for compatibility with older 1402 # env.Copy without getting warnings for compatibility with older
1193 # version of scons. Also, there's a bug in some revisions that 1403 # version of scons. Also, there's a bug in some revisions that
1194 # doesn't allow this flag to be set, so we swallow any exceptions. 1404 # doesn't allow this flag to be set, so we swallow any exceptions.
1195 # Lovely. 1405 # Lovely.
1196 try: 1406 try:
1197 SetOption('warn', 'no-deprecated') 1407 SetOption('warn', 'no-deprecated')
1198 except: 1408 except:
1199 pass 1409 pass
1200 1410
1201 1411
1202 Build() 1412 Build()
OLDNEW
« no previous file with comments | « ChangeLog ('k') | include/v8-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698