OLD | NEW |
1 # Copyright 2011 the V8 project authors. All rights reserved. | 1 # Copyright 2011 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 15 matching lines...) Expand all Loading... |
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 subprocess |
31 import sys | 31 import sys |
32 import os | 32 import os |
33 from os.path import join, dirname, abspath | 33 from os.path import join, dirname, abspath |
34 from types import DictType, StringTypes | 34 from types import DictType, StringTypes |
35 root_dir = dirname(File('SConstruct').rfile().abspath) | 35 root_dir = dirname(File('SConstruct').rfile().abspath) |
| 36 src_dir = join(root_dir, 'src') |
36 sys.path.insert(0, join(root_dir, 'tools')) | 37 sys.path.insert(0, join(root_dir, 'tools')) |
37 import js2c, utils | 38 import js2c, utils |
38 | 39 |
39 # ARM_TARGET_LIB is the path to the dynamic library to use on the target | 40 # ARM_TARGET_LIB is the path to the dynamic library to use on the target |
40 # machine if cross-compiling to an arm machine. You will also need to set | 41 # machine if cross-compiling to an arm machine. You will also need to set |
41 # the additional cross-compiling environment variables to the cross compiler. | 42 # the additional cross-compiling environment variables to the cross compiler. |
42 ARM_TARGET_LIB = os.environ.get('ARM_TARGET_LIB') | 43 ARM_TARGET_LIB = os.environ.get('ARM_TARGET_LIB') |
43 if ARM_TARGET_LIB: | 44 if ARM_TARGET_LIB: |
44 ARM_LINK_FLAGS = ['-Wl,-rpath=' + ARM_TARGET_LIB + '/lib:' + | 45 ARM_LINK_FLAGS = ['-Wl,-rpath=' + ARM_TARGET_LIB + '/lib:' + |
45 ARM_TARGET_LIB + '/usr/lib', | 46 ARM_TARGET_LIB + '/usr/lib', |
46 '-Wl,--dynamic-linker=' + ARM_TARGET_LIB + | 47 '-Wl,--dynamic-linker=' + ARM_TARGET_LIB + |
47 '/lib/ld-linux.so.3'] | 48 '/lib/ld-linux.so.3'] |
48 else: | 49 else: |
49 ARM_LINK_FLAGS = [] | 50 ARM_LINK_FLAGS = [] |
50 | 51 |
51 GCC_EXTRA_CCFLAGS = [] | 52 GCC_EXTRA_CCFLAGS = [] |
52 GCC_DTOA_EXTRA_CCFLAGS = [] | 53 GCC_DTOA_EXTRA_CCFLAGS = [] |
53 | 54 |
54 LIBRARY_FLAGS = { | 55 LIBRARY_FLAGS = { |
55 'all': { | 56 'all': { |
56 'CPPPATH': [join(root_dir, 'src')], | 57 'CPPPATH': [src_dir], |
57 'regexp:interpreted': { | 58 'regexp:interpreted': { |
58 'CPPDEFINES': ['V8_INTERPRETED_REGEXP'] | 59 'CPPDEFINES': ['V8_INTERPRETED_REGEXP'] |
59 }, | 60 }, |
60 'mode:debug': { | 61 'mode:debug': { |
61 'CPPDEFINES': ['V8_ENABLE_CHECKS', 'OBJECT_PRINT'] | 62 'CPPDEFINES': ['V8_ENABLE_CHECKS', 'OBJECT_PRINT'] |
62 }, | 63 }, |
63 'objectprint:on': { | 64 'objectprint:on': { |
64 'CPPDEFINES': ['OBJECT_PRINT'], | 65 'CPPDEFINES': ['OBJECT_PRINT'], |
65 }, | 66 }, |
66 'debuggersupport:on': { | 67 'debuggersupport:on': { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 'LIBS': ['pthread'] | 105 'LIBS': ['pthread'] |
105 } | 106 } |
106 }, | 107 }, |
107 'os:macos': { | 108 'os:macos': { |
108 'CCFLAGS': ['-ansi', '-mmacosx-version-min=10.4'], | 109 'CCFLAGS': ['-ansi', '-mmacosx-version-min=10.4'], |
109 'library:shared': { | 110 'library:shared': { |
110 'CPPDEFINES': ['V8_SHARED'] | 111 'CPPDEFINES': ['V8_SHARED'] |
111 } | 112 } |
112 }, | 113 }, |
113 'os:freebsd': { | 114 'os:freebsd': { |
114 'CPPPATH' : ['/usr/local/include'], | 115 'CPPPATH' : [src_dir, '/usr/local/include'], |
115 'LIBPATH' : ['/usr/local/lib'], | 116 'LIBPATH' : ['/usr/local/lib'], |
116 'CCFLAGS': ['-ansi'], | 117 'CCFLAGS': ['-ansi'], |
117 'LIBS': ['execinfo'] | 118 'LIBS': ['execinfo'] |
118 }, | 119 }, |
119 'os:openbsd': { | 120 'os:openbsd': { |
120 'CPPPATH' : ['/usr/local/include'], | 121 'CPPPATH' : [src_dir, '/usr/local/include'], |
121 'LIBPATH' : ['/usr/local/lib'], | 122 'LIBPATH' : ['/usr/local/lib'], |
122 'CCFLAGS': ['-ansi'], | 123 'CCFLAGS': ['-ansi'], |
123 }, | 124 }, |
124 'os:solaris': { | 125 'os:solaris': { |
125 # On Solaris, to get isinf, INFINITY, fpclassify and other macros one | 126 # On Solaris, to get isinf, INFINITY, fpclassify and other macros one |
126 # needs to define __C99FEATURES__. | 127 # needs to define __C99FEATURES__. |
127 'CPPDEFINES': ['__C99FEATURES__'], | 128 'CPPDEFINES': ['__C99FEATURES__'], |
128 'CPPPATH' : ['/usr/local/include'], | 129 'CPPPATH' : [src_dir, '/usr/local/include'], |
129 'LIBPATH' : ['/usr/local/lib'], | 130 'LIBPATH' : ['/usr/local/lib'], |
130 'CCFLAGS': ['-ansi'], | 131 'CCFLAGS': ['-ansi'], |
131 }, | 132 }, |
132 'os:netbsd': { | 133 'os:netbsd': { |
133 'CPPPATH' : ['/usr/pkg/include'], | 134 'CPPPATH' : [src_dir, '/usr/pkg/include'], |
134 'LIBPATH' : ['/usr/pkg/lib'], | 135 'LIBPATH' : ['/usr/pkg/lib'], |
135 }, | 136 }, |
136 'os:win32': { | 137 'os:win32': { |
137 'CCFLAGS': ['-DWIN32'], | 138 'CCFLAGS': ['-DWIN32'], |
138 'CXXFLAGS': ['-DWIN32'], | 139 'CXXFLAGS': ['-DWIN32'], |
139 }, | 140 }, |
140 'arch:ia32': { | 141 'arch:ia32': { |
141 'CPPDEFINES': ['V8_TARGET_ARCH_IA32'], | 142 'CPPDEFINES': ['V8_TARGET_ARCH_IA32'], |
142 'CCFLAGS': ['-m32'], | 143 'CCFLAGS': ['-m32'], |
143 'LINKFLAGS': ['-m32'] | 144 'LINKFLAGS': ['-m32'] |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 'msvc': { | 397 'msvc': { |
397 'all': { | 398 'all': { |
398 'WARNINGFLAGS': ['/WX', '/wd4018', '/wd4244'] | 399 'WARNINGFLAGS': ['/WX', '/wd4018', '/wd4244'] |
399 } | 400 } |
400 } | 401 } |
401 } | 402 } |
402 | 403 |
403 | 404 |
404 CCTEST_EXTRA_FLAGS = { | 405 CCTEST_EXTRA_FLAGS = { |
405 'all': { | 406 'all': { |
406 'CPPPATH': [join(root_dir, 'src')], | 407 'CPPPATH': [src_dir], |
407 'library:shared': { | 408 'library:shared': { |
408 'CPPDEFINES': ['USING_V8_SHARED'] | 409 'CPPDEFINES': ['USING_V8_SHARED'] |
409 }, | 410 }, |
410 }, | 411 }, |
411 'gcc': { | 412 'gcc': { |
412 'all': { | 413 'all': { |
413 'LIBPATH': [abspath('.')], | 414 'LIBPATH': [abspath('.')], |
414 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], | 415 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
415 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'], | 416 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'], |
416 'LINKFLAGS': ['$CCFLAGS'], | 417 'LINKFLAGS': ['$CCFLAGS'], |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 'arch:x64': { | 454 'arch:x64': { |
454 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], | 455 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], |
455 'LINKFLAGS': ['/STACK:2097152'] | 456 'LINKFLAGS': ['/STACK:2097152'] |
456 }, | 457 }, |
457 } | 458 } |
458 } | 459 } |
459 | 460 |
460 | 461 |
461 SAMPLE_FLAGS = { | 462 SAMPLE_FLAGS = { |
462 'all': { | 463 'all': { |
463 'CPPPATH': [join(abspath('.'), 'include')], | 464 'CPPPATH': [join(root_dir, 'include')], |
464 'library:shared': { | 465 'library:shared': { |
465 'CPPDEFINES': ['USING_V8_SHARED'] | 466 'CPPDEFINES': ['USING_V8_SHARED'] |
466 }, | 467 }, |
467 }, | 468 }, |
468 'gcc': { | 469 'gcc': { |
469 'all': { | 470 'all': { |
470 'LIBPATH': ['.'], | 471 'LIBPATH': ['.'], |
471 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], | 472 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
472 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'], | 473 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'], |
473 'LINKFLAGS': ['$CCFLAGS'], | 474 'LINKFLAGS': ['$CCFLAGS'], |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 'msvcrt:shared': { | 637 'msvcrt:shared': { |
637 'CCFLAGS': ['/MDd'] | 638 'CCFLAGS': ['/MDd'] |
638 } | 639 } |
639 } | 640 } |
640 } | 641 } |
641 } | 642 } |
642 | 643 |
643 | 644 |
644 PREPARSER_FLAGS = { | 645 PREPARSER_FLAGS = { |
645 'all': { | 646 'all': { |
646 'CPPPATH': [join(abspath('.'), 'include'), join(abspath('.'), 'src')], | 647 'CPPPATH': [join(root_dir, 'include'), src_dir], |
647 'library:shared': { | 648 'library:shared': { |
648 'CPPDEFINES': ['USING_V8_SHARED'] | 649 'CPPDEFINES': ['USING_V8_SHARED'] |
649 }, | 650 }, |
650 }, | 651 }, |
651 'gcc': { | 652 'gcc': { |
652 'all': { | 653 'all': { |
653 'LIBPATH': ['.'], | 654 'LIBPATH': ['.'], |
654 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], | 655 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
655 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'], | 656 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'], |
656 'LINKFLAGS': ['$CCFLAGS'], | 657 'LINKFLAGS': ['$CCFLAGS'], |
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 # version of scons. Also, there's a bug in some revisions that | 1560 # version of scons. Also, there's a bug in some revisions that |
1560 # doesn't allow this flag to be set, so we swallow any exceptions. | 1561 # doesn't allow this flag to be set, so we swallow any exceptions. |
1561 # Lovely. | 1562 # Lovely. |
1562 try: | 1563 try: |
1563 SetOption('warn', 'no-deprecated') | 1564 SetOption('warn', 'no-deprecated') |
1564 except: | 1565 except: |
1565 pass | 1566 pass |
1566 | 1567 |
1567 | 1568 |
1568 Build() | 1569 Build() |
OLD | NEW |