ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 1 | # Copyright 2008 the V8 project authors. All rights reserved. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 2 | # Redistribution and use in source and binary forms, with or without |
| 3 | # modification, are permitted provided that the following conditions are |
| 4 | # met: |
| 5 | # |
| 6 | # * Redistributions of source code must retain the above copyright |
| 7 | # notice, this list of conditions and the following disclaimer. |
| 8 | # * Redistributions in binary form must reproduce the above |
| 9 | # copyright notice, this list of conditions and the following |
| 10 | # disclaimer in the documentation and/or other materials provided |
| 11 | # with the distribution. |
| 12 | # * Neither the name of Google Inc. nor the names of its |
| 13 | # contributors may be used to endorse or promote products derived |
| 14 | # from this software without specific prior written permission. |
| 15 | # |
| 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 19 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 20 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 21 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 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. |
| 27 | |
| 28 | import platform |
kasper.lund | 212ac23 | 2008-07-16 07:07:30 +0000 | [diff] [blame] | 29 | import re |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 30 | import sys |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 31 | import os |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 32 | from os.path import join, dirname, abspath |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 33 | from types import DictType, StringTypes |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 34 | root_dir = dirname(File('SConstruct').rfile().abspath) |
| 35 | sys.path.append(join(root_dir, 'tools')) |
ager@chromium.org | c27e4e7 | 2008-09-04 13:52:27 +0000 | [diff] [blame] | 36 | import js2c, utils |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 37 | |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 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 |
| 40 | # environment variables to the cross-compiling tools. |
| 41 | ANDROID_TOP = os.environ.get('TOP') |
| 42 | if ANDROID_TOP is None: |
| 43 | ANDROID_TOP="" |
| 44 | |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 45 | # TODO: Sort these issues out properly but as a temporary solution for gcc 4.4 |
ager@chromium.org | e2902be | 2009-06-08 12:21:35 +0000 | [diff] [blame] | 46 | # on linux we need these compiler flags to avoid crashes in the v8 test suite |
| 47 | # and avoid dtoa.c strict aliasing issues |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 48 | if os.environ.get('GCC_VERSION') == '44': |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 49 | GCC_EXTRA_CCFLAGS = ['-fno-tree-vrp', '-fno-strict-aliasing'] |
| 50 | GCC_DTOA_EXTRA_CCFLAGS = [] |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 51 | else: |
| 52 | GCC_EXTRA_CCFLAGS = [] |
| 53 | GCC_DTOA_EXTRA_CCFLAGS = [] |
| 54 | |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 55 | ANDROID_FLAGS = ['-march=armv5te', |
| 56 | '-mtune=xscale', |
| 57 | '-msoft-float', |
| 58 | '-fpic', |
| 59 | '-mthumb-interwork', |
| 60 | '-funwind-tables', |
| 61 | '-fstack-protector', |
| 62 | '-fno-short-enums', |
| 63 | '-fmessage-length=0', |
| 64 | '-finline-functions', |
| 65 | '-fno-inline-functions-called-once', |
| 66 | '-fgcse-after-reload', |
| 67 | '-frerun-cse-after-loop', |
| 68 | '-frename-registers', |
| 69 | '-fomit-frame-pointer', |
| 70 | '-fno-strict-aliasing', |
| 71 | '-finline-limit=64', |
| 72 | '-MD'] |
| 73 | |
| 74 | ANDROID_INCLUDES = [ANDROID_TOP + '/bionic/libc/arch-arm/include', |
| 75 | ANDROID_TOP + '/bionic/libc/include', |
| 76 | ANDROID_TOP + '/bionic/libstdc++/include', |
| 77 | ANDROID_TOP + '/bionic/libc/kernel/common', |
| 78 | ANDROID_TOP + '/bionic/libc/kernel/arch-arm', |
| 79 | ANDROID_TOP + '/bionic/libm/include', |
| 80 | ANDROID_TOP + '/bionic/libm/include/arch/arm', |
christian.plesner.hansen@gmail.com | 5a6af92 | 2009-08-12 14:20:51 +0000 | [diff] [blame] | 81 | ANDROID_TOP + '/bionic/libthread_db/include', |
| 82 | ANDROID_TOP + '/frameworks/base/include', |
| 83 | ANDROID_TOP + '/system/core/include'] |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 84 | |
kasperl@chromium.org | f5aa837 | 2009-03-24 14:47:14 +0000 | [diff] [blame] | 85 | ANDROID_LINKFLAGS = ['-nostdlib', |
| 86 | '-Bdynamic', |
| 87 | '-Wl,-T,' + ANDROID_TOP + '/build/core/armelf.x', |
| 88 | '-Wl,-dynamic-linker,/system/bin/linker', |
| 89 | '-Wl,--gc-sections', |
| 90 | '-Wl,-z,nocopyreloc', |
| 91 | '-Wl,-rpath-link=' + ANDROID_TOP + '/out/target/product/generic/obj/lib', |
| 92 | ANDROID_TOP + '/out/target/product/generic/obj/lib/crtbegin_dynamic.o', |
sgjesse@chromium.org | df7a284 | 2010-03-25 14:34:15 +0000 | [diff] [blame] | 93 | ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork/libgcc.a', |
kasperl@chromium.org | f5aa837 | 2009-03-24 14:47:14 +0000 | [diff] [blame] | 94 | ANDROID_TOP + '/out/target/product/generic/obj/lib/crtend_android.o']; |
| 95 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 96 | LIBRARY_FLAGS = { |
| 97 | 'all': { |
kasperl@chromium.org | 68ac009 | 2009-07-09 06:00:35 +0000 | [diff] [blame] | 98 | 'CPPPATH': [join(root_dir, 'src')], |
| 99 | 'regexp:native': { |
kasperl@chromium.org | 68ac009 | 2009-07-09 06:00:35 +0000 | [diff] [blame] | 100 | 'CPPDEFINES': ['V8_NATIVE_REGEXP'] |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 101 | }, |
| 102 | 'mode:debug': { |
| 103 | 'CPPDEFINES': ['V8_ENABLE_CHECKS'] |
ager@chromium.org | 4af710e | 2009-09-15 12:20:11 +0000 | [diff] [blame] | 104 | }, |
| 105 | 'profilingsupport:on': { |
| 106 | 'CPPDEFINES': ['ENABLE_LOGGING_AND_PROFILING'], |
| 107 | }, |
| 108 | 'debuggersupport:on': { |
| 109 | 'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT'], |
kasperl@chromium.org | 68ac009 | 2009-07-09 06:00:35 +0000 | [diff] [blame] | 110 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 111 | }, |
| 112 | 'gcc': { |
| 113 | 'all': { |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 114 | 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 115 | 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 116 | }, |
ager@chromium.org | 4af710e | 2009-09-15 12:20:11 +0000 | [diff] [blame] | 117 | 'visibility:hidden': { |
| 118 | # Use visibility=default to disable this. |
| 119 | 'CXXFLAGS': ['-fvisibility=hidden'] |
| 120 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 121 | 'mode:debug': { |
| 122 | 'CCFLAGS': ['-g', '-O0'], |
ager@chromium.org | 71daaf6 | 2009-04-01 07:22:49 +0000 | [diff] [blame] | 123 | 'CPPDEFINES': ['ENABLE_DISASSEMBLER', 'DEBUG'], |
| 124 | 'os:android': { |
| 125 | 'CCFLAGS': ['-mthumb'] |
| 126 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 127 | }, |
| 128 | 'mode:release': { |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 129 | 'CCFLAGS': ['-O3', '-fomit-frame-pointer', '-fdata-sections', |
| 130 | '-ffunction-sections'], |
| 131 | 'os:android': { |
ager@chromium.org | 71daaf6 | 2009-04-01 07:22:49 +0000 | [diff] [blame] | 132 | 'CCFLAGS': ['-mthumb', '-Os'], |
ager@chromium.org | 4af710e | 2009-09-15 12:20:11 +0000 | [diff] [blame] | 133 | 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 134 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 135 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 136 | 'os:linux': { |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 137 | 'CCFLAGS': ['-ansi'] + GCC_EXTRA_CCFLAGS, |
sgjesse@chromium.org | f8c8180 | 2009-03-30 07:19:14 +0000 | [diff] [blame] | 138 | 'library:shared': { |
sgjesse@chromium.org | b9d7da1 | 2009-08-05 08:38:10 +0000 | [diff] [blame] | 139 | 'CPPDEFINES': ['V8_SHARED'], |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 140 | 'LIBS': ['pthread'] |
sgjesse@chromium.org | f8c8180 | 2009-03-30 07:19:14 +0000 | [diff] [blame] | 141 | } |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 142 | }, |
| 143 | 'os:macos': { |
ager@chromium.org | 5aa501c | 2009-06-23 07:57:28 +0000 | [diff] [blame] | 144 | 'CCFLAGS': ['-ansi', '-mmacosx-version-min=10.4'], |
kmillikin@chromium.org | 13bd294 | 2009-12-16 15:36:05 +0000 | [diff] [blame] | 145 | 'library:shared': { |
| 146 | 'CPPDEFINES': ['V8_SHARED'] |
| 147 | } |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 148 | }, |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 149 | 'os:freebsd': { |
ager@chromium.org | e2902be | 2009-06-08 12:21:35 +0000 | [diff] [blame] | 150 | 'CPPPATH' : ['/usr/local/include'], |
| 151 | 'LIBPATH' : ['/usr/local/lib'], |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 152 | 'CCFLAGS': ['-ansi'], |
| 153 | }, |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 154 | 'os:openbsd': { |
| 155 | 'CPPPATH' : ['/usr/local/include'], |
| 156 | 'LIBPATH' : ['/usr/local/lib'], |
| 157 | 'CCFLAGS': ['-ansi'], |
| 158 | }, |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 159 | 'os:solaris': { |
| 160 | 'CPPPATH' : ['/usr/local/include'], |
| 161 | 'LIBPATH' : ['/usr/local/lib'], |
| 162 | 'CCFLAGS': ['-ansi'], |
| 163 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 164 | 'os:win32': { |
| 165 | 'CCFLAGS': ['-DWIN32'], |
| 166 | 'CXXFLAGS': ['-DWIN32'], |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 167 | }, |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 168 | 'os:android': { |
| 169 | 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__', |
| 170 | '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], |
| 171 | 'CCFLAGS': ANDROID_FLAGS, |
| 172 | 'WARNINGFLAGS': ['-Wall', '-Wno-unused', '-Werror=return-type', |
| 173 | '-Wstrict-aliasing=2'], |
| 174 | 'CPPPATH': ANDROID_INCLUDES, |
| 175 | }, |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 176 | 'arch:ia32': { |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 177 | 'CPPDEFINES': ['V8_TARGET_ARCH_IA32'], |
| 178 | 'CCFLAGS': ['-m32'], |
| 179 | 'LINKFLAGS': ['-m32'] |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 180 | }, |
| 181 | 'arch:arm': { |
ager@chromium.org | 9085a01 | 2009-05-11 19:22:57 +0000 | [diff] [blame] | 182 | 'CPPDEFINES': ['V8_TARGET_ARCH_ARM'] |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 183 | }, |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 184 | 'simulator:arm': { |
| 185 | 'CCFLAGS': ['-m32'], |
| 186 | 'LINKFLAGS': ['-m32'] |
| 187 | }, |
kmillikin@chromium.org | 13bd294 | 2009-12-16 15:36:05 +0000 | [diff] [blame] | 188 | 'armvariant:thumb2': { |
| 189 | 'CPPDEFINES': ['V8_ARM_VARIANT_THUMB'] |
| 190 | }, |
| 191 | 'armvariant:arm': { |
| 192 | 'CPPDEFINES': ['V8_ARM_VARIANT_ARM'] |
| 193 | }, |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 194 | 'arch:mips': { |
| 195 | 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'], |
| 196 | 'simulator:none': { |
| 197 | 'CCFLAGS': ['-EL', '-mips32r2', '-Wa,-mips32r2', '-fno-inline'], |
| 198 | 'LDFLAGS': ['-EL'] |
| 199 | } |
| 200 | }, |
| 201 | 'simulator:mips': { |
| 202 | 'CCFLAGS': ['-m32'], |
| 203 | 'LINKFLAGS': ['-m32'] |
| 204 | }, |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 205 | 'arch:x64': { |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 206 | 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], |
sgjesse@chromium.org | 911335c | 2009-08-19 12:59:44 +0000 | [diff] [blame] | 207 | 'CCFLAGS': ['-m64'], |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 208 | 'LINKFLAGS': ['-m64'], |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 209 | }, |
| 210 | 'prof:oprofile': { |
| 211 | 'CPPDEFINES': ['ENABLE_OPROFILE_AGENT'] |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 212 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 213 | }, |
| 214 | 'msvc': { |
| 215 | 'all': { |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 216 | 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 217 | 'CXXFLAGS': ['$CCFLAGS', '/GR-', '/Gy'], |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 218 | 'CPPDEFINES': ['WIN32'], |
| 219 | 'LINKFLAGS': ['/INCREMENTAL:NO', '/NXCOMPAT', '/IGNORE:4221'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 220 | 'CCPDBFLAGS': ['/Zi'] |
| 221 | }, |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 222 | 'verbose:off': { |
| 223 | 'DIALECTFLAGS': ['/nologo'], |
| 224 | 'ARFLAGS': ['/NOLOGO'] |
| 225 | }, |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 226 | 'arch:ia32': { |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 227 | 'CPPDEFINES': ['V8_TARGET_ARCH_IA32', '_USE_32BIT_TIME_T'], |
| 228 | 'LINKFLAGS': ['/MACHINE:X86'], |
| 229 | 'ARFLAGS': ['/MACHINE:X86'] |
| 230 | }, |
| 231 | 'arch:x64': { |
| 232 | 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], |
| 233 | 'LINKFLAGS': ['/MACHINE:X64'], |
| 234 | 'ARFLAGS': ['/MACHINE:X64'] |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 235 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 236 | 'mode:debug': { |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 237 | 'CCFLAGS': ['/Od', '/Gm'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 238 | 'CPPDEFINES': ['_DEBUG', 'ENABLE_DISASSEMBLER', 'DEBUG'], |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 239 | 'LINKFLAGS': ['/DEBUG'], |
| 240 | 'msvcrt:static': { |
| 241 | 'CCFLAGS': ['/MTd'] |
| 242 | }, |
| 243 | 'msvcrt:shared': { |
| 244 | 'CCFLAGS': ['/MDd'] |
| 245 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 246 | }, |
| 247 | 'mode:release': { |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 248 | 'CCFLAGS': ['/O2'], |
| 249 | 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'], |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 250 | 'msvcrt:static': { |
| 251 | 'CCFLAGS': ['/MT'] |
| 252 | }, |
| 253 | 'msvcrt:shared': { |
| 254 | 'CCFLAGS': ['/MD'] |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 255 | }, |
| 256 | 'msvcltcg:on': { |
| 257 | 'CCFLAGS': ['/GL'], |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 258 | 'ARFLAGS': ['/LTCG'], |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 259 | 'pgo:off': { |
| 260 | 'LINKFLAGS': ['/LTCG'], |
| 261 | }, |
| 262 | 'pgo:instrument': { |
| 263 | 'LINKFLAGS': ['/LTCG:PGI'] |
| 264 | }, |
| 265 | 'pgo:optimize': { |
| 266 | 'LINKFLAGS': ['/LTCG:PGO'] |
| 267 | } |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 268 | } |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 269 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 270 | } |
| 271 | } |
| 272 | |
| 273 | |
| 274 | V8_EXTRA_FLAGS = { |
| 275 | 'gcc': { |
| 276 | 'all': { |
sgjesse@chromium.org | b9d7da1 | 2009-08-05 08:38:10 +0000 | [diff] [blame] | 277 | 'WARNINGFLAGS': ['-Wall', |
| 278 | '-Werror', |
| 279 | '-W', |
| 280 | '-Wno-unused-parameter', |
| 281 | '-Wnon-virtual-dtor'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 282 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 283 | 'os:win32': { |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 284 | 'WARNINGFLAGS': ['-pedantic', '-Wno-long-long'] |
| 285 | }, |
| 286 | 'os:linux': { |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 287 | 'WARNINGFLAGS': ['-pedantic'], |
| 288 | 'library:shared': { |
| 289 | 'soname:on': { |
| 290 | 'LINKFLAGS': ['-Wl,-soname,${SONAME}'] |
| 291 | } |
| 292 | } |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 293 | }, |
| 294 | 'os:macos': { |
| 295 | 'WARNINGFLAGS': ['-pedantic'] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 296 | }, |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 297 | 'disassembler:on': { |
| 298 | 'CPPDEFINES': ['ENABLE_DISASSEMBLER'] |
| 299 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 300 | }, |
| 301 | 'msvc': { |
| 302 | 'all': { |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 303 | 'WARNINGFLAGS': ['/W3', '/WX', '/wd4355', '/wd4800'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 304 | }, |
sgjesse@chromium.org | 4e421f4 | 2009-09-07 07:18:16 +0000 | [diff] [blame] | 305 | 'library:shared': { |
| 306 | 'CPPDEFINES': ['BUILDING_V8_SHARED'], |
| 307 | 'LIBS': ['winmm', 'ws2_32'] |
| 308 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 309 | 'arch:arm': { |
ager@chromium.org | 9085a01 | 2009-05-11 19:22:57 +0000 | [diff] [blame] | 310 | 'CPPDEFINES': ['V8_TARGET_ARCH_ARM'], |
ager@chromium.org | 3bf7b91 | 2008-11-17 09:09:45 +0000 | [diff] [blame] | 311 | # /wd4996 is to silence the warning about sscanf |
| 312 | # used by the arm simulator. |
| 313 | 'WARNINGFLAGS': ['/wd4996'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 314 | }, |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 315 | 'arch:mips': { |
| 316 | 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'], |
| 317 | }, |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 318 | 'disassembler:on': { |
| 319 | 'CPPDEFINES': ['ENABLE_DISASSEMBLER'] |
| 320 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 321 | } |
| 322 | } |
| 323 | |
| 324 | |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 325 | MKSNAPSHOT_EXTRA_FLAGS = { |
| 326 | 'gcc': { |
| 327 | 'os:linux': { |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 328 | 'LIBS': ['pthread'], |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 329 | }, |
| 330 | 'os:macos': { |
| 331 | 'LIBS': ['pthread'], |
| 332 | }, |
| 333 | 'os:freebsd': { |
ager@chromium.org | e2902be | 2009-06-08 12:21:35 +0000 | [diff] [blame] | 334 | 'LIBS': ['execinfo', 'pthread'] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 335 | }, |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 336 | 'os:solaris': { |
| 337 | 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], |
| 338 | 'LINKFLAGS': ['-mt'] |
| 339 | }, |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 340 | 'os:openbsd': { |
| 341 | 'LIBS': ['execinfo', 'pthread'] |
| 342 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 343 | 'os:win32': { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 344 | 'LIBS': ['winmm', 'ws2_32'], |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 345 | }, |
| 346 | }, |
| 347 | 'msvc': { |
| 348 | 'all': { |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 349 | 'CPPDEFINES': ['_HAS_EXCEPTIONS=0'], |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 350 | 'LIBS': ['winmm', 'ws2_32'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 351 | } |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | |
| 356 | DTOA_EXTRA_FLAGS = { |
| 357 | 'gcc': { |
| 358 | 'all': { |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 359 | 'WARNINGFLAGS': ['-Werror', '-Wno-uninitialized'], |
| 360 | 'CCFLAGS': GCC_DTOA_EXTRA_CCFLAGS |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 361 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 362 | }, |
| 363 | 'msvc': { |
| 364 | 'all': { |
| 365 | 'WARNINGFLAGS': ['/WX', '/wd4018', '/wd4244'] |
| 366 | } |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | |
| 371 | CCTEST_EXTRA_FLAGS = { |
| 372 | 'all': { |
| 373 | 'CPPPATH': [join(root_dir, 'src')], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 374 | }, |
| 375 | 'gcc': { |
| 376 | 'all': { |
| 377 | 'LIBPATH': [abspath('.')] |
| 378 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 379 | 'os:linux': { |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 380 | 'LIBS': ['pthread'], |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 381 | }, |
| 382 | 'os:macos': { |
| 383 | 'LIBS': ['pthread'], |
| 384 | }, |
| 385 | 'os:freebsd': { |
| 386 | 'LIBS': ['execinfo', 'pthread'] |
| 387 | }, |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 388 | 'os:solaris': { |
| 389 | 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], |
| 390 | 'LINKFLAGS': ['-mt'] |
| 391 | }, |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 392 | 'os:openbsd': { |
| 393 | 'LIBS': ['execinfo', 'pthread'] |
| 394 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 395 | 'os:win32': { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 396 | 'LIBS': ['winmm', 'ws2_32'] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 397 | }, |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 398 | 'os:android': { |
| 399 | 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__', |
| 400 | '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], |
| 401 | 'CCFLAGS': ANDROID_FLAGS, |
| 402 | 'CPPPATH': ANDROID_INCLUDES, |
sgjesse@chromium.org | df7a284 | 2010-03-25 14:34:15 +0000 | [diff] [blame] | 403 | 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib', |
| 404 | ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork'], |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 405 | 'LINKFLAGS': ANDROID_LINKFLAGS, |
sgjesse@chromium.org | df7a284 | 2010-03-25 14:34:15 +0000 | [diff] [blame] | 406 | 'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'], |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 407 | 'mode:release': { |
| 408 | 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] |
| 409 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 410 | }, |
| 411 | }, |
| 412 | 'msvc': { |
| 413 | 'all': { |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 414 | 'CPPDEFINES': ['_HAS_EXCEPTIONS=0'], |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 415 | 'LIBS': ['winmm', 'ws2_32'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 416 | }, |
| 417 | 'library:shared': { |
| 418 | 'CPPDEFINES': ['USING_V8_SHARED'] |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 419 | }, |
| 420 | 'arch:ia32': { |
ager@chromium.org | 9085a01 | 2009-05-11 19:22:57 +0000 | [diff] [blame] | 421 | 'CPPDEFINES': ['V8_TARGET_ARCH_IA32'] |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 422 | }, |
| 423 | 'arch:x64': { |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 424 | 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], |
| 425 | 'LINKFLAGS': ['/STACK:2091752'] |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 426 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 427 | } |
| 428 | } |
| 429 | |
| 430 | |
| 431 | SAMPLE_FLAGS = { |
| 432 | 'all': { |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 433 | 'CPPPATH': [join(abspath('.'), 'include')], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 434 | }, |
| 435 | 'gcc': { |
| 436 | 'all': { |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 437 | 'LIBPATH': ['.'], |
| 438 | 'CCFLAGS': ['-fno-rtti', '-fno-exceptions'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 439 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 440 | 'os:linux': { |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 441 | 'LIBS': ['pthread'], |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 442 | }, |
| 443 | 'os:macos': { |
| 444 | 'LIBS': ['pthread'], |
| 445 | }, |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 446 | 'os:freebsd': { |
ager@chromium.org | e2902be | 2009-06-08 12:21:35 +0000 | [diff] [blame] | 447 | 'LIBPATH' : ['/usr/local/lib'], |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 448 | 'LIBS': ['execinfo', 'pthread'] |
| 449 | }, |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 450 | 'os:solaris': { |
| 451 | 'LIBPATH' : ['/usr/local/lib'], |
| 452 | 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], |
| 453 | 'LINKFLAGS': ['-mt'] |
| 454 | }, |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 455 | 'os:openbsd': { |
| 456 | 'LIBPATH' : ['/usr/local/lib'], |
| 457 | 'LIBS': ['execinfo', 'pthread'] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 458 | }, |
| 459 | 'os:win32': { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 460 | 'LIBS': ['winmm', 'ws2_32'] |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 461 | }, |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 462 | 'os:android': { |
| 463 | 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__', |
| 464 | '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], |
| 465 | 'CCFLAGS': ANDROID_FLAGS, |
| 466 | 'CPPPATH': ANDROID_INCLUDES, |
sgjesse@chromium.org | df7a284 | 2010-03-25 14:34:15 +0000 | [diff] [blame] | 467 | 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib', |
| 468 | ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork'], |
kasperl@chromium.org | f5aa837 | 2009-03-24 14:47:14 +0000 | [diff] [blame] | 469 | 'LINKFLAGS': ANDROID_LINKFLAGS, |
sgjesse@chromium.org | df7a284 | 2010-03-25 14:34:15 +0000 | [diff] [blame] | 470 | 'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'], |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 471 | 'mode:release': { |
| 472 | 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] |
| 473 | } |
| 474 | }, |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 475 | 'arch:ia32': { |
| 476 | 'CCFLAGS': ['-m32'], |
| 477 | 'LINKFLAGS': ['-m32'] |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 478 | }, |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 479 | 'arch:x64': { |
| 480 | 'CCFLAGS': ['-m64'], |
| 481 | 'LINKFLAGS': ['-m64'] |
| 482 | }, |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 483 | 'arch:mips': { |
| 484 | 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'], |
| 485 | 'simulator:none': { |
| 486 | 'CCFLAGS': ['-EL', '-mips32r2', '-Wa,-mips32r2', '-fno-inline'], |
| 487 | 'LINKFLAGS': ['-EL'], |
| 488 | 'LDFLAGS': ['-EL'] |
| 489 | } |
| 490 | }, |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 491 | 'simulator:arm': { |
| 492 | 'CCFLAGS': ['-m32'], |
| 493 | 'LINKFLAGS': ['-m32'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 494 | }, |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 495 | 'simulator:mips': { |
| 496 | 'CCFLAGS': ['-m32'], |
| 497 | 'LINKFLAGS': ['-m32'] |
| 498 | }, |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 499 | 'mode:release': { |
| 500 | 'CCFLAGS': ['-O2'] |
| 501 | }, |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 502 | 'mode:debug': { |
| 503 | 'CCFLAGS': ['-g', '-O0'] |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 504 | }, |
| 505 | 'prof:oprofile': { |
| 506 | 'LIBPATH': ['/usr/lib32', '/usr/lib32/oprofile'], |
| 507 | 'LIBS': ['opagent'] |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 508 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 509 | }, |
| 510 | 'msvc': { |
| 511 | 'all': { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 512 | 'LIBS': ['winmm', 'ws2_32'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 513 | }, |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 514 | 'verbose:off': { |
| 515 | 'CCFLAGS': ['/nologo'], |
| 516 | 'LINKFLAGS': ['/NOLOGO'] |
| 517 | }, |
| 518 | 'verbose:on': { |
| 519 | 'LINKFLAGS': ['/VERBOSE'] |
| 520 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 521 | 'library:shared': { |
| 522 | 'CPPDEFINES': ['USING_V8_SHARED'] |
| 523 | }, |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 524 | 'prof:on': { |
| 525 | 'LINKFLAGS': ['/MAP'] |
| 526 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 527 | 'mode:release': { |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 528 | 'CCFLAGS': ['/O2'], |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 529 | 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'], |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 530 | 'msvcrt:static': { |
| 531 | 'CCFLAGS': ['/MT'] |
| 532 | }, |
| 533 | 'msvcrt:shared': { |
| 534 | 'CCFLAGS': ['/MD'] |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 535 | }, |
| 536 | 'msvcltcg:on': { |
| 537 | 'CCFLAGS': ['/GL'], |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 538 | 'pgo:off': { |
| 539 | 'LINKFLAGS': ['/LTCG'], |
| 540 | }, |
| 541 | }, |
| 542 | 'pgo:instrument': { |
| 543 | 'LINKFLAGS': ['/LTCG:PGI'] |
| 544 | }, |
| 545 | 'pgo:optimize': { |
| 546 | 'LINKFLAGS': ['/LTCG:PGO'] |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 547 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 548 | }, |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 549 | 'arch:ia32': { |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 550 | 'CPPDEFINES': ['V8_TARGET_ARCH_IA32'], |
| 551 | 'LINKFLAGS': ['/MACHINE:X86'] |
| 552 | }, |
| 553 | 'arch:x64': { |
| 554 | 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 555 | 'LINKFLAGS': ['/MACHINE:X64', '/STACK:2091752'] |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 556 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 557 | 'mode:debug': { |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 558 | 'CCFLAGS': ['/Od'], |
| 559 | 'LINKFLAGS': ['/DEBUG'], |
| 560 | 'msvcrt:static': { |
| 561 | 'CCFLAGS': ['/MTd'] |
| 562 | }, |
| 563 | 'msvcrt:shared': { |
| 564 | 'CCFLAGS': ['/MDd'] |
| 565 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 566 | } |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 571 | D8_FLAGS = { |
| 572 | 'gcc': { |
| 573 | 'console:readline': { |
| 574 | 'LIBS': ['readline'] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 575 | }, |
| 576 | 'os:linux': { |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 577 | 'LIBS': ['pthread'], |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 578 | }, |
| 579 | 'os:macos': { |
| 580 | 'LIBS': ['pthread'], |
| 581 | }, |
| 582 | 'os:freebsd': { |
| 583 | 'LIBS': ['pthread'], |
| 584 | }, |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 585 | 'os:solaris': { |
| 586 | 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], |
| 587 | 'LINKFLAGS': ['-mt'] |
| 588 | }, |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 589 | 'os:openbsd': { |
| 590 | 'LIBS': ['pthread'], |
| 591 | }, |
kasperl@chromium.org | f5aa837 | 2009-03-24 14:47:14 +0000 | [diff] [blame] | 592 | 'os:android': { |
sgjesse@chromium.org | df7a284 | 2010-03-25 14:34:15 +0000 | [diff] [blame] | 593 | 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib', |
| 594 | ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork'], |
kasperl@chromium.org | f5aa837 | 2009-03-24 14:47:14 +0000 | [diff] [blame] | 595 | 'LINKFLAGS': ANDROID_LINKFLAGS, |
sgjesse@chromium.org | df7a284 | 2010-03-25 14:34:15 +0000 | [diff] [blame] | 596 | 'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'], |
kasperl@chromium.org | f5aa837 | 2009-03-24 14:47:14 +0000 | [diff] [blame] | 597 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 598 | 'os:win32': { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 599 | 'LIBS': ['winmm', 'ws2_32'], |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 600 | }, |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 601 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 602 | 'msvc': { |
| 603 | 'all': { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 604 | 'LIBS': ['winmm', 'ws2_32'] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 605 | } |
| 606 | } |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 607 | } |
| 608 | |
| 609 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 610 | SUFFIXES = { |
| 611 | 'release': '', |
| 612 | 'debug': '_g' |
| 613 | } |
| 614 | |
| 615 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 616 | def Abort(message): |
| 617 | print message |
| 618 | sys.exit(1) |
| 619 | |
| 620 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 621 | def GuessToolchain(os): |
| 622 | tools = Environment()['TOOLS'] |
| 623 | if 'gcc' in tools: |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 624 | return 'gcc' |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 625 | elif 'msvc' in tools: |
| 626 | return 'msvc' |
| 627 | else: |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 628 | return None |
| 629 | |
| 630 | |
ager@chromium.org | 870a0b6 | 2008-11-04 11:43:05 +0000 | [diff] [blame] | 631 | OS_GUESS = utils.GuessOS() |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 632 | TOOLCHAIN_GUESS = GuessToolchain(OS_GUESS) |
ager@chromium.org | c27e4e7 | 2008-09-04 13:52:27 +0000 | [diff] [blame] | 633 | ARCH_GUESS = utils.GuessArchitecture() |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 634 | |
| 635 | |
| 636 | SIMPLE_OPTIONS = { |
| 637 | 'toolchain': { |
| 638 | 'values': ['gcc', 'msvc'], |
| 639 | 'default': TOOLCHAIN_GUESS, |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 640 | 'help': 'the toolchain to use (' + TOOLCHAIN_GUESS + ')' |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 641 | }, |
| 642 | 'os': { |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 643 | 'values': ['freebsd', 'linux', 'macos', 'win32', 'android', 'openbsd', 'solaris'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 644 | 'default': OS_GUESS, |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 645 | 'help': 'the os to build for (' + OS_GUESS + ')' |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 646 | }, |
| 647 | 'arch': { |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 648 | 'values':['arm', 'ia32', 'x64', 'mips'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 649 | 'default': ARCH_GUESS, |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 650 | 'help': 'the architecture to build for (' + ARCH_GUESS + ')' |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 651 | }, |
kasperl@chromium.org | 68ac009 | 2009-07-09 06:00:35 +0000 | [diff] [blame] | 652 | 'regexp': { |
| 653 | 'values': ['native', 'interpreted'], |
| 654 | 'default': 'native', |
| 655 | 'help': 'Whether to use native or interpreted regexp implementation' |
| 656 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 657 | 'snapshot': { |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 658 | 'values': ['on', 'off', 'nobuild'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 659 | 'default': 'off', |
| 660 | 'help': 'build using snapshots for faster start-up' |
| 661 | }, |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 662 | 'prof': { |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 663 | 'values': ['on', 'off', 'oprofile'], |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 664 | 'default': 'off', |
| 665 | 'help': 'enable profiling of build target' |
| 666 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 667 | 'library': { |
| 668 | 'values': ['static', 'shared'], |
| 669 | 'default': 'static', |
| 670 | 'help': 'the type of library to produce' |
| 671 | }, |
ager@chromium.org | 4af710e | 2009-09-15 12:20:11 +0000 | [diff] [blame] | 672 | 'profilingsupport': { |
| 673 | 'values': ['on', 'off'], |
| 674 | 'default': 'on', |
| 675 | 'help': 'enable profiling of JavaScript code' |
| 676 | }, |
| 677 | 'debuggersupport': { |
| 678 | 'values': ['on', 'off'], |
| 679 | 'default': 'on', |
| 680 | 'help': 'enable debugging of JavaScript code' |
| 681 | }, |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 682 | 'soname': { |
| 683 | 'values': ['on', 'off'], |
| 684 | 'default': 'off', |
| 685 | 'help': 'turn on setting soname for Linux shared library' |
| 686 | }, |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 687 | 'msvcrt': { |
| 688 | 'values': ['static', 'shared'], |
| 689 | 'default': 'static', |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 690 | 'help': 'the type of Microsoft Visual C++ runtime library to use' |
| 691 | }, |
| 692 | 'msvcltcg': { |
| 693 | 'values': ['on', 'off'], |
| 694 | 'default': 'on', |
| 695 | 'help': 'use Microsoft Visual C++ link-time code generation' |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 696 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 697 | 'simulator': { |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 698 | 'values': ['arm', 'mips', 'none'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 699 | 'default': 'none', |
| 700 | 'help': 'build with simulator' |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 701 | }, |
| 702 | 'disassembler': { |
| 703 | 'values': ['on', 'off'], |
| 704 | 'default': 'off', |
| 705 | 'help': 'enable the disassembler to inspect generated code' |
| 706 | }, |
| 707 | 'sourcesignatures': { |
| 708 | 'values': ['MD5', 'timestamp'], |
| 709 | 'default': 'MD5', |
| 710 | 'help': 'set how the build system detects file changes' |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 711 | }, |
| 712 | 'console': { |
| 713 | 'values': ['dumb', 'readline'], |
| 714 | 'default': 'dumb', |
| 715 | 'help': 'the console to use for the d8 shell' |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 716 | }, |
| 717 | 'verbose': { |
| 718 | 'values': ['on', 'off'], |
| 719 | 'default': 'off', |
| 720 | 'help': 'more output from compiler and linker' |
ager@chromium.org | 4af710e | 2009-09-15 12:20:11 +0000 | [diff] [blame] | 721 | }, |
| 722 | 'visibility': { |
| 723 | 'values': ['default', 'hidden'], |
| 724 | 'default': 'hidden', |
| 725 | 'help': 'shared library symbol visibility' |
kmillikin@chromium.org | 13bd294 | 2009-12-16 15:36:05 +0000 | [diff] [blame] | 726 | }, |
| 727 | 'armvariant': { |
| 728 | 'values': ['arm', 'thumb2', 'none'], |
| 729 | 'default': 'none', |
| 730 | 'help': 'generate thumb2 instructions instead of arm instructions (default)' |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 731 | }, |
| 732 | 'pgo': { |
| 733 | 'values': ['off', 'instrument', 'optimize'], |
| 734 | 'default': 'off', |
| 735 | 'help': 'select profile guided optimization variant', |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 736 | } |
| 737 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 738 | |
| 739 | |
| 740 | def GetOptions(): |
| 741 | result = Options() |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 742 | result.Add('mode', 'compilation mode (debug, release)', 'release') |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 743 | result.Add('sample', 'build sample (shell, process, lineprocessor)', '') |
kasperl@chromium.org | 8ccb0be | 2009-04-07 07:21:39 +0000 | [diff] [blame] | 744 | result.Add('env', 'override environment settings (NAME0:value0,NAME1:value1,...)', '') |
| 745 | result.Add('importenv', 'import environment settings (NAME0,NAME1,...)', '') |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 746 | for (name, option) in SIMPLE_OPTIONS.iteritems(): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 747 | help = '%s (%s)' % (name, ", ".join(option['values'])) |
| 748 | result.Add(name, help, option.get('default')) |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 749 | return result |
| 750 | |
| 751 | |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 752 | def GetVersionComponents(): |
| 753 | MAJOR_VERSION_PATTERN = re.compile(r"#define\s+MAJOR_VERSION\s+(.*)") |
| 754 | MINOR_VERSION_PATTERN = re.compile(r"#define\s+MINOR_VERSION\s+(.*)") |
| 755 | BUILD_NUMBER_PATTERN = re.compile(r"#define\s+BUILD_NUMBER\s+(.*)") |
| 756 | PATCH_LEVEL_PATTERN = re.compile(r"#define\s+PATCH_LEVEL\s+(.*)") |
| 757 | |
| 758 | patterns = [MAJOR_VERSION_PATTERN, |
| 759 | MINOR_VERSION_PATTERN, |
| 760 | BUILD_NUMBER_PATTERN, |
| 761 | PATCH_LEVEL_PATTERN] |
| 762 | |
| 763 | source = open(join(root_dir, 'src', 'version.cc')).read() |
| 764 | version_components = [] |
| 765 | for pattern in patterns: |
| 766 | match = pattern.search(source) |
| 767 | if match: |
| 768 | version_components.append(match.group(1).strip()) |
| 769 | else: |
| 770 | version_components.append('0') |
| 771 | |
| 772 | return version_components |
| 773 | |
| 774 | |
| 775 | def GetVersion(): |
| 776 | version_components = GetVersionComponents() |
ager@chromium.org | 5aa501c | 2009-06-23 07:57:28 +0000 | [diff] [blame] | 777 | |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 778 | if version_components[len(version_components) - 1] == '0': |
| 779 | version_components.pop() |
| 780 | return '.'.join(version_components) |
| 781 | |
| 782 | |
| 783 | def GetSpecificSONAME(): |
| 784 | SONAME_PATTERN = re.compile(r"#define\s+SONAME\s+\"(.*)\"") |
ager@chromium.org | 5aa501c | 2009-06-23 07:57:28 +0000 | [diff] [blame] | 785 | |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 786 | source = open(join(root_dir, 'src', 'version.cc')).read() |
| 787 | match = SONAME_PATTERN.search(source) |
ager@chromium.org | 5aa501c | 2009-06-23 07:57:28 +0000 | [diff] [blame] | 788 | |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 789 | if match: |
| 790 | return match.group(1).strip() |
| 791 | else: |
| 792 | return '' |
| 793 | |
| 794 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 795 | def SplitList(str): |
| 796 | return [ s for s in str.split(",") if len(s) > 0 ] |
| 797 | |
| 798 | |
| 799 | def IsLegal(env, option, values): |
| 800 | str = env[option] |
| 801 | for s in SplitList(str): |
| 802 | if not s in values: |
| 803 | Abort("Illegal value for option %s '%s'." % (option, s)) |
| 804 | return False |
| 805 | return True |
| 806 | |
| 807 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 808 | def VerifyOptions(env): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 809 | if not IsLegal(env, 'mode', ['debug', 'release']): |
| 810 | return False |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 811 | if not IsLegal(env, 'sample', ["shell", "process", "lineprocessor"]): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 812 | return False |
kasperl@chromium.org | 68ac009 | 2009-07-09 06:00:35 +0000 | [diff] [blame] | 813 | if not IsLegal(env, 'regexp', ["native", "interpreted"]): |
| 814 | return False |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 815 | if env['os'] == 'win32' and env['library'] == 'shared' and env['prof'] == 'on': |
| 816 | Abort("Profiling on windows only supported for static library.") |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 817 | if env['prof'] == 'oprofile' and env['os'] != 'linux': |
| 818 | Abort("OProfile is only supported on Linux.") |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 819 | if env['os'] == 'win32' and env['soname'] == 'on': |
| 820 | Abort("Shared Object soname not applicable for Windows.") |
| 821 | if env['soname'] == 'on' and env['library'] == 'static': |
| 822 | Abort("Shared Object soname not applicable for static library.") |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 823 | if env['os'] != 'win32' and env['pgo'] != 'off': |
| 824 | Abort("Profile guided optimization only supported on Windows.") |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 825 | for (name, option) in SIMPLE_OPTIONS.iteritems(): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 826 | if (not option.get('default')) and (name not in ARGUMENTS): |
| 827 | message = ("A value for option %s must be specified (%s)." % |
| 828 | (name, ", ".join(option['values']))) |
| 829 | Abort(message) |
| 830 | if not env[name] in option['values']: |
| 831 | message = ("Unknown %s value '%s'. Possible values are (%s)." % |
| 832 | (name, env[name], ", ".join(option['values']))) |
| 833 | Abort(message) |
| 834 | |
| 835 | |
| 836 | class BuildContext(object): |
| 837 | |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 838 | def __init__(self, options, env_overrides, samples): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 839 | self.library_targets = [] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 840 | self.mksnapshot_targets = [] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 841 | self.cctest_targets = [] |
| 842 | self.sample_targets = [] |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 843 | self.d8_targets = [] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 844 | self.options = options |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 845 | self.env_overrides = env_overrides |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 846 | self.samples = samples |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 847 | self.use_snapshot = (options['snapshot'] != 'off') |
| 848 | self.build_snapshot = (options['snapshot'] == 'on') |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 849 | self.flags = None |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 850 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 851 | def AddRelevantFlags(self, initial, flags): |
| 852 | result = initial.copy() |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 853 | toolchain = self.options['toolchain'] |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 854 | if toolchain in flags: |
| 855 | self.AppendFlags(result, flags[toolchain].get('all')) |
| 856 | for option in sorted(self.options.keys()): |
| 857 | value = self.options[option] |
| 858 | self.AppendFlags(result, flags[toolchain].get(option + ':' + value)) |
ager@chromium.org | 3a37e9b | 2009-04-27 09:26:21 +0000 | [diff] [blame] | 859 | self.AppendFlags(result, flags.get('all')) |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 860 | return result |
| 861 | |
| 862 | def AddRelevantSubFlags(self, options, flags): |
| 863 | self.AppendFlags(options, flags.get('all')) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 864 | for option in sorted(self.options.keys()): |
| 865 | value = self.options[option] |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 866 | self.AppendFlags(options, flags.get(option + ':' + value)) |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 867 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 868 | def GetRelevantSources(self, source): |
| 869 | result = [] |
| 870 | result += source.get('all', []) |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 871 | for (name, value) in self.options.iteritems(): |
sgjesse@chromium.org | 911335c | 2009-08-19 12:59:44 +0000 | [diff] [blame] | 872 | source_value = source.get(name + ':' + value, []) |
| 873 | if type(source_value) == dict: |
| 874 | result += self.GetRelevantSources(source_value) |
| 875 | else: |
| 876 | result += source_value |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 877 | return sorted(result) |
| 878 | |
| 879 | def AppendFlags(self, options, added): |
| 880 | if not added: |
| 881 | return |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 882 | for (key, value) in added.iteritems(): |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 883 | if key.find(':') != -1: |
| 884 | self.AddRelevantSubFlags(options, { key: value }) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 885 | else: |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 886 | if not key in options: |
| 887 | options[key] = value |
| 888 | else: |
| 889 | prefix = options[key] |
| 890 | if isinstance(prefix, StringTypes): prefix = prefix.split() |
| 891 | options[key] = prefix + value |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 892 | |
| 893 | def ConfigureObject(self, env, input, **kw): |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 894 | if (kw.has_key('CPPPATH') and env.has_key('CPPPATH')): |
| 895 | kw['CPPPATH'] += env['CPPPATH'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 896 | if self.options['library'] == 'static': |
| 897 | return env.StaticObject(input, **kw) |
| 898 | else: |
| 899 | return env.SharedObject(input, **kw) |
| 900 | |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 901 | def ApplyEnvOverrides(self, env): |
| 902 | if not self.env_overrides: |
| 903 | return |
| 904 | if type(env['ENV']) == DictType: |
| 905 | env['ENV'].update(**self.env_overrides) |
| 906 | else: |
| 907 | env['ENV'] = self.env_overrides |
| 908 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 909 | |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 910 | def PostprocessOptions(options, os): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 911 | # Adjust architecture if the simulator option has been set |
| 912 | if (options['simulator'] != 'none') and (options['arch'] != options['simulator']): |
| 913 | if 'arch' in ARGUMENTS: |
| 914 | # Print a warning if arch has explicitly been set |
| 915 | print "Warning: forcing architecture to match simulator (%s)" % options['simulator'] |
| 916 | options['arch'] = options['simulator'] |
ager@chromium.org | 4af710e | 2009-09-15 12:20:11 +0000 | [diff] [blame] | 917 | if (options['prof'] != 'off') and (options['profilingsupport'] == 'off'): |
| 918 | # Print a warning if profiling is enabled without profiling support |
| 919 | print "Warning: forcing profilingsupport on when prof is on" |
| 920 | options['profilingsupport'] = 'on' |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 921 | if os == 'win32' and options['pgo'] != 'off' and options['msvcltcg'] == 'off': |
| 922 | if 'msvcltcg' in ARGUMENTS: |
| 923 | print "Warning: forcing msvcltcg on as it is required for pgo (%s)" % options['pgo'] |
| 924 | options['msvcltcg'] = 'on' |
kmillikin@chromium.org | 13bd294 | 2009-12-16 15:36:05 +0000 | [diff] [blame] | 925 | if (options['armvariant'] == 'none' and options['arch'] == 'arm'): |
| 926 | options['armvariant'] = 'arm' |
| 927 | if (options['armvariant'] != 'none' and options['arch'] != 'arm'): |
| 928 | options['armvariant'] = 'none' |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 929 | if options['arch'] == 'mips': |
| 930 | if ('regexp' in ARGUMENTS) and options['regexp'] == 'native': |
| 931 | # Print a warning if native regexp is specified for mips |
| 932 | print "Warning: forcing regexp to interpreted for mips" |
| 933 | options['regexp'] = 'interpreted' |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 934 | |
| 935 | |
kasperl@chromium.org | 8ccb0be | 2009-04-07 07:21:39 +0000 | [diff] [blame] | 936 | def ParseEnvOverrides(arg, imports): |
| 937 | # The environment overrides are in the format NAME0:value0,NAME1:value1,... |
| 938 | # The environment imports are in the format NAME0,NAME1,... |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 939 | overrides = {} |
kasperl@chromium.org | 8ccb0be | 2009-04-07 07:21:39 +0000 | [diff] [blame] | 940 | for var in imports.split(','): |
| 941 | if var in os.environ: |
| 942 | overrides[var] = os.environ[var] |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 943 | for override in arg.split(','): |
| 944 | pos = override.find(':') |
| 945 | if pos == -1: |
| 946 | continue |
| 947 | overrides[override[:pos].strip()] = override[pos+1:].strip() |
| 948 | return overrides |
| 949 | |
| 950 | |
| 951 | def BuildSpecific(env, mode, env_overrides): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 952 | options = {'mode': mode} |
| 953 | for option in SIMPLE_OPTIONS: |
| 954 | options[option] = env[option] |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 955 | PostprocessOptions(options, env['os']) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 956 | |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 957 | context = BuildContext(options, env_overrides, samples=SplitList(env['sample'])) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 958 | |
ager@chromium.org | ab99eea | 2009-08-25 07:05:41 +0000 | [diff] [blame] | 959 | # Remove variables which can't be imported from the user's external |
| 960 | # environment into a construction environment. |
| 961 | user_environ = os.environ.copy() |
| 962 | try: |
| 963 | del user_environ['ENV'] |
| 964 | except KeyError: |
| 965 | pass |
| 966 | |
| 967 | library_flags = context.AddRelevantFlags(user_environ, LIBRARY_FLAGS) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 968 | v8_flags = context.AddRelevantFlags(library_flags, V8_EXTRA_FLAGS) |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 969 | mksnapshot_flags = context.AddRelevantFlags(library_flags, MKSNAPSHOT_EXTRA_FLAGS) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 970 | dtoa_flags = context.AddRelevantFlags(library_flags, DTOA_EXTRA_FLAGS) |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 971 | cctest_flags = context.AddRelevantFlags(v8_flags, CCTEST_EXTRA_FLAGS) |
ager@chromium.org | ab99eea | 2009-08-25 07:05:41 +0000 | [diff] [blame] | 972 | sample_flags = context.AddRelevantFlags(user_environ, SAMPLE_FLAGS) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 973 | d8_flags = context.AddRelevantFlags(library_flags, D8_FLAGS) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 974 | |
| 975 | context.flags = { |
| 976 | 'v8': v8_flags, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 977 | 'mksnapshot': mksnapshot_flags, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 978 | 'dtoa': dtoa_flags, |
| 979 | 'cctest': cctest_flags, |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 980 | 'sample': sample_flags, |
| 981 | 'd8': d8_flags |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 982 | } |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 983 | |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 984 | # Generate library base name. |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 985 | target_id = mode |
| 986 | suffix = SUFFIXES[target_id] |
| 987 | library_name = 'v8' + suffix |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 988 | version = GetVersion() |
| 989 | if context.options['soname'] == 'on': |
| 990 | # When building shared object with SONAME version the library name. |
| 991 | library_name += '-' + version |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 992 | |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 993 | # Generate library SONAME if required by the build. |
| 994 | if context.options['soname'] == 'on': |
| 995 | soname = GetSpecificSONAME() |
| 996 | if soname == '': |
| 997 | soname = 'lib' + library_name + '.so' |
| 998 | env['SONAME'] = soname |
| 999 | |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 1000 | # Build the object files by invoking SCons recursively. |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 1001 | (object_files, shell_files, mksnapshot) = env.SConscript( |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1002 | join('src', 'SConscript'), |
| 1003 | build_dir=join('obj', target_id), |
| 1004 | exports='context', |
| 1005 | duplicate=False |
| 1006 | ) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1007 | |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 1008 | context.mksnapshot_targets.append(mksnapshot) |
| 1009 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1010 | # Link the object files into a library. |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 1011 | env.Replace(**context.flags['v8']) |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 1012 | |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 1013 | context.ApplyEnvOverrides(env) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1014 | if context.options['library'] == 'static': |
| 1015 | library = env.StaticLibrary(library_name, object_files) |
| 1016 | else: |
| 1017 | # There seems to be a glitch in the way scons decides where to put |
| 1018 | # PDB files when compiling using MSVC so we specify it manually. |
| 1019 | # This should not affect any other platforms. |
| 1020 | pdb_name = library_name + '.dll.pdb' |
| 1021 | library = env.SharedLibrary(library_name, object_files, PDB=pdb_name) |
| 1022 | context.library_targets.append(library) |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 1023 | |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1024 | d8_env = Environment() |
| 1025 | d8_env.Replace(**context.flags['d8']) |
fschneider@chromium.org | 0c20e67 | 2010-01-14 15:28:53 +0000 | [diff] [blame] | 1026 | context.ApplyEnvOverrides(d8_env) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1027 | shell = d8_env.Program('d8' + suffix, object_files + shell_files) |
| 1028 | context.d8_targets.append(shell) |
| 1029 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1030 | for sample in context.samples: |
sgjesse@chromium.org | df7a284 | 2010-03-25 14:34:15 +0000 | [diff] [blame] | 1031 | sample_env = Environment() |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1032 | sample_env.Replace(**context.flags['sample']) |
sgjesse@chromium.org | df7a284 | 2010-03-25 14:34:15 +0000 | [diff] [blame] | 1033 | sample_env.Prepend(LIBS=[library_name]) |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 1034 | context.ApplyEnvOverrides(sample_env) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1035 | sample_object = sample_env.SConscript( |
| 1036 | join('samples', 'SConscript'), |
| 1037 | build_dir=join('obj', 'sample', sample, target_id), |
| 1038 | exports='sample context', |
| 1039 | duplicate=False |
| 1040 | ) |
| 1041 | sample_name = sample + suffix |
| 1042 | sample_program = sample_env.Program(sample_name, sample_object) |
| 1043 | sample_env.Depends(sample_program, library) |
| 1044 | context.sample_targets.append(sample_program) |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 1045 | |
ager@chromium.org | b26c50a | 2010-03-26 09:27:16 +0000 | [diff] [blame^] | 1046 | cctest_env = env.Copy() |
| 1047 | cctest_env.Prepend(LIBS=[library_name]) |
| 1048 | cctest_program = cctest_env.SConscript( |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1049 | join('test', 'cctest', 'SConscript'), |
| 1050 | build_dir=join('obj', 'test', target_id), |
| 1051 | exports='context object_files', |
| 1052 | duplicate=False |
| 1053 | ) |
| 1054 | context.cctest_targets.append(cctest_program) |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 1055 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1056 | return context |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1057 | |
| 1058 | |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 1059 | def Build(): |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1060 | opts = GetOptions() |
| 1061 | env = Environment(options=opts) |
| 1062 | Help(opts.GenerateHelpText(env)) |
| 1063 | VerifyOptions(env) |
kasperl@chromium.org | 8ccb0be | 2009-04-07 07:21:39 +0000 | [diff] [blame] | 1064 | env_overrides = ParseEnvOverrides(env['env'], env['importenv']) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1065 | |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 1066 | SourceSignatures(env['sourcesignatures']) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1067 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1068 | libraries = [] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 1069 | mksnapshots = [] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1070 | cctests = [] |
| 1071 | samples = [] |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1072 | d8s = [] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1073 | modes = SplitList(env['mode']) |
| 1074 | for mode in modes: |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 1075 | context = BuildSpecific(env.Copy(), mode, env_overrides) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1076 | libraries += context.library_targets |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 1077 | mksnapshots += context.mksnapshot_targets |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1078 | cctests += context.cctest_targets |
| 1079 | samples += context.sample_targets |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1080 | d8s += context.d8_targets |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1081 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1082 | env.Alias('library', libraries) |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 1083 | env.Alias('mksnapshot', mksnapshots) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1084 | env.Alias('cctests', cctests) |
| 1085 | env.Alias('sample', samples) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1086 | env.Alias('d8', d8s) |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 1087 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1088 | if env['sample']: |
| 1089 | env.Default('sample') |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 1090 | else: |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1091 | env.Default('library') |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 1092 | |
| 1093 | |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 1094 | # We disable deprecation warnings because we need to be able to use |
| 1095 | # env.Copy without getting warnings for compatibility with older |
| 1096 | # version of scons. Also, there's a bug in some revisions that |
| 1097 | # doesn't allow this flag to be set, so we swallow any exceptions. |
| 1098 | # Lovely. |
| 1099 | try: |
| 1100 | SetOption('warn', 'no-deprecated') |
| 1101 | except: |
| 1102 | pass |
| 1103 | |
| 1104 | |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 1105 | Build() |