| OLD | NEW |
| 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 14 matching lines...) Expand all Loading... |
| 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 sys | 30 import sys |
| 31 import os | 31 import os |
| 32 from os.path import join, dirname, abspath | 32 from os.path import join, dirname, abspath |
| 33 from types import DictType, StringTypes | 33 from types import DictType, StringTypes |
| 34 root_dir = dirname(File('SConstruct').rfile().abspath) | 34 root_dir = dirname(File('SConstruct').rfile().abspath) |
| 35 sys.path.append(join(root_dir, 'tools')) | 35 sys.path.insert(0, join(root_dir, 'tools')) |
| 36 import js2c, utils | 36 import js2c, utils |
| 37 | 37 |
| 38 # ANDROID_TOP is the top of the Android checkout, fetched from the environment | 38 # 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 | 39 # variable 'TOP'. You will also need to set the CXX, CC, AR and RANLIB |
| 40 # environment variables to the cross-compiling tools. | 40 # environment variables to the cross-compiling tools. |
| 41 ANDROID_TOP = os.environ.get('TOP') | 41 ANDROID_TOP = os.environ.get('TOP') |
| 42 if ANDROID_TOP is None: | 42 if ANDROID_TOP is None: |
| 43 ANDROID_TOP="" | 43 ANDROID_TOP="" |
| 44 | 44 |
| 45 # ARM_TARGET_LIB is the path to the dynamic library to use on the target | 45 # ARM_TARGET_LIB is the path to the dynamic library to use on the target |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 'CPPDEFINES': ['OBJECT_PRINT'], | 117 'CPPDEFINES': ['OBJECT_PRINT'], |
| 118 }, | 118 }, |
| 119 'protectheap:on': { | 119 'protectheap:on': { |
| 120 'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING', 'ENABLE_HEAP_PROTECTION'], | 120 'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING', 'ENABLE_HEAP_PROTECTION'], |
| 121 }, | 121 }, |
| 122 'profilingsupport:on': { | 122 'profilingsupport:on': { |
| 123 'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING', 'ENABLE_LOGGING_AND_PROFILING'
], | 123 'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING', 'ENABLE_LOGGING_AND_PROFILING'
], |
| 124 }, | 124 }, |
| 125 'debuggersupport:on': { | 125 'debuggersupport:on': { |
| 126 'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT'], | 126 'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT'], |
| 127 }, |
| 128 'inspector:on': { |
| 129 'CPPDEFINES': ['INSPECTOR'], |
| 130 }, |
| 131 'liveobjectlist:on': { |
| 132 'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT', 'INSPECTOR', |
| 133 'LIVE_OBJECT_LIST', 'OBJECT_PRINT'], |
| 127 } | 134 } |
| 128 }, | 135 }, |
| 129 'gcc': { | 136 'gcc': { |
| 130 'all': { | 137 'all': { |
| 131 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], | 138 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
| 132 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'], | 139 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'], |
| 133 }, | 140 }, |
| 134 'visibility:hidden': { | 141 'visibility:hidden': { |
| 135 # Use visibility=default to disable this. | 142 # Use visibility=default to disable this. |
| 136 'CXXFLAGS': ['-fvisibility=hidden'] | 143 'CXXFLAGS': ['-fvisibility=hidden'] |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 }, | 227 }, |
| 221 'simulator:mips': { | 228 'simulator:mips': { |
| 222 'CCFLAGS': ['-m32'], | 229 'CCFLAGS': ['-m32'], |
| 223 'LINKFLAGS': ['-m32'], | 230 'LINKFLAGS': ['-m32'], |
| 224 }, | 231 }, |
| 225 'arch:x64': { | 232 'arch:x64': { |
| 226 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], | 233 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], |
| 227 'CCFLAGS': ['-m64'], | 234 'CCFLAGS': ['-m64'], |
| 228 'LINKFLAGS': ['-m64'], | 235 'LINKFLAGS': ['-m64'], |
| 229 }, | 236 }, |
| 230 'prof:oprofile': { | 237 'gdbjit:on': { |
| 231 'CPPDEFINES': ['ENABLE_OPROFILE_AGENT'] | 238 'CPPDEFINES': ['ENABLE_GDB_JIT_INTERFACE'] |
| 232 } | 239 } |
| 233 }, | 240 }, |
| 234 'msvc': { | 241 'msvc': { |
| 235 'all': { | 242 'all': { |
| 236 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], | 243 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
| 237 'CXXFLAGS': ['$CCFLAGS', '/GR-', '/Gy'], | 244 'CXXFLAGS': ['$CCFLAGS', '/GR-', '/Gy'], |
| 238 'CPPDEFINES': ['WIN32'], | 245 'CPPDEFINES': ['WIN32'], |
| 239 'LINKFLAGS': ['/INCREMENTAL:NO', '/NXCOMPAT', '/IGNORE:4221'], | 246 'LINKFLAGS': ['/INCREMENTAL:NO', '/NXCOMPAT', '/IGNORE:4221'], |
| 240 'CCPDBFLAGS': ['/Zi'] | 247 'CCPDBFLAGS': ['/Zi'] |
| 241 }, | 248 }, |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 }, | 320 }, |
| 314 'os:macos': { | 321 'os:macos': { |
| 315 'WARNINGFLAGS': ['-pedantic'] | 322 'WARNINGFLAGS': ['-pedantic'] |
| 316 }, | 323 }, |
| 317 'disassembler:on': { | 324 'disassembler:on': { |
| 318 'CPPDEFINES': ['ENABLE_DISASSEMBLER'] | 325 'CPPDEFINES': ['ENABLE_DISASSEMBLER'] |
| 319 } | 326 } |
| 320 }, | 327 }, |
| 321 'msvc': { | 328 'msvc': { |
| 322 'all': { | 329 'all': { |
| 323 'WARNINGFLAGS': ['/W3', '/WX', '/wd4355', '/wd4800'] | 330 'WARNINGFLAGS': ['/W3', '/WX', '/wd4351', '/wd4355', '/wd4800'] |
| 324 }, | 331 }, |
| 325 'library:shared': { | 332 'library:shared': { |
| 326 'CPPDEFINES': ['BUILDING_V8_SHARED'], | 333 'CPPDEFINES': ['BUILDING_V8_SHARED'], |
| 327 'LIBS': ['winmm', 'ws2_32'] | 334 'LIBS': ['winmm', 'ws2_32'] |
| 328 }, | 335 }, |
| 329 'arch:arm': { | 336 'arch:arm': { |
| 330 'CPPDEFINES': ['V8_TARGET_ARCH_ARM'], | 337 'CPPDEFINES': ['V8_TARGET_ARCH_ARM'], |
| 331 # /wd4996 is to silence the warning about sscanf | 338 # /wd4996 is to silence the warning about sscanf |
| 332 # used by the arm simulator. | 339 # used by the arm simulator. |
| 333 'WARNINGFLAGS': ['/wd4996'] | 340 'WARNINGFLAGS': ['/wd4996'] |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 'CCFLAGS': ['-m32'], | 529 'CCFLAGS': ['-m32'], |
| 523 'LINKFLAGS': ['-m32'] | 530 'LINKFLAGS': ['-m32'] |
| 524 }, | 531 }, |
| 525 'mode:release': { | 532 'mode:release': { |
| 526 'CCFLAGS': ['-O2'] | 533 'CCFLAGS': ['-O2'] |
| 527 }, | 534 }, |
| 528 'mode:debug': { | 535 'mode:debug': { |
| 529 'CCFLAGS': ['-g', '-O0'], | 536 'CCFLAGS': ['-g', '-O0'], |
| 530 'CPPDEFINES': ['DEBUG'] | 537 'CPPDEFINES': ['DEBUG'] |
| 531 }, | 538 }, |
| 532 'prof:oprofile': { | |
| 533 'LIBPATH': ['/usr/lib32', '/usr/lib32/oprofile'], | |
| 534 'LIBS': ['opagent'] | |
| 535 } | |
| 536 }, | 539 }, |
| 537 'msvc': { | 540 'msvc': { |
| 538 'all': { | 541 'all': { |
| 539 'LIBS': ['winmm', 'ws2_32'] | 542 'LIBS': ['winmm', 'ws2_32'] |
| 540 }, | 543 }, |
| 541 'verbose:off': { | 544 'verbose:off': { |
| 542 'CCFLAGS': ['/nologo'], | 545 'CCFLAGS': ['/nologo'], |
| 543 'LINKFLAGS': ['/NOLOGO'] | 546 'LINKFLAGS': ['/NOLOGO'] |
| 544 }, | 547 }, |
| 545 'verbose:on': { | 548 'verbose:on': { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 elif 'msvc' in tools: | 659 elif 'msvc' in tools: |
| 657 return 'msvc' | 660 return 'msvc' |
| 658 else: | 661 else: |
| 659 return None | 662 return None |
| 660 | 663 |
| 661 | 664 |
| 662 def GuessVisibility(os, toolchain): | 665 def GuessVisibility(os, toolchain): |
| 663 if os == 'win32' and toolchain == 'gcc': | 666 if os == 'win32' and toolchain == 'gcc': |
| 664 # MinGW can't do it. | 667 # MinGW can't do it. |
| 665 return 'default' | 668 return 'default' |
| 669 elif os == 'solaris': |
| 670 return 'default' |
| 666 else: | 671 else: |
| 667 return 'hidden' | 672 return 'hidden' |
| 668 | 673 |
| 669 | 674 |
| 670 OS_GUESS = utils.GuessOS() | 675 OS_GUESS = utils.GuessOS() |
| 671 TOOLCHAIN_GUESS = GuessToolchain(OS_GUESS) | 676 TOOLCHAIN_GUESS = GuessToolchain(OS_GUESS) |
| 672 ARCH_GUESS = utils.GuessArchitecture() | 677 ARCH_GUESS = utils.GuessArchitecture() |
| 673 VISIBILITY_GUESS = GuessVisibility(OS_GUESS, TOOLCHAIN_GUESS) | 678 VISIBILITY_GUESS = GuessVisibility(OS_GUESS, TOOLCHAIN_GUESS) |
| 674 | 679 |
| 675 | 680 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 693 'values': ['native', 'interpreted'], | 698 'values': ['native', 'interpreted'], |
| 694 'default': 'native', | 699 'default': 'native', |
| 695 'help': 'Whether to use native or interpreted regexp implementation' | 700 'help': 'Whether to use native or interpreted regexp implementation' |
| 696 }, | 701 }, |
| 697 'snapshot': { | 702 'snapshot': { |
| 698 'values': ['on', 'off', 'nobuild'], | 703 'values': ['on', 'off', 'nobuild'], |
| 699 'default': 'off', | 704 'default': 'off', |
| 700 'help': 'build using snapshots for faster start-up' | 705 'help': 'build using snapshots for faster start-up' |
| 701 }, | 706 }, |
| 702 'prof': { | 707 'prof': { |
| 703 'values': ['on', 'off', 'oprofile'], | 708 'values': ['on', 'off'], |
| 704 'default': 'off', | 709 'default': 'off', |
| 705 'help': 'enable profiling of build target' | 710 'help': 'enable profiling of build target' |
| 706 }, | 711 }, |
| 712 'gdbjit': { |
| 713 'values': ['on', 'off'], |
| 714 'default': 'off', |
| 715 'help': 'enable GDB JIT interface' |
| 716 }, |
| 707 'library': { | 717 'library': { |
| 708 'values': ['static', 'shared'], | 718 'values': ['static', 'shared'], |
| 709 'default': 'static', | 719 'default': 'static', |
| 710 'help': 'the type of library to produce' | 720 'help': 'the type of library to produce' |
| 711 }, | 721 }, |
| 712 'vmstate': { | 722 'vmstate': { |
| 713 'values': ['on', 'off'], | 723 'values': ['on', 'off'], |
| 714 'default': 'off', | 724 'default': 'off', |
| 715 'help': 'enable VM state tracking' | 725 'help': 'enable VM state tracking' |
| 716 }, | 726 }, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 727 'profilingsupport': { | 737 'profilingsupport': { |
| 728 'values': ['on', 'off'], | 738 'values': ['on', 'off'], |
| 729 'default': 'on', | 739 'default': 'on', |
| 730 'help': 'enable profiling of JavaScript code' | 740 'help': 'enable profiling of JavaScript code' |
| 731 }, | 741 }, |
| 732 'debuggersupport': { | 742 'debuggersupport': { |
| 733 'values': ['on', 'off'], | 743 'values': ['on', 'off'], |
| 734 'default': 'on', | 744 'default': 'on', |
| 735 'help': 'enable debugging of JavaScript code' | 745 'help': 'enable debugging of JavaScript code' |
| 736 }, | 746 }, |
| 747 'inspector': { |
| 748 'values': ['on', 'off'], |
| 749 'default': 'off', |
| 750 'help': 'enable inspector features' |
| 751 }, |
| 752 'liveobjectlist': { |
| 753 'values': ['on', 'off'], |
| 754 'default': 'off', |
| 755 'help': 'enable live object list features in the debugger' |
| 756 }, |
| 737 'soname': { | 757 'soname': { |
| 738 'values': ['on', 'off'], | 758 'values': ['on', 'off'], |
| 739 'default': 'off', | 759 'default': 'off', |
| 740 'help': 'turn on setting soname for Linux shared library' | 760 'help': 'turn on setting soname for Linux shared library' |
| 741 }, | 761 }, |
| 742 'msvcrt': { | 762 'msvcrt': { |
| 743 'values': ['static', 'shared'], | 763 'values': ['static', 'shared'], |
| 744 'default': 'static', | 764 'default': 'static', |
| 745 'help': 'the type of Microsoft Visual C++ runtime library to use' | 765 'help': 'the type of Microsoft Visual C++ runtime library to use' |
| 746 }, | 766 }, |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 | 883 |
| 864 def VerifyOptions(env): | 884 def VerifyOptions(env): |
| 865 if not IsLegal(env, 'mode', ['debug', 'release']): | 885 if not IsLegal(env, 'mode', ['debug', 'release']): |
| 866 return False | 886 return False |
| 867 if not IsLegal(env, 'sample', ["shell", "process", "lineprocessor"]): | 887 if not IsLegal(env, 'sample', ["shell", "process", "lineprocessor"]): |
| 868 return False | 888 return False |
| 869 if not IsLegal(env, 'regexp', ["native", "interpreted"]): | 889 if not IsLegal(env, 'regexp', ["native", "interpreted"]): |
| 870 return False | 890 return False |
| 871 if env['os'] == 'win32' and env['library'] == 'shared' and env['prof'] == 'on'
: | 891 if env['os'] == 'win32' and env['library'] == 'shared' and env['prof'] == 'on'
: |
| 872 Abort("Profiling on windows only supported for static library.") | 892 Abort("Profiling on windows only supported for static library.") |
| 873 if env['prof'] == 'oprofile' and env['os'] != 'linux': | 893 if env['gdbjit'] == 'on' and (env['os'] != 'linux' or (env['arch'] != 'ia32' a
nd env['arch'] != 'x64')): |
| 874 Abort("OProfile is only supported on Linux.") | 894 Abort("GDBJIT interface is supported only for Intel-compatible (ia32 or x64)
Linux target.") |
| 875 if env['os'] == 'win32' and env['soname'] == 'on': | 895 if env['os'] == 'win32' and env['soname'] == 'on': |
| 876 Abort("Shared Object soname not applicable for Windows.") | 896 Abort("Shared Object soname not applicable for Windows.") |
| 877 if env['soname'] == 'on' and env['library'] == 'static': | 897 if env['soname'] == 'on' and env['library'] == 'static': |
| 878 Abort("Shared Object soname not applicable for static library.") | 898 Abort("Shared Object soname not applicable for static library.") |
| 879 if env['os'] != 'win32' and env['pgo'] != 'off': | 899 if env['os'] != 'win32' and env['pgo'] != 'off': |
| 880 Abort("Profile guided optimization only supported on Windows.") | 900 Abort("Profile guided optimization only supported on Windows.") |
| 881 if env['cache'] and not os.path.isdir(env['cache']): | 901 if env['cache'] and not os.path.isdir(env['cache']): |
| 882 Abort("The specified cache directory does not exist.") | 902 Abort("The specified cache directory does not exist.") |
| 883 if not (env['arch'] == 'arm' or env['simulator'] == 'arm') and ('unalignedacce
sses' in ARGUMENTS): | 903 if not (env['arch'] == 'arm' or env['simulator'] == 'arm') and ('unalignedacce
sses' in ARGUMENTS): |
| 884 print env['arch'] | 904 print env['arch'] |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 options['profilingsupport'] = 'on' | 1002 options['profilingsupport'] = 'on' |
| 983 if os == 'win32' and options['pgo'] != 'off' and options['msvcltcg'] == 'off': | 1003 if os == 'win32' and options['pgo'] != 'off' and options['msvcltcg'] == 'off': |
| 984 if 'msvcltcg' in ARGUMENTS: | 1004 if 'msvcltcg' in ARGUMENTS: |
| 985 print "Warning: forcing msvcltcg on as it is required for pgo (%s)" % opti
ons['pgo'] | 1005 print "Warning: forcing msvcltcg on as it is required for pgo (%s)" % opti
ons['pgo'] |
| 986 options['msvcltcg'] = 'on' | 1006 options['msvcltcg'] = 'on' |
| 987 if options['arch'] == 'mips': | 1007 if options['arch'] == 'mips': |
| 988 if ('regexp' in ARGUMENTS) and options['regexp'] == 'native': | 1008 if ('regexp' in ARGUMENTS) and options['regexp'] == 'native': |
| 989 # Print a warning if native regexp is specified for mips | 1009 # Print a warning if native regexp is specified for mips |
| 990 print "Warning: forcing regexp to interpreted for mips" | 1010 print "Warning: forcing regexp to interpreted for mips" |
| 991 options['regexp'] = 'interpreted' | 1011 options['regexp'] = 'interpreted' |
| 1012 if options['liveobjectlist'] == 'on': |
| 1013 if (options['debuggersupport'] != 'on') or (options['mode'] == 'release'): |
| 1014 # Print a warning that liveobjectlist will implicitly enable the debugger |
| 1015 print "Warning: forcing debuggersupport on for liveobjectlist" |
| 1016 options['debuggersupport'] = 'on' |
| 1017 options['inspector'] = 'on' |
| 1018 options['objectprint'] = 'on' |
| 992 | 1019 |
| 993 | 1020 |
| 994 def ParseEnvOverrides(arg, imports): | 1021 def ParseEnvOverrides(arg, imports): |
| 995 # The environment overrides are in the format NAME0:value0,NAME1:value1,... | 1022 # The environment overrides are in the format NAME0:value0,NAME1:value1,... |
| 996 # The environment imports are in the format NAME0,NAME1,... | 1023 # The environment imports are in the format NAME0,NAME1,... |
| 997 overrides = {} | 1024 overrides = {} |
| 998 for var in imports.split(','): | 1025 for var in imports.split(','): |
| 999 if var in os.environ: | 1026 if var in os.environ: |
| 1000 overrides[var] = os.environ[var] | 1027 overrides[var] = os.environ[var] |
| 1001 for override in arg.split(','): | 1028 for override in arg.split(','): |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 # version of scons. Also, there's a bug in some revisions that | 1183 # version of scons. Also, there's a bug in some revisions that |
| 1157 # doesn't allow this flag to be set, so we swallow any exceptions. | 1184 # doesn't allow this flag to be set, so we swallow any exceptions. |
| 1158 # Lovely. | 1185 # Lovely. |
| 1159 try: | 1186 try: |
| 1160 SetOption('warn', 'no-deprecated') | 1187 SetOption('warn', 'no-deprecated') |
| 1161 except: | 1188 except: |
| 1162 pass | 1189 pass |
| 1163 | 1190 |
| 1164 | 1191 |
| 1165 Build() | 1192 Build() |
| OLD | NEW |