Chromium Code Reviews| 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 16 matching lines...) Expand all Loading... | |
| 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.append(join(root_dir, 'tools')) |
| 36 import js2c, utils | 36 import js2c, utils |
| 37 | 37 |
|
Søren Thygesen Gjesse
2009/03/23 10:50:36
Please add a comment on where this TOP environment
| |
| 38 TOP = os.environ.get('TOP') | |
| 39 if TOP is None: | |
| 40 TOP="" | |
| 41 | |
| 42 ANDROID_FLAGS = ['-march=armv5te', | |
| 43 '-mtune=xscale', | |
| 44 '-msoft-float', | |
| 45 '-fpic', | |
| 46 '-mthumb-interwork', | |
| 47 '-funwind-tables', | |
| 48 '-fstack-protector', | |
| 49 '-fno-short-enums', | |
| 50 '-fmessage-length=0', | |
| 51 '-finline-functions', | |
| 52 '-fno-inline-functions-called-once', | |
| 53 '-fgcse-after-reload', | |
| 54 '-frerun-cse-after-loop', | |
| 55 '-frename-registers', | |
| 56 '-fomit-frame-pointer', | |
| 57 '-fno-strict-aliasing', | |
| 58 '-finline-limit=64', | |
| 59 '-MD'] | |
| 60 | |
| 61 ANDROID_INCLUDES = [TOP + '/bionic/libc/arch-arm/include', | |
| 62 TOP + '/bionic/libc/include', | |
| 63 TOP + '/bionic/libstdc++/include', | |
| 64 TOP + '/bionic/libc/kernel/common', | |
| 65 TOP + '/bionic/libc/kernel/arch-arm', | |
| 66 TOP + '/bionic/libm/include', | |
| 67 TOP + '/bionic/libm/include/arch/arm', | |
| 68 TOP + '/bionic/libthread_db/include'] | |
| 38 | 69 |
| 39 LIBRARY_FLAGS = { | 70 LIBRARY_FLAGS = { |
| 40 'all': { | 71 'all': { |
| 41 'CPPDEFINES': ['ENABLE_LOGGING_AND_PROFILING'] | 72 'CPPDEFINES': ['ENABLE_LOGGING_AND_PROFILING'] |
| 42 }, | 73 }, |
| 43 'gcc': { | 74 'gcc': { |
| 44 'all': { | 75 'all': { |
| 45 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], | 76 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
| 46 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'], | 77 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'], |
| 47 }, | 78 }, |
| 48 'mode:debug': { | 79 'mode:debug': { |
| 49 'CCFLAGS': ['-g', '-O0'], | 80 'CCFLAGS': ['-g', '-O0'], |
| 50 'CPPDEFINES': ['ENABLE_DISASSEMBLER', 'DEBUG'] | 81 'CPPDEFINES': ['ENABLE_DISASSEMBLER', 'DEBUG'] |
| 51 }, | 82 }, |
| 52 'mode:release': { | 83 'mode:release': { |
| 53 'CCFLAGS': ['-O3', '-fomit-frame-pointer', '-fdata-sections', '-ffunc tion-sections'] | 84 'CCFLAGS': ['-O3', '-fomit-frame-pointer', '-fdata-sections', '-ffunc tion-sections'], |
| 85 'os:android': { | |
| 86 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] | |
| 87 } | |
| 54 }, | 88 }, |
| 55 'os:linux': { | 89 'os:linux': { |
| 56 'CCFLAGS': ['-ansi'], | 90 'CCFLAGS': ['-ansi'], |
| 57 }, | 91 }, |
| 58 'os:macos': { | 92 'os:macos': { |
| 59 'CCFLAGS': ['-ansi'], | 93 'CCFLAGS': ['-ansi'], |
| 60 }, | 94 }, |
| 61 'os:freebsd': { | 95 'os:freebsd': { |
| 62 'CCFLAGS': ['-ansi'], | 96 'CCFLAGS': ['-ansi'], |
| 63 }, | 97 }, |
| 64 'os:win32': { | 98 'os:win32': { |
| 65 'CCFLAGS': ['-DWIN32'], | 99 'CCFLAGS': ['-DWIN32'], |
| 66 'CXXFLAGS': ['-DWIN32'], | 100 'CXXFLAGS': ['-DWIN32'], |
| 67 }, | 101 }, |
| 102 'os:android': { | |
| 103 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__', '__ARM_AR CH_5E__', '__ARM_ARCH_5TE__'], | |
| 104 'CCFLAGS': ANDROID_FLAGS, | |
| 105 'WARNINGFLAGS': ['-Wall', '-Wno-unused', '-Werror=return-type', '-Wstrict- aliasing=2'], | |
| 106 'CPPPATH': ANDROID_INCLUDES, | |
| 107 }, | |
| 68 'wordsize:64': { | 108 'wordsize:64': { |
| 69 'CCFLAGS': ['-m32'], | 109 'CCFLAGS': ['-m32'], |
| 70 'LINKFLAGS': ['-m32'] | 110 'LINKFLAGS': ['-m32'] |
| 71 }, | 111 }, |
| 72 'prof:oprofile': { | 112 'prof:oprofile': { |
| 73 'CPPDEFINES': ['ENABLE_OPROFILE_AGENT'] | 113 'CPPDEFINES': ['ENABLE_OPROFILE_AGENT'] |
| 74 } | 114 } |
| 75 }, | 115 }, |
| 76 'msvc': { | 116 'msvc': { |
| 77 'all': { | 117 'all': { |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 107 } | 147 } |
| 108 }, | 148 }, |
| 109 } | 149 } |
| 110 } | 150 } |
| 111 | 151 |
| 112 | 152 |
| 113 V8_EXTRA_FLAGS = { | 153 V8_EXTRA_FLAGS = { |
| 114 'gcc': { | 154 'gcc': { |
| 115 'all': { | 155 'all': { |
| 116 'CXXFLAGS': [], #['-fvisibility=hidden'], | 156 'CXXFLAGS': [], #['-fvisibility=hidden'], |
| 117 'WARNINGFLAGS': ['-pedantic', '-Wall', '-Werror', '-W', | 157 'WARNINGFLAGS': ['-Wall', '-Werror', '-W', |
| 118 '-Wno-unused-parameter'] | 158 '-Wno-unused-parameter'] |
| 119 }, | 159 }, |
| 120 'arch:arm': { | 160 'arch:arm': { |
| 121 'CPPDEFINES': ['ARM'] | 161 'CPPDEFINES': ['ARM'] |
| 122 }, | 162 }, |
| 163 'arch:android': { | |
| 164 'CPPDEFINES': ['ARM'] | |
| 165 }, | |
| 123 'os:win32': { | 166 'os:win32': { |
| 124 'WARNINGFLAGS': ['-Wno-long-long'] | 167 'WARNINGFLAGS': ['-pedantic', '-Wno-long-long'] |
| 168 }, | |
| 169 'os:linux': { | |
| 170 'WARNINGFLAGS': ['-pedantic'] | |
| 171 }, | |
| 172 'os:macos': { | |
| 173 'WARNINGFLAGS': ['-pedantic'] | |
| 125 }, | 174 }, |
| 126 'disassembler:on': { | 175 'disassembler:on': { |
| 127 'CPPDEFINES': ['ENABLE_DISASSEMBLER'] | 176 'CPPDEFINES': ['ENABLE_DISASSEMBLER'] |
| 128 } | 177 } |
| 129 }, | 178 }, |
| 130 'msvc': { | 179 'msvc': { |
| 131 'all': { | 180 'all': { |
| 132 'WARNINGFLAGS': ['/W3', '/WX', '/wd4355', '/wd4800'] | 181 'WARNINGFLAGS': ['/W3', '/WX', '/wd4355', '/wd4800'] |
| 133 }, | 182 }, |
| 134 'library:shared': { | 183 'library:shared': { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 'all': { | 216 'all': { |
| 168 'LIBS': ['winmm', 'ws2_32'] | 217 'LIBS': ['winmm', 'ws2_32'] |
| 169 } | 218 } |
| 170 } | 219 } |
| 171 } | 220 } |
| 172 | 221 |
| 173 | 222 |
| 174 DTOA_EXTRA_FLAGS = { | 223 DTOA_EXTRA_FLAGS = { |
| 175 'gcc': { | 224 'gcc': { |
| 176 'all': { | 225 'all': { |
| 177 'WARNINGFLAGS': ['-Werror'] | 226 'WARNINGFLAGS': ['-Werror', '-Wno-uninitialized'] |
| 178 } | 227 } |
| 179 }, | 228 }, |
| 180 'msvc': { | 229 'msvc': { |
| 181 'all': { | 230 'all': { |
| 182 'WARNINGFLAGS': ['/WX', '/wd4018', '/wd4244'] | 231 'WARNINGFLAGS': ['/WX', '/wd4018', '/wd4244'] |
| 183 } | 232 } |
| 184 } | 233 } |
| 185 } | 234 } |
| 186 | 235 |
| 187 | 236 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 223 } | 272 } |
| 224 | 273 |
| 225 | 274 |
| 226 SAMPLE_FLAGS = { | 275 SAMPLE_FLAGS = { |
| 227 'all': { | 276 'all': { |
| 228 'CPPPATH': [join(abspath('.'), 'include')], | 277 'CPPPATH': [join(abspath('.'), 'include')], |
| 229 'LIBS': ['$LIBRARY'], | 278 'LIBS': ['$LIBRARY'], |
| 230 }, | 279 }, |
| 231 'gcc': { | 280 'gcc': { |
| 232 'all': { | 281 'all': { |
| 233 'LIBPATH': ['.'] | 282 'LIBPATH': ['.'], |
| 283 'CCFLAGS': ['-fno-rtti', '-fno-exceptions'] | |
| 234 }, | 284 }, |
| 235 'os:linux': { | 285 'os:linux': { |
| 236 'LIBS': ['pthread', 'rt'], | 286 'LIBS': ['pthread', 'rt'], |
| 237 }, | 287 }, |
| 238 'os:macos': { | 288 'os:macos': { |
| 239 'LIBS': ['pthread'], | 289 'LIBS': ['pthread'], |
| 240 }, | 290 }, |
| 241 'os:freebsd': { | 291 'os:freebsd': { |
| 242 'LIBS': ['execinfo', 'pthread'] | 292 'LIBS': ['execinfo', 'pthread'] |
| 243 }, | 293 }, |
| 244 'os:win32': { | 294 'os:win32': { |
| 245 'LIBS': ['winmm', 'ws2_32'] | 295 'LIBS': ['winmm', 'ws2_32'] |
| 246 }, | 296 }, |
|
Søren Thygesen Gjesse
2009/03/23 10:50:36
Isn't all this stuff required for building mksnaps
| |
| 297 'os:android': { | |
| 298 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__', '__ARM_AR CH_5E__', '__ARM_ARCH_5TE__'], | |
| 299 'CCFLAGS': ANDROID_FLAGS, | |
| 300 'CPPPATH': ANDROID_INCLUDES, | |
| 301 'LIBPATH': [TOP + '/out/target/product/generic/obj/lib'], | |
| 302 'LINKFLAGS': ['-nostdlib', '-Bdynamic', '-Wl,-T,' + TOP + '/build/core/ armelf.x', '-Wl,-dynamic-linker,/system/bin/linker', '-Wl,--gc-sections', '-Wl,- z,nocopyreloc', '-Wl,-rpath-link=' + TOP + '/out/target/product/generic/obj/lib' , TOP + '/out/target/product/generic/obj/lib/crtbegin_dynamic.o', TOP + '/prebui lt/linux-x86/toolchain/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1/interwork/libgcc.a' , TOP + '/out/target/product/generic/obj/lib/crtend_android.o'], | |
| 303 'LIBS': ['c', 'stdc++', 'm'], | |
| 304 'mode:release': { | |
| 305 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] | |
| 306 } | |
| 307 }, | |
| 247 'wordsize:64': { | 308 'wordsize:64': { |
| 248 'CCFLAGS': ['-m32'], | 309 'CCFLAGS': ['-m32'], |
| 249 'LINKFLAGS': ['-m32'] | 310 'LINKFLAGS': ['-m32'] |
| 250 }, | 311 }, |
| 251 'mode:release': { | 312 'mode:release': { |
| 252 'CCFLAGS': ['-O2'] | 313 'CCFLAGS': ['-O2'] |
| 253 }, | 314 }, |
| 254 'mode:debug': { | 315 'mode:debug': { |
| 255 'CCFLAGS': ['-g', '-O0'] | 316 'CCFLAGS': ['-g', '-O0'] |
| 256 }, | 317 }, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 348 WORDSIZE_GUESS = utils.GuessWordsize() | 409 WORDSIZE_GUESS = utils.GuessWordsize() |
| 349 | 410 |
| 350 | 411 |
| 351 SIMPLE_OPTIONS = { | 412 SIMPLE_OPTIONS = { |
| 352 'toolchain': { | 413 'toolchain': { |
| 353 'values': ['gcc', 'msvc'], | 414 'values': ['gcc', 'msvc'], |
| 354 'default': TOOLCHAIN_GUESS, | 415 'default': TOOLCHAIN_GUESS, |
| 355 'help': 'the toolchain to use' | 416 'help': 'the toolchain to use' |
| 356 }, | 417 }, |
| 357 'os': { | 418 'os': { |
| 358 'values': ['freebsd', 'linux', 'macos', 'win32'], | 419 'values': ['freebsd', 'linux', 'macos', 'win32', 'android'], |
| 359 'default': OS_GUESS, | 420 'default': OS_GUESS, |
| 360 'help': 'the os to build for' | 421 'help': 'the os to build for' |
| 361 }, | 422 }, |
| 362 'arch': { | 423 'arch': { |
| 363 'values':['arm', 'ia32'], | 424 'values':['arm', 'ia32'], |
| 364 'default': ARCH_GUESS, | 425 'default': ARCH_GUESS, |
| 365 'help': 'the architecture to build for' | 426 'help': 'the architecture to build for' |
| 366 }, | 427 }, |
| 367 'snapshot': { | 428 'snapshot': { |
| 368 'values': ['on', 'off', 'nobuild'], | 429 'values': ['on', 'off', 'nobuild'], |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 503 self.AddRelevantSubFlags(options, { key: value }) | 564 self.AddRelevantSubFlags(options, { key: value }) |
| 504 else: | 565 else: |
| 505 if not key in options: | 566 if not key in options: |
| 506 options[key] = value | 567 options[key] = value |
| 507 else: | 568 else: |
| 508 prefix = options[key] | 569 prefix = options[key] |
| 509 if isinstance(prefix, StringTypes): prefix = prefix.split() | 570 if isinstance(prefix, StringTypes): prefix = prefix.split() |
| 510 options[key] = prefix + value | 571 options[key] = prefix + value |
| 511 | 572 |
| 512 def ConfigureObject(self, env, input, **kw): | 573 def ConfigureObject(self, env, input, **kw): |
| 574 if (kw.has_key('CPPPATH') and env.has_key('CPPPATH')): | |
| 575 kw['CPPPATH'] += env['CPPPATH'] | |
| 513 if self.options['library'] == 'static': | 576 if self.options['library'] == 'static': |
| 514 return env.StaticObject(input, **kw) | 577 return env.StaticObject(input, **kw) |
| 515 else: | 578 else: |
| 516 return env.SharedObject(input, **kw) | 579 return env.SharedObject(input, **kw) |
| 517 | 580 |
| 518 def ApplyEnvOverrides(self, env): | 581 def ApplyEnvOverrides(self, env): |
| 519 if not self.env_overrides: | 582 if not self.env_overrides: |
| 520 return | 583 return |
| 521 if type(env['ENV']) == DictType: | 584 if type(env['ENV']) == DictType: |
| 522 env['ENV'].update(**self.env_overrides) | 585 env['ENV'].update(**self.env_overrides) |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 668 # version of scons. Also, there's a bug in some revisions that | 731 # version of scons. Also, there's a bug in some revisions that |
| 669 # doesn't allow this flag to be set, so we swallow any exceptions. | 732 # doesn't allow this flag to be set, so we swallow any exceptions. |
| 670 # Lovely. | 733 # Lovely. |
| 671 try: | 734 try: |
| 672 SetOption('warn', 'no-deprecated') | 735 SetOption('warn', 'no-deprecated') |
| 673 except: | 736 except: |
| 674 pass | 737 pass |
| 675 | 738 |
| 676 | 739 |
| 677 Build() | 740 Build() |
| OLD | NEW |