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 | |
39 # 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 |
40 # 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 |
41 # environment variables to the cross-compiling tools. | 40 # environment variables to the cross-compiling tools. |
42 ANDROID_TOP = os.environ.get('TOP') | 41 ANDROID_TOP = os.environ.get('TOP') |
43 if ANDROID_TOP is None: | 42 if ANDROID_TOP is None: |
44 ANDROID_TOP="" | 43 ANDROID_TOP="" |
45 | 44 |
46 # TODO: Sort these issues out properly but as a temporary solution for gcc 4.4 | 45 # TODO: Sort these issues out properly but as a temporary solution for gcc 4.4 |
47 # on linux we need these compiler flags to avoid crashes in the v8 test suite | 46 # on linux we need these compiler flags to avoid crashes in the v8 test suite |
48 # and avoid dtoa.c strict aliasing issues | 47 # and avoid dtoa.c strict aliasing issues |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 'os:freebsd': { | 149 'os:freebsd': { |
151 'CPPPATH' : ['/usr/local/include'], | 150 'CPPPATH' : ['/usr/local/include'], |
152 'LIBPATH' : ['/usr/local/lib'], | 151 'LIBPATH' : ['/usr/local/lib'], |
153 'CCFLAGS': ['-ansi'], | 152 'CCFLAGS': ['-ansi'], |
154 }, | 153 }, |
155 'os:openbsd': { | 154 'os:openbsd': { |
156 'CPPPATH' : ['/usr/local/include'], | 155 'CPPPATH' : ['/usr/local/include'], |
157 'LIBPATH' : ['/usr/local/lib'], | 156 'LIBPATH' : ['/usr/local/lib'], |
158 'CCFLAGS': ['-ansi'], | 157 'CCFLAGS': ['-ansi'], |
159 }, | 158 }, |
| 159 'os:solaris': { |
| 160 'CPPPATH' : ['/usr/local/include'], |
| 161 'LIBPATH' : ['/usr/local/lib'], |
| 162 'CCFLAGS': ['-ansi'], |
| 163 }, |
160 'os:win32': { | 164 'os:win32': { |
161 'CCFLAGS': ['-DWIN32'], | 165 'CCFLAGS': ['-DWIN32'], |
162 'CXXFLAGS': ['-DWIN32'], | 166 'CXXFLAGS': ['-DWIN32'], |
163 }, | 167 }, |
164 'os:android': { | 168 'os:android': { |
165 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__', | 169 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__', |
166 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], | 170 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], |
167 'CCFLAGS': ANDROID_FLAGS, | 171 'CCFLAGS': ANDROID_FLAGS, |
168 'WARNINGFLAGS': ['-Wall', '-Wno-unused', '-Werror=return-type', | 172 'WARNINGFLAGS': ['-Wall', '-Wno-unused', '-Werror=return-type', |
169 '-Wstrict-aliasing=2'], | 173 '-Wstrict-aliasing=2'], |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 'gcc': { | 310 'gcc': { |
307 'os:linux': { | 311 'os:linux': { |
308 'LIBS': ['pthread'], | 312 'LIBS': ['pthread'], |
309 }, | 313 }, |
310 'os:macos': { | 314 'os:macos': { |
311 'LIBS': ['pthread'], | 315 'LIBS': ['pthread'], |
312 }, | 316 }, |
313 'os:freebsd': { | 317 'os:freebsd': { |
314 'LIBS': ['execinfo', 'pthread'] | 318 'LIBS': ['execinfo', 'pthread'] |
315 }, | 319 }, |
| 320 'os:solaris': { |
| 321 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], |
| 322 'LINKFLAGS': ['-mt'] |
| 323 }, |
316 'os:openbsd': { | 324 'os:openbsd': { |
317 'LIBS': ['execinfo', 'pthread'] | 325 'LIBS': ['execinfo', 'pthread'] |
318 }, | 326 }, |
319 'os:win32': { | 327 'os:win32': { |
320 'LIBS': ['winmm', 'ws2_32'], | 328 'LIBS': ['winmm', 'ws2_32'], |
321 }, | 329 }, |
322 }, | 330 }, |
323 'msvc': { | 331 'msvc': { |
324 'all': { | 332 'all': { |
325 'CPPDEFINES': ['_HAS_EXCEPTIONS=0'], | 333 'CPPDEFINES': ['_HAS_EXCEPTIONS=0'], |
(...skipping 29 matching lines...) Expand all Loading... |
355 }, | 363 }, |
356 'os:linux': { | 364 'os:linux': { |
357 'LIBS': ['pthread'], | 365 'LIBS': ['pthread'], |
358 }, | 366 }, |
359 'os:macos': { | 367 'os:macos': { |
360 'LIBS': ['pthread'], | 368 'LIBS': ['pthread'], |
361 }, | 369 }, |
362 'os:freebsd': { | 370 'os:freebsd': { |
363 'LIBS': ['execinfo', 'pthread'] | 371 'LIBS': ['execinfo', 'pthread'] |
364 }, | 372 }, |
| 373 'os:solaris': { |
| 374 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], |
| 375 'LINKFLAGS': ['-mt'] |
| 376 }, |
365 'os:openbsd': { | 377 'os:openbsd': { |
366 'LIBS': ['execinfo', 'pthread'] | 378 'LIBS': ['execinfo', 'pthread'] |
367 }, | 379 }, |
368 'os:win32': { | 380 'os:win32': { |
369 'LIBS': ['winmm', 'ws2_32'] | 381 'LIBS': ['winmm', 'ws2_32'] |
370 }, | 382 }, |
371 'os:android': { | 383 'os:android': { |
372 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__', | 384 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__', |
373 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], | 385 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], |
374 'CCFLAGS': ANDROID_FLAGS, | 386 'CCFLAGS': ANDROID_FLAGS, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 'os:linux': { | 425 'os:linux': { |
414 'LIBS': ['pthread'], | 426 'LIBS': ['pthread'], |
415 }, | 427 }, |
416 'os:macos': { | 428 'os:macos': { |
417 'LIBS': ['pthread'], | 429 'LIBS': ['pthread'], |
418 }, | 430 }, |
419 'os:freebsd': { | 431 'os:freebsd': { |
420 'LIBPATH' : ['/usr/local/lib'], | 432 'LIBPATH' : ['/usr/local/lib'], |
421 'LIBS': ['execinfo', 'pthread'] | 433 'LIBS': ['execinfo', 'pthread'] |
422 }, | 434 }, |
| 435 'os:solaris': { |
| 436 'LIBPATH' : ['/usr/local/lib'], |
| 437 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], |
| 438 'LINKFLAGS': ['-mt'] |
| 439 }, |
423 'os:openbsd': { | 440 'os:openbsd': { |
424 'LIBPATH' : ['/usr/local/lib'], | 441 'LIBPATH' : ['/usr/local/lib'], |
425 'LIBS': ['execinfo', 'pthread'] | 442 'LIBS': ['execinfo', 'pthread'] |
426 }, | 443 }, |
427 'os:win32': { | 444 'os:win32': { |
428 'LIBS': ['winmm', 'ws2_32'] | 445 'LIBS': ['winmm', 'ws2_32'] |
429 }, | 446 }, |
430 'os:android': { | 447 'os:android': { |
431 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__', | 448 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__', |
432 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], | 449 '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 }, | 539 }, |
523 'os:linux': { | 540 'os:linux': { |
524 'LIBS': ['pthread'], | 541 'LIBS': ['pthread'], |
525 }, | 542 }, |
526 'os:macos': { | 543 'os:macos': { |
527 'LIBS': ['pthread'], | 544 'LIBS': ['pthread'], |
528 }, | 545 }, |
529 'os:freebsd': { | 546 'os:freebsd': { |
530 'LIBS': ['pthread'], | 547 'LIBS': ['pthread'], |
531 }, | 548 }, |
| 549 'os:solaris': { |
| 550 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], |
| 551 'LINKFLAGS': ['-mt'] |
| 552 }, |
532 'os:openbsd': { | 553 'os:openbsd': { |
533 'LIBS': ['pthread'], | 554 'LIBS': ['pthread'], |
534 }, | 555 }, |
535 'os:android': { | 556 'os:android': { |
536 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'], | 557 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'], |
537 'LINKFLAGS': ANDROID_LINKFLAGS, | 558 'LINKFLAGS': ANDROID_LINKFLAGS, |
538 'LIBS': ['log', 'c', 'stdc++', 'm'], | 559 'LIBS': ['log', 'c', 'stdc++', 'm'], |
539 }, | 560 }, |
540 'os:win32': { | 561 'os:win32': { |
541 'LIBS': ['winmm', 'ws2_32'], | 562 'LIBS': ['winmm', 'ws2_32'], |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 ARCH_GUESS = utils.GuessArchitecture() | 596 ARCH_GUESS = utils.GuessArchitecture() |
576 | 597 |
577 | 598 |
578 SIMPLE_OPTIONS = { | 599 SIMPLE_OPTIONS = { |
579 'toolchain': { | 600 'toolchain': { |
580 'values': ['gcc', 'msvc'], | 601 'values': ['gcc', 'msvc'], |
581 'default': TOOLCHAIN_GUESS, | 602 'default': TOOLCHAIN_GUESS, |
582 'help': 'the toolchain to use (' + TOOLCHAIN_GUESS + ')' | 603 'help': 'the toolchain to use (' + TOOLCHAIN_GUESS + ')' |
583 }, | 604 }, |
584 'os': { | 605 'os': { |
585 'values': ['freebsd', 'linux', 'macos', 'win32', 'android', 'openbsd'], | 606 'values': ['freebsd', 'linux', 'macos', 'win32', 'android', 'openbsd', 'sola
ris'], |
586 'default': OS_GUESS, | 607 'default': OS_GUESS, |
587 'help': 'the os to build for (' + OS_GUESS + ')' | 608 'help': 'the os to build for (' + OS_GUESS + ')' |
588 }, | 609 }, |
589 'arch': { | 610 'arch': { |
590 'values':['arm', 'ia32', 'x64'], | 611 'values':['arm', 'ia32', 'x64'], |
591 'default': ARCH_GUESS, | 612 'default': ARCH_GUESS, |
592 'help': 'the architecture to build for (' + ARCH_GUESS + ')' | 613 'help': 'the architecture to build for (' + ARCH_GUESS + ')' |
593 }, | 614 }, |
594 'regexp': { | 615 'regexp': { |
595 'values': ['native', 'interpreted'], | 616 'values': ['native', 'interpreted'], |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 join('src', 'SConscript'), | 950 join('src', 'SConscript'), |
930 build_dir=join('obj', target_id), | 951 build_dir=join('obj', target_id), |
931 exports='context', | 952 exports='context', |
932 duplicate=False | 953 duplicate=False |
933 ) | 954 ) |
934 | 955 |
935 context.mksnapshot_targets.append(mksnapshot) | 956 context.mksnapshot_targets.append(mksnapshot) |
936 | 957 |
937 # Link the object files into a library. | 958 # Link the object files into a library. |
938 env.Replace(**context.flags['v8']) | 959 env.Replace(**context.flags['v8']) |
| 960 |
939 context.ApplyEnvOverrides(env) | 961 context.ApplyEnvOverrides(env) |
940 if context.options['library'] == 'static': | 962 if context.options['library'] == 'static': |
941 library = env.StaticLibrary(library_name, object_files) | 963 library = env.StaticLibrary(library_name, object_files) |
942 else: | 964 else: |
943 # There seems to be a glitch in the way scons decides where to put | 965 # There seems to be a glitch in the way scons decides where to put |
944 # PDB files when compiling using MSVC so we specify it manually. | 966 # PDB files when compiling using MSVC so we specify it manually. |
945 # This should not affect any other platforms. | 967 # This should not affect any other platforms. |
946 pdb_name = library_name + '.dll.pdb' | 968 pdb_name = library_name + '.dll.pdb' |
947 library = env.SharedLibrary(library_name, object_files, PDB=pdb_name) | 969 library = env.SharedLibrary(library_name, object_files, PDB=pdb_name) |
948 context.library_targets.append(library) | 970 context.library_targets.append(library) |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 # version of scons. Also, there's a bug in some revisions that | 1041 # version of scons. Also, there's a bug in some revisions that |
1020 # doesn't allow this flag to be set, so we swallow any exceptions. | 1042 # doesn't allow this flag to be set, so we swallow any exceptions. |
1021 # Lovely. | 1043 # Lovely. |
1022 try: | 1044 try: |
1023 SetOption('warn', 'no-deprecated') | 1045 SetOption('warn', 'no-deprecated') |
1024 except: | 1046 except: |
1025 pass | 1047 pass |
1026 | 1048 |
1027 | 1049 |
1028 Build() | 1050 Build() |
OLD | NEW |