OLD | NEW |
---|---|
1 # Copyright 2008 the V8 project authors. All rights reserved. | 1 # Copyright 2008 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 17 matching lines...) Expand all Loading... | |
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.append(join(root_dir, 'tools')) |
36 import js2c, utils | 36 import js2c, utils |
37 | 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 |
40 # environment variables to the cross-compiling tools. | 41 # environment variables to the cross-compiling tools. |
41 ANDROID_TOP = os.environ.get('TOP') | 42 ANDROID_TOP = os.environ.get('TOP') |
42 if ANDROID_TOP is None: | 43 if ANDROID_TOP is None: |
43 ANDROID_TOP="" | 44 ANDROID_TOP="" |
44 | 45 |
45 ANDROID_FLAGS = ['-march=armv5te', | 46 ANDROID_FLAGS = ['-march=armv5te', |
46 '-mtune=xscale', | 47 '-mtune=xscale', |
47 '-msoft-float', | 48 '-msoft-float', |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 }, | 126 }, |
126 'os:android': { | 127 'os:android': { |
127 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__', | 128 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__', |
128 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], | 129 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], |
129 'CCFLAGS': ANDROID_FLAGS, | 130 'CCFLAGS': ANDROID_FLAGS, |
130 'WARNINGFLAGS': ['-Wall', '-Wno-unused', '-Werror=return-type', | 131 'WARNINGFLAGS': ['-Wall', '-Wno-unused', '-Werror=return-type', |
131 '-Wstrict-aliasing=2'], | 132 '-Wstrict-aliasing=2'], |
132 'CPPPATH': ANDROID_INCLUDES, | 133 'CPPPATH': ANDROID_INCLUDES, |
133 }, | 134 }, |
134 'wordsize:32': { | 135 'wordsize:32': { |
135 'CCFLAGS': ['-m32'], | 136 'arch:x64': { |
136 'CPPDEFINES': ['ILP32'], | 137 'CCFLAGS': ['-m64'], |
137 'LINKFLAGS': ['-m32'] | 138 'LINKFLAGS': ['-m64'] |
139 } | |
138 }, | 140 }, |
139 'wordsize:64': { | 141 'wordsize:64': { |
140 'CCFLAGS': ['-m64'], | 142 'arch:ia32': { |
141 'CPPDEFINES': ['LP64'], | 143 'CCFLAGS': ['-m32'], |
142 'LINKFLAGS': ['-m64'] | 144 'LINKFLAGS': ['-m32'] |
145 }, | |
146 'arch:arm': { | |
147 'CCFLAGS': ['-m32'], | |
148 'LINKFLAGS': ['-m32'] | |
149 } | |
143 }, | 150 }, |
144 'arch:ia32': { | 151 'arch:ia32': { |
145 'CPPDEFINES': ['V8_ARCH_IA32'] | 152 'CPPDEFINES': ['V8_ARCH_IA32', 'ILP32'] |
146 }, | 153 }, |
147 'arch:arm': { | 154 'arch:arm': { |
148 'CPPDEFINES': ['V8_ARCH_ARM'] | 155 'CPPDEFINES': ['V8_ARCH_ARM', 'ILP32'] |
149 }, | 156 }, |
150 'arch:x64': { | 157 'arch:x64': { |
151 'CPPDEFINES': ['V8_ARCH_X64'] | 158 'CPPDEFINES': ['V8_ARCH_X64', 'LP64'] |
iposva
2009/04/29 21:30:31
Shouldn't you rely on __LP64__ being defined by th
Lasse Reichstein
2009/05/01 06:36:29
Personally, I prefer setting everything myself to
| |
152 }, | 159 }, |
153 'prof:oprofile': { | 160 'prof:oprofile': { |
154 'CPPDEFINES': ['ENABLE_OPROFILE_AGENT'] | 161 'CPPDEFINES': ['ENABLE_OPROFILE_AGENT'] |
155 } | 162 } |
156 }, | 163 }, |
157 'msvc': { | 164 'msvc': { |
158 'all': { | 165 'all': { |
159 'DIALECTFLAGS': ['/nologo'], | 166 'DIALECTFLAGS': ['/nologo'], |
160 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], | 167 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
161 'CXXFLAGS': ['$CCFLAGS', '/GR-', '/Gy'], | 168 'CXXFLAGS': ['$CCFLAGS', '/GR-', '/Gy'], |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
196 | 203 |
197 | 204 |
198 V8_EXTRA_FLAGS = { | 205 V8_EXTRA_FLAGS = { |
199 'gcc': { | 206 'gcc': { |
200 'all': { | 207 'all': { |
201 'CXXFLAGS': [], #['-fvisibility=hidden'], | 208 'CXXFLAGS': [], #['-fvisibility=hidden'], |
202 'WARNINGFLAGS': ['-Wall', '-Werror', '-W', | 209 'WARNINGFLAGS': ['-Wall', '-Werror', '-W', |
203 '-Wno-unused-parameter'] | 210 '-Wno-unused-parameter'] |
204 }, | 211 }, |
205 'arch:arm': { | 212 'arch:arm': { |
206 'CPPDEFINES': ['ARM'] | 213 'CPPDEFINES': ['ARM'] |
iposva
2009/04/29 21:30:31
This is now redundant and should be removed. As ar
Lasse Reichstein
2009/05/01 06:36:29
Done.
| |
207 }, | 214 }, |
208 'os:win32': { | 215 'os:win32': { |
209 'WARNINGFLAGS': ['-pedantic', '-Wno-long-long'] | 216 'WARNINGFLAGS': ['-pedantic', '-Wno-long-long'] |
210 }, | 217 }, |
211 'os:linux': { | 218 'os:linux': { |
212 'WARNINGFLAGS': ['-pedantic'] | 219 'WARNINGFLAGS': ['-pedantic'] |
213 }, | 220 }, |
214 'os:macos': { | 221 'os:macos': { |
215 'WARNINGFLAGS': ['-pedantic'] | 222 'WARNINGFLAGS': ['-pedantic'] |
216 }, | 223 }, |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
304 'CCFLAGS': ANDROID_FLAGS, | 311 'CCFLAGS': ANDROID_FLAGS, |
305 'CPPPATH': ANDROID_INCLUDES, | 312 'CPPPATH': ANDROID_INCLUDES, |
306 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'], | 313 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'], |
307 'LINKFLAGS': ANDROID_LINKFLAGS, | 314 'LINKFLAGS': ANDROID_LINKFLAGS, |
308 'LIBS': ['c', 'stdc++', 'm'], | 315 'LIBS': ['c', 'stdc++', 'm'], |
309 'mode:release': { | 316 'mode:release': { |
310 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] | 317 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] |
311 } | 318 } |
312 }, | 319 }, |
313 'wordsize:32': { | 320 'wordsize:32': { |
314 'CCFLAGS': ['-m32'], | 321 'arch:x64': { |
315 'CPPDEFINES': ['ILP32'], | 322 'CCFLAGS': ['-m64'], |
316 'LINKFLAGS': ['-m32'] | 323 'LINKFLAGS': ['-m64'] |
324 } | |
317 }, | 325 }, |
318 'wordsize:64': { | 326 'wordsize:64': { |
319 'CCFLAGS': ['-m64'], | 327 'arch:ia32': { |
320 'CPPDEFINES': ['LP64'], | 328 'CCFLAGS': ['-m32'], |
321 'LINKFLAGS': ['-m64'] | 329 'LINKFLAGS': ['-m32'] |
322 }, | 330 }, |
331 'arch:arm': { | |
332 'CCFLAGS': ['-m32'], | |
333 'LINKFLAGS': ['-m32'] | |
334 } | |
335 } | |
323 }, | 336 }, |
324 'msvc': { | 337 'msvc': { |
325 'all': { | 338 'all': { |
326 'CPPDEFINES': ['_HAS_EXCEPTIONS=0'], | 339 'CPPDEFINES': ['_HAS_EXCEPTIONS=0'], |
327 'LIBS': ['winmm', 'ws2_32'] | 340 'LIBS': ['winmm', 'ws2_32'] |
328 }, | 341 }, |
329 'library:shared': { | 342 'library:shared': { |
330 'CPPDEFINES': ['USING_V8_SHARED'] | 343 'CPPDEFINES': ['USING_V8_SHARED'] |
331 } | 344 } |
332 } | 345 } |
(...skipping 28 matching lines...) Expand all Loading... | |
361 'CCFLAGS': ANDROID_FLAGS, | 374 'CCFLAGS': ANDROID_FLAGS, |
362 'CPPPATH': ANDROID_INCLUDES, | 375 'CPPPATH': ANDROID_INCLUDES, |
363 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'], | 376 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'], |
364 'LINKFLAGS': ANDROID_LINKFLAGS, | 377 'LINKFLAGS': ANDROID_LINKFLAGS, |
365 'LIBS': ['c', 'stdc++', 'm'], | 378 'LIBS': ['c', 'stdc++', 'm'], |
366 'mode:release': { | 379 'mode:release': { |
367 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] | 380 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] |
368 } | 381 } |
369 }, | 382 }, |
370 'wordsize:32': { | 383 'wordsize:32': { |
371 'CCFLAGS': ['-m32'], | 384 'arch:x64': { |
372 'CPPDEFINES': ['ILP32'], | 385 'CCFLAGS': ['-m64'], |
373 'LINKFLAGS': ['-m32'] | 386 'LINKFLAGS': ['-m64'] |
387 } | |
374 }, | 388 }, |
375 'wordsize:64': { | 389 'wordsize:64': { |
376 'CCFLAGS': ['-m64'], | 390 'arch:ia32': { |
377 'CPPDEFINES': ['LP64'], | 391 'CCFLAGS': ['-m32'], |
378 'LINKFLAGS': ['-m64'] | 392 'LINKFLAGS': ['-m32'] |
393 }, | |
394 'arch:arm': { | |
395 'CCFLAGS': ['-m32'], | |
396 'LINKFLAGS': ['-m32'] | |
397 } | |
379 }, | 398 }, |
380 'mode:release': { | 399 'mode:release': { |
381 'CCFLAGS': ['-O2'] | 400 'CCFLAGS': ['-O2'] |
382 }, | 401 }, |
383 'mode:debug': { | 402 'mode:debug': { |
384 'CCFLAGS': ['-g', '-O0'] | 403 'CCFLAGS': ['-g', '-O0'] |
385 }, | 404 }, |
386 'prof:oprofile': { | 405 'prof:oprofile': { |
387 'LIBPATH': ['/usr/lib32', '/usr/lib32/oprofile'], | 406 'LIBPATH': ['/usr/lib32', '/usr/lib32/oprofile'], |
388 'LIBS': ['opagent'] | 407 'LIBS': ['opagent'] |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
522 'default': 'static', | 541 'default': 'static', |
523 'help': 'the type of Microsoft Visual C++ runtime library to use' | 542 'help': 'the type of Microsoft Visual C++ runtime library to use' |
524 }, | 543 }, |
525 'msvcltcg': { | 544 'msvcltcg': { |
526 'values': ['on', 'off'], | 545 'values': ['on', 'off'], |
527 'default': 'on', | 546 'default': 'on', |
528 'help': 'use Microsoft Visual C++ link-time code generation' | 547 'help': 'use Microsoft Visual C++ link-time code generation' |
529 }, | 548 }, |
530 'wordsize': { | 549 'wordsize': { |
531 'values': ['64', '32'], | 550 'values': ['64', '32'], |
532 'default': '32', # WORDSIZE_GUESS, | 551 'default': WORDSIZE_GUESS, |
533 'help': 'the word size' | 552 'help': 'the word size' |
534 }, | 553 }, |
535 'simulator': { | 554 'simulator': { |
536 'values': ['arm', 'none'], | 555 'values': ['arm', 'none'], |
537 'default': 'none', | 556 'default': 'none', |
538 'help': 'build with simulator' | 557 'help': 'build with simulator' |
539 }, | 558 }, |
540 'disassembler': { | 559 'disassembler': { |
541 'values': ['on', 'off'], | 560 'values': ['on', 'off'], |
542 'default': 'off', | 561 'default': 'off', |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
582 | 601 |
583 def VerifyOptions(env): | 602 def VerifyOptions(env): |
584 if not IsLegal(env, 'mode', ['debug', 'release']): | 603 if not IsLegal(env, 'mode', ['debug', 'release']): |
585 return False | 604 return False |
586 if not IsLegal(env, 'sample', ["shell", "process"]): | 605 if not IsLegal(env, 'sample', ["shell", "process"]): |
587 return False | 606 return False |
588 if env['os'] == 'win32' and env['library'] == 'shared' and env['prof'] == 'on' : | 607 if env['os'] == 'win32' and env['library'] == 'shared' and env['prof'] == 'on' : |
589 Abort("Profiling on windows only supported for static library.") | 608 Abort("Profiling on windows only supported for static library.") |
590 if env['prof'] == 'oprofile' and env['os'] != 'linux': | 609 if env['prof'] == 'oprofile' and env['os'] != 'linux': |
591 Abort("OProfile is only supported on Linux.") | 610 Abort("OProfile is only supported on Linux.") |
592 if env['wordsize'] == '64' and (env['os'] != 'linux' or env['arch'] != 'x64'): | 611 if env['arch'] == 'x64' and env['os'] != 'linux': |
593 Abort("64 bit compilation only allowed on Linux OS and x64 architecture.") | 612 Abort("X64 compilation only allowed on Linux OS.") |
iposva
2009/04/29 21:30:31
Why? The Mac has a perfectly fine working x64 envi
Lasse Reichstein
2009/05/01 06:36:29
Yes, there is probably no reason for this restrict
| |
594 for (name, option) in SIMPLE_OPTIONS.iteritems(): | 613 for (name, option) in SIMPLE_OPTIONS.iteritems(): |
595 if (not option.get('default')) and (name not in ARGUMENTS): | 614 if (not option.get('default')) and (name not in ARGUMENTS): |
596 message = ("A value for option %s must be specified (%s)." % | 615 message = ("A value for option %s must be specified (%s)." % |
597 (name, ", ".join(option['values']))) | 616 (name, ", ".join(option['values']))) |
598 Abort(message) | 617 Abort(message) |
599 if not env[name] in option['values']: | 618 if not env[name] in option['values']: |
600 message = ("Unknown %s value '%s'. Possible values are (%s)." % | 619 message = ("Unknown %s value '%s'. Possible values are (%s)." % |
601 (name, env[name], ", ".join(option['values']))) | 620 (name, env[name], ", ".join(option['values']))) |
602 Abort(message) | 621 Abort(message) |
603 | 622 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
820 # version of scons. Also, there's a bug in some revisions that | 839 # version of scons. Also, there's a bug in some revisions that |
821 # doesn't allow this flag to be set, so we swallow any exceptions. | 840 # doesn't allow this flag to be set, so we swallow any exceptions. |
822 # Lovely. | 841 # Lovely. |
823 try: | 842 try: |
824 SetOption('warn', 'no-deprecated') | 843 SetOption('warn', 'no-deprecated') |
825 except: | 844 except: |
826 pass | 845 pass |
827 | 846 |
828 | 847 |
829 Build() | 848 Build() |
OLD | NEW |