36
36
sys.path.insert(0, join(root_dir, 'tools'))
39
# ANDROID_TOP is the top of the Android checkout, fetched from the environment
40
# variable 'TOP'. You will also need to set the CXX, CC, AR and RANLIB
41
# environment variables to the cross-compiling tools.
42
ANDROID_TOP = os.environ.get('TOP')
43
if ANDROID_TOP is None:
46
39
# ARM_TARGET_LIB is the path to the dynamic library to use on the target
47
40
# machine if cross-compiling to an arm machine. You will also need to set
48
41
# the additional cross-compiling environment variables to the cross compiler.
58
51
GCC_EXTRA_CCFLAGS = []
59
52
GCC_DTOA_EXTRA_CCFLAGS = []
61
ANDROID_FLAGS = ['-march=armv7-a',
72
'-fno-inline-functions-called-once',
73
'-fgcse-after-reload',
74
'-frerun-cse-after-loop',
76
'-fomit-frame-pointer',
78
'-DCAN_USE_VFP_INSTRUCTIONS=1',
79
'-DCAN_USE_ARMV7_INSTRUCTIONS=1',
80
'-DCAN_USE_UNALIGNED_ACCESSES=1',
83
ANDROID_INCLUDES = [ANDROID_TOP + '/bionic/libc/arch-arm/include',
84
ANDROID_TOP + '/bionic/libc/include',
85
ANDROID_TOP + '/bionic/libstdc++/include',
86
ANDROID_TOP + '/bionic/libc/kernel/common',
87
ANDROID_TOP + '/bionic/libc/kernel/arch-arm',
88
ANDROID_TOP + '/bionic/libm/include',
89
ANDROID_TOP + '/bionic/libm/include/arch/arm',
90
ANDROID_TOP + '/bionic/libthread_db/include',
91
ANDROID_TOP + '/frameworks/base/include',
92
ANDROID_TOP + '/system/core/include']
94
ANDROID_LINKFLAGS = ['-nostdlib',
96
'-Wl,-T,' + ANDROID_TOP + '/build/core/armelf.x',
97
'-Wl,-dynamic-linker,/system/bin/linker',
100
'-Wl,-rpath-link=' + ANDROID_TOP + '/out/target/product/generic/obj/lib',
101
ANDROID_TOP + '/out/target/product/generic/obj/lib/crtbegin_dynamic.o',
102
ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork/libgcc.a',
103
ANDROID_TOP + '/out/target/product/generic/obj/lib/crtend_android.o'];
107
56
'CPPPATH': [join(root_dir, 'src')],
112
61
'CPPDEFINES': ['V8_ENABLE_CHECKS', 'OBJECT_PRINT']
115
'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING'],
117
63
'objectprint:on': {
118
64
'CPPDEFINES': ['OBJECT_PRINT'],
121
'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING', 'ENABLE_HEAP_PROTECTION'],
123
'profilingsupport:on': {
124
'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING', 'ENABLE_LOGGING_AND_PROFILING'],
126
66
'debuggersupport:on': {
127
67
'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT'],
130
70
'CPPDEFINES': ['INSPECTOR'],
73
'CPPDEFINES': ['V8_NO_FAST_TLS'],
132
75
'liveobjectlist:on': {
133
76
'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT', 'INSPECTOR',
134
77
'LIVE_OBJECT_LIST', 'OBJECT_PRINT'],
150
93
'CCFLAGS': ['-g', '-O0'],
151
94
'CPPDEFINES': ['ENABLE_DISASSEMBLER', 'DEBUG'],
153
'CCFLAGS': ['-mthumb']
157
97
'CCFLAGS': ['-O3', '-fomit-frame-pointer', '-fdata-sections',
158
98
'-ffunction-sections'],
160
'CCFLAGS': ['-mthumb', '-Os'],
161
'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
165
101
'CCFLAGS': ['-ansi'] + GCC_EXTRA_CCFLAGS,
190
127
'CPPDEFINES': ['__C99FEATURES__'],
191
128
'CPPPATH' : ['/usr/local/include'],
192
129
'LIBPATH' : ['/usr/local/lib'],
193
'CCFLAGS': ['-ansi'],
130
'CCFLAGS': ['-ansi', '-fno-omit-frame-pointer'],
196
133
'CCFLAGS': ['-DWIN32'],
197
134
'CXXFLAGS': ['-DWIN32'],
200
'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__',
201
'__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'],
202
'CCFLAGS': ANDROID_FLAGS,
203
'WARNINGFLAGS': ['-Wall', '-Wno-unused', '-Werror=return-type',
204
'-Wstrict-aliasing=2'],
205
'CPPPATH': ANDROID_INCLUDES,
208
137
'CPPDEFINES': ['V8_TARGET_ARCH_IA32'],
209
138
'CCFLAGS': ['-m32'],
217
146
'unalignedaccesses:off' : {
218
147
'CPPDEFINES' : ['CAN_USE_UNALIGNED_ACCESSES=0']
150
'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
152
'CCFLAGS': ['-mfloat-abi=soft'],
156
'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
158
'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']
161
'CCFLAGS': ['-mfloat-abi=softfp'],
165
'CPPDEFINES' : ['USE_EABI_HARDFLOAT=1'],
167
'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']
170
'CCFLAGS': ['-mfloat-abi=hard'],
221
174
'simulator:arm': {
226
179
'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'],
180
'mips_arch_variant:mips32r2': {
181
'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2']
227
183
'simulator:none': {
228
'CCFLAGS': ['-EL', '-mips32r2', '-Wa,-mips32r2', '-fno-inline'],
185
'LINKFLAGS': ['-EL'],
186
'mips_arch_variant:mips32r2': {
187
'CCFLAGS': ['-mips32r2', '-Wa,-mips32r2']
189
'mips_arch_variant:mips32r1': {
190
'CCFLAGS': ['-mips32', '-Wa,-mips32']
193
'LINKFLAGS': ['-static', '-static-libgcc']
195
'mipsabi:softfloat': {
196
'CCFLAGS': ['-msoft-float'],
197
'LINKFLAGS': ['-msoft-float']
199
'mipsabi:hardfloat': {
200
'CCFLAGS': ['-mhard-float'],
201
'LINKFLAGS': ['-mhard-float']
232
205
'simulator:mips': {
233
206
'CCFLAGS': ['-m32'],
234
207
'LINKFLAGS': ['-m32'],
208
'mipsabi:softfloat': {
209
'CPPDEFINES': ['__mips_soft_float=1'],
211
'mipsabi:hardfloat': {
212
'CPPDEFINES': ['__mips_hard_float=1'],
237
216
'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
242
221
'CPPDEFINES': ['ENABLE_GDB_JIT_INTERFACE']
223
'compress_startup_data:bz2': {
224
'CPPDEFINES': ['COMPRESS_STARTUP_DATA_BZ2']
247
229
'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
248
'CXXFLAGS': ['$CCFLAGS', '/GR-', '/Gy'],
230
'CXXFLAGS': ['/GR-', '/Gy'],
249
231
'CPPDEFINES': ['WIN32'],
250
232
'LINKFLAGS': ['/INCREMENTAL:NO', '/NXCOMPAT', '/IGNORE:4221'],
251
233
'CCPDBFLAGS': ['/Zi']
401
396
CCTEST_EXTRA_FLAGS = {
403
398
'CPPPATH': [join(root_dir, 'src')],
400
'CPPDEFINES': ['USING_V8_SHARED']
407
'LIBPATH': [abspath('.')]
405
'LIBPATH': [abspath('.')],
406
'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
407
'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'],
408
'LINKFLAGS': ['$CCFLAGS'],
410
411
'LIBS': ['pthread'],
412
'CCFLAGS': ['-Wno-unused-but-set-variable'],
413
415
'LIBS': ['pthread'],
426
428
'LIBS': ['winmm', 'ws2_32']
429
'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__',
430
'__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'],
431
'CCFLAGS': ANDROID_FLAGS,
432
'CPPPATH': ANDROID_INCLUDES,
433
'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib',
434
ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork'],
435
'LINKFLAGS': ANDROID_LINKFLAGS,
436
'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'],
438
'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
442
431
'LINKFLAGS': ARM_LINK_FLAGS
447
436
'CPPDEFINES': ['_HAS_EXCEPTIONS=0'],
448
437
'LIBS': ['winmm', 'ws2_32']
451
'CPPDEFINES': ['USING_V8_SHARED']
454
440
'CPPDEFINES': ['V8_TARGET_ARCH_IA32']
457
443
'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
458
'LINKFLAGS': ['/STACK:2091752']
444
'LINKFLAGS': ['/STACK:2097152']
466
452
'CPPPATH': [join(abspath('.'), 'include')],
454
'CPPDEFINES': ['USING_V8_SHARED']
471
'CCFLAGS': ['-fno-rtti', '-fno-exceptions']
460
'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
461
'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'],
462
'LINKFLAGS': ['$CCFLAGS'],
474
465
'LIBS': ['pthread'],
477
468
'LIBS': ['pthread'],
480
'LIBPATH' : ['/usr/local/lib'],
481
'LIBS': ['execinfo', 'pthread']
471
'LIBPATH' : ['/usr/local/lib'],
472
'LIBS': ['execinfo', 'pthread']
484
'LIBPATH' : ['/usr/local/lib'],
485
'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'],
475
# On Solaris, to get isinf, INFINITY, fpclassify and other macros one
476
# needs to define __C99FEATURES__.
477
'CPPDEFINES': ['__C99FEATURES__'],
478
'LIBPATH' : ['/usr/local/lib'],
479
'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'],
489
'LIBPATH' : ['/usr/local/lib'],
490
'LIBS': ['execinfo', 'pthread']
483
'LIBPATH' : ['/usr/local/lib'],
484
'LIBS': ['execinfo', 'pthread']
493
487
'LIBS': ['winmm', 'ws2_32']
496
'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__',
497
'__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'],
498
'CCFLAGS': ANDROID_FLAGS,
499
'CPPPATH': ANDROID_INCLUDES,
500
'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib',
501
ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork'],
502
'LINKFLAGS': ANDROID_LINKFLAGS,
503
'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'],
505
'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
509
'LINKFLAGS': ARM_LINK_FLAGS
490
'LINKFLAGS': ARM_LINK_FLAGS,
492
'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
494
'CCFLAGS': ['-mfloat-abi=soft'],
498
'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
500
'CCFLAGS': ['-mfloat-abi=softfp'],
504
'CPPDEFINES' : ['USE_EABI_HARDFLOAT=1'],
506
'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']
509
'CCFLAGS': ['-mfloat-abi=hard'],
512
514
'CCFLAGS': ['-m32'],
520
522
'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'],
523
'mips_arch_variant:mips32r2': {
524
'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2']
521
526
'simulator:none': {
522
'CCFLAGS': ['-EL', '-mips32r2', '-Wa,-mips32r2', '-fno-inline'],
523
528
'LINKFLAGS': ['-EL'],
529
'mips_arch_variant:mips32r2': {
530
'CCFLAGS': ['-mips32r2', '-Wa,-mips32r2']
532
'mips_arch_variant:mips32r1': {
533
'CCFLAGS': ['-mips32', '-Wa,-mips32']
536
'LINKFLAGS': ['-static', '-static-libgcc']
538
'mipsabi:softfloat': {
539
'CCFLAGS': ['-msoft-float'],
540
'LINKFLAGS': ['-msoft-float']
542
'mipsabi:hardfloat': {
543
'CCFLAGS': ['-mhard-float'],
544
'LINKFLAGS': ['-mhard-float']
527
548
'simulator:arm': {
552
579
'LINKFLAGS': ['/VERBOSE']
582
'LINKFLAGS': ['/MAP']
586
'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'],
596
'LINKFLAGS': ['/LTCG'],
600
'LINKFLAGS': ['/LTCG:PGI']
603
'LINKFLAGS': ['/LTCG:PGO']
607
'CPPDEFINES': ['V8_TARGET_ARCH_IA32', 'WIN32'],
608
'LINKFLAGS': ['/MACHINE:X86']
611
'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'],
612
'LINKFLAGS': ['/MACHINE:X64', '/STACK:2097152']
616
'LINKFLAGS': ['/DEBUG'],
617
'CPPDEFINES': ['DEBUG'],
631
'CPPPATH': [join(abspath('.'), 'include'), join(abspath('.'), 'src')],
554
632
'library:shared': {
555
633
'CPPDEFINES': ['USING_V8_SHARED']
639
'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
640
'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'],
641
'LINKFLAGS': ['$CCFLAGS'],
644
'LIBS': ['winmm', 'ws2_32']
647
'LINKFLAGS': ARM_LINK_FLAGS,
649
'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
651
'CCFLAGS': ['-mfloat-abi=soft'],
656
'CCFLAGS': ['-mfloat-abi=softfp'],
661
'CCFLAGS': ['-mfloat-abi=hard'],
667
'LINKFLAGS': ['-m32']
671
'LINKFLAGS': ['-m64']
674
'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'],
675
'mips_arch_variant:mips32r2': {
676
'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2']
680
'LINKFLAGS': ['-EL'],
681
'mips_arch_variant:mips32r2': {
682
'CCFLAGS': ['-mips32r2', '-Wa,-mips32r2']
684
'mips_arch_variant:mips32r1': {
685
'CCFLAGS': ['-mips32', '-Wa,-mips32']
688
'LINKFLAGS': ['-static', '-static-libgcc']
690
'mipsabi:softfloat': {
691
'CCFLAGS': ['-msoft-float'],
692
'LINKFLAGS': ['-msoft-float']
694
'mipsabi:hardfloat': {
695
'CCFLAGS': ['-mhard-float'],
696
'LINKFLAGS': ['-mhard-float']
702
'LINKFLAGS': ['-m32']
706
'LINKFLAGS': ['-m32'],
707
'mipsabi:softfloat': {
708
'CPPDEFINES': ['__mips_soft_float=1'],
710
'mipsabi:hardfloat': {
711
'CPPDEFINES': ['__mips_hard_float=1'],
718
'CCFLAGS': ['-g', '-O0'],
719
'CPPDEFINES': ['DEBUG']
722
'LIBPATH' : ['/usr/local/lib'],
727
'LIBS': ['winmm', 'ws2_32']
730
'CCFLAGS': ['/nologo'],
731
'LINKFLAGS': ['/NOLOGO']
734
'LINKFLAGS': ['/VERBOSE']
558
737
'LINKFLAGS': ['/MAP']
583
'CPPDEFINES': ['V8_TARGET_ARCH_IA32'],
762
'CPPDEFINES': ['V8_TARGET_ARCH_IA32', 'WIN32'],
584
763
'LINKFLAGS': ['/MACHINE:X86']
587
'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
588
'LINKFLAGS': ['/MACHINE:X64', '/STACK:2091752']
766
'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'],
767
'LINKFLAGS': ['/MACHINE:X64', '/STACK:2097152']
591
770
'CCFLAGS': ['/Od'],
624
815
'LIBS': ['pthread'],
627
'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib',
628
ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork'],
629
'LINKFLAGS': ANDROID_LINKFLAGS,
630
'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'],
633
818
'LIBS': ['winmm', 'ws2_32'],
636
821
'LINKFLAGS': ARM_LINK_FLAGS
823
'compress_startup_data:bz2': {
824
'CPPDEFINES': ['COMPRESS_STARTUP_DATA_BZ2'],
641
832
'LIBS': ['winmm', 'ws2_32']
835
'CCFLAGS': ['/nologo'],
836
'LINKFLAGS': ['/NOLOGO']
839
'LINKFLAGS': ['/VERBOSE']
842
'LINKFLAGS': ['/MAP']
846
'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'],
856
'LINKFLAGS': ['/LTCG'],
860
'LINKFLAGS': ['/LTCG:PGI']
863
'LINKFLAGS': ['/LTCG:PGO']
867
'CPPDEFINES': ['V8_TARGET_ARCH_IA32', 'WIN32'],
868
'LINKFLAGS': ['/MACHINE:X86']
871
'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'],
872
'LINKFLAGS': ['/MACHINE:X64', '/STACK:2097152']
876
'LINKFLAGS': ['/DEBUG'],
877
'CPPDEFINES': ['DEBUG'],
688
930
def GuessStrictAliasing(env):
689
# There seems to be a problem with gcc 4.5.x
690
# see http://code.google.com/p/v8/issues/detail?id=884
691
# it can be worked around by disabling strict aliasing
931
# There seems to be a problem with gcc 4.5.x.
932
# See http://code.google.com/p/v8/issues/detail?id=884
933
# It can be worked around by disabling strict aliasing.
692
934
toolchain = env['toolchain'];
693
935
if toolchain == 'gcc':
694
936
env = Environment(tools=['gcc'])
937
# The gcc version should be available in env['CCVERSION'],
938
# but when scons detects msvc this value is not set.
695
939
version = subprocess.Popen([env['CC'], '-dumpversion'],
696
940
stdout=subprocess.PIPE).communicate()[0]
697
941
if version.find('4.5') == 0:
948
'values': ['arm', 'ia32', 'x64', 'mips'],
950
'help': 'the architecture to build for'
953
'values': ['freebsd', 'linux', 'macos', 'win32', 'openbsd', 'solaris', 'cygwin'],
955
'help': 'the os to build for'
704
958
'values': ['gcc', 'msvc'],
705
959
'guess': GuessToolchain,
706
960
'help': 'the toolchain to use'
709
'values': ['freebsd', 'linux', 'macos', 'win32', 'android', 'openbsd', 'solaris', 'cygwin'],
711
'help': 'the os to build for'
714
'values':['arm', 'ia32', 'x64', 'mips'],
716
'help': 'the architecture to build for'
719
966
'values': ['native', 'interpreted'],
720
967
'default': 'native',
824
1067
'values': ['default', 'hidden'],
825
1068
'guess': GuessVisibility,
826
'depends': ['os', 'toolchain'],
827
1069
'help': 'shared library symbol visibility'
829
1071
'strictaliasing': {
830
1072
'values': ['default', 'off'],
831
1073
'guess': GuessStrictAliasing,
832
'depends': ['toolchain'],
833
1074
'help': 'assume strict aliasing while optimizing'
836
1077
'values': ['off', 'instrument', 'optimize'],
837
1078
'default': 'off',
838
1079
'help': 'select profile guided optimization variant',
1082
'values': ['hard', 'softfp', 'soft'],
1083
'default': 'softfp',
1084
'help': 'generate calling conventiont according to selected ARM EABI variant'
1087
'values': ['hardfloat', 'softfloat', 'none'],
1088
'default': 'hardfloat',
1089
'help': 'generate calling conventiont according to selected mips ABI'
1091
'mips_arch_variant': {
1092
'values': ['mips32r2', 'mips32r1'],
1093
'default': 'mips32r2',
1094
'help': 'mips variant'
1096
'compress_startup_data': {
1097
'values': ['off', 'bz2'],
1099
'help': 'compress startup data (snapshot) [Linux only]'
1102
'values': ['on', 'off'],
1104
'help': 'use vfp3 instructions when building the snapshot [Arm only]'
843
def AddOption(result, name, option):
844
if 'guess' in option:
845
# Option has a guess function
846
guess = option.get('guess')
847
guess_env = Environment(options=result)
848
# Check if all options that the guess function depends on are set
849
if 'depends' in option:
850
for dependency in option.get('depends'):
851
if not dependency in guess_env:
853
default = guess(guess_env)
855
# Option has a fixed default
856
default = option.get('default')
858
help = '%s (%s)' % (option.get('help'), ", ".join(option['values']))
859
result.Add(name, help, default)
1109
ALL_OPTIONS = dict(PLATFORM_OPTIONS, **SIMPLE_OPTIONS)
1112
def AddOptions(options, result):
1113
guess_env = Environment(options=result)
1114
for (name, option) in options.iteritems():
1115
if 'guess' in option:
1116
# Option has a guess function
1117
guess = option.get('guess')
1118
default = guess(guess_env)
1120
# Option has a fixed default
1121
default = option.get('default')
1122
help = '%s (%s)' % (option.get('help'), ", ".join(option['values']))
1123
result.Add(name, help, default)
863
1126
def GetOptions():
867
1130
result.Add('cache', 'directory to use for scons build cache', '')
868
1131
result.Add('env', 'override environment settings (NAME0:value0,NAME1:value1,...)', '')
869
1132
result.Add('importenv', 'import environment settings (NAME0,NAME1,...)', '')
870
options = SIMPLE_OPTIONS
873
for (name, option) in options.iteritems():
874
if not AddOption(result, name, option):
875
postpone[name] = option
1133
AddOptions(PLATFORM_OPTIONS, result)
1134
AddOptions(SIMPLE_OPTIONS, result)
955
1213
if env['os'] == 'win32' and env['library'] == 'shared' and env['prof'] == 'on':
956
1214
Abort("Profiling on windows only supported for static library.")
957
if env['gdbjit'] == 'on' and (env['os'] != 'linux' or (env['arch'] != 'ia32' and env['arch'] != 'x64' and env['arch'] != 'arm')):
958
Abort("GDBJIT interface is supported only for Intel-compatible (ia32 or x64) Linux target.")
1215
if env['gdbjit'] == 'on' and ((env['os'] != 'linux' and env['os'] != 'macos') or (env['arch'] != 'ia32' and env['arch'] != 'x64' and env['arch'] != 'arm')):
1216
Abort("GDBJIT interface is supported only for Intel-compatible (ia32 or x64) Linux/OSX target.")
959
1217
if env['os'] == 'win32' and env['soname'] == 'on':
960
1218
Abort("Shared Object soname not applicable for Windows.")
961
1219
if env['soname'] == 'on' and env['library'] == 'static':
968
1226
print env['arch']
969
1227
print env['simulator']
970
1228
Abort("Option unalignedaccesses only supported for the ARM architecture.")
971
for (name, option) in SIMPLE_OPTIONS.iteritems():
1229
if env['os'] != 'linux' and env['compress_startup_data'] != 'off':
1230
Abort("Startup data compression is only available on Linux")
1231
for (name, option) in ALL_OPTIONS.iteritems():
972
1232
if (not name in env):
973
1233
message = ("A value for option %s must be specified (%s)." %
974
1234
(name, ", ".join(option['values'])))
1068
1329
if 'msvcltcg' in ARGUMENTS:
1069
1330
print "Warning: forcing msvcltcg on as it is required for pgo (%s)" % options['pgo']
1070
1331
options['msvcltcg'] = 'on'
1071
if options['arch'] == 'mips':
1072
if ('regexp' in ARGUMENTS) and options['regexp'] == 'native':
1073
# Print a warning if native regexp is specified for mips
1074
print "Warning: forcing regexp to interpreted for mips"
1075
options['regexp'] = 'interpreted'
1332
if (options['mipsabi'] != 'none') and (options['arch'] != 'mips') and (options['simulator'] != 'mips'):
1333
options['mipsabi'] = 'none'
1076
1334
if options['liveobjectlist'] == 'on':
1077
1335
if (options['debuggersupport'] != 'on') or (options['mode'] == 'release'):
1078
1336
# Print a warning that liveobjectlist will implicitly enable the debugger
1147
1408
env['SONAME'] = soname
1149
1410
# Build the object files by invoking SCons recursively.
1150
(object_files, shell_files, mksnapshot) = env.SConscript(
1411
d8_env = Environment(tools=tools)
1412
d8_env.Replace(**context.flags['d8'])
1413
(object_files, shell_files, mksnapshot, preparser_files) = env.SConscript(
1151
1414
join('src', 'SConscript'),
1152
1415
build_dir=join('obj', target_id),
1153
exports='context tools',
1416
exports='context tools d8_env',
1154
1417
duplicate=False
1162
1425
context.ApplyEnvOverrides(env)
1163
1426
if context.options['library'] == 'static':
1164
1427
library = env.StaticLibrary(library_name, object_files)
1428
preparser_library = env.StaticLibrary(preparser_library_name,
1166
1431
# There seems to be a glitch in the way scons decides where to put
1167
1432
# PDB files when compiling using MSVC so we specify it manually.
1168
1433
# This should not affect any other platforms.
1169
1434
pdb_name = library_name + '.dll.pdb'
1170
1435
library = env.SharedLibrary(library_name, object_files, PDB=pdb_name)
1436
preparser_pdb_name = preparser_library_name + '.dll.pdb';
1437
preparser_soname = 'lib' + preparser_library_name + '.so';
1438
preparser_library = env.SharedLibrary(preparser_library_name,
1440
PDB=preparser_pdb_name,
1441
SONAME=preparser_soname)
1171
1442
context.library_targets.append(library)
1443
context.library_targets.append(preparser_library)
1173
d8_env = Environment(tools=tools)
1174
d8_env.Replace(**context.flags['d8'])
1175
1445
context.ApplyEnvOverrides(d8_env)
1176
shell = d8_env.Program('d8' + suffix, object_files + shell_files)
1446
if context.options['library'] == 'static':
1447
shell = d8_env.Program('d8' + suffix, object_files + shell_files)
1449
shell = d8_env.Program('d8' + suffix, shell_files)
1450
d8_env.Depends(shell, library)
1177
1451
context.d8_targets.append(shell)
1179
1453
for sample in context.samples:
1203
1477
context.cctest_targets.append(cctest_program)
1479
preparser_env = env.Copy()
1480
preparser_env.Replace(**context.flags['preparser'])
1481
preparser_env.Prepend(LIBS=[preparser_library_name])
1482
context.ApplyEnvOverrides(preparser_env)
1483
preparser_object = preparser_env.SConscript(
1484
join('preparser', 'SConscript'),
1485
build_dir=join('obj', 'preparser', target_id),
1486
exports='context tools',
1489
preparser_name = join('obj', 'preparser', target_id, 'preparser')
1490
preparser_program = preparser_env.Program(preparser_name, preparser_object);
1491
preparser_env.Depends(preparser_program, preparser_library)
1492
context.preparser_targets.append(preparser_program)