wok-current rev 19587

Up node (0.12.18)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Dec 28 13:05:40 2016 +0100 (2016-12-28)
parents abb91538be8c
children 41409ce5bfcf
files node/receipt node/stuff/SConstruct node/stuff/SConstruct.patch
line diff
     1.1 --- a/node/receipt	Mon Dec 26 14:19:02 2016 +0100
     1.2 +++ b/node/receipt	Wed Dec 28 13:05:40 2016 +0100
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="node"
     1.7 -VERSION="0.10.41"
     1.8 +VERSION="0.12.18"
     1.9  CATEGORY="network"
    1.10  SHORT_DESC="Node.js is a platform for easily building network applications."
    1.11  MAINTAINER="pankso@slitaz.org"
    1.12 @@ -17,7 +17,6 @@
    1.13  # Rules to configure and make the package.
    1.14  compile_rules()
    1.15  {
    1.16 -	#patch -p0 < ${stuff}/SConstruct.patch || return 1
    1.17  	./configure --prefix=/usr &&
    1.18  	make && make install
    1.19  }
     2.1 --- a/node/stuff/SConstruct	Mon Dec 26 14:19:02 2016 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,1636 +0,0 @@
     2.4 -# Copyright 2012 the V8 project authors. All rights reserved.
     2.5 -# Redistribution and use in source and binary forms, with or without
     2.6 -# modification, are permitted provided that the following conditions are
     2.7 -# met:
     2.8 -#
     2.9 -#     * Redistributions of source code must retain the above copyright
    2.10 -#       notice, this list of conditions and the following disclaimer.
    2.11 -#     * Redistributions in binary form must reproduce the above
    2.12 -#       copyright notice, this list of conditions and the following
    2.13 -#       disclaimer in the documentation and/or other materials provided
    2.14 -#       with the distribution.
    2.15 -#     * Neither the name of Google Inc. nor the names of its
    2.16 -#       contributors may be used to endorse or promote products derived
    2.17 -#       from this software without specific prior written permission.
    2.18 -#
    2.19 -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    2.20 -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    2.21 -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    2.22 -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    2.23 -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    2.24 -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    2.25 -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    2.26 -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    2.27 -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    2.28 -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2.29 -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2.30 -
    2.31 -import platform
    2.32 -import re
    2.33 -import subprocess
    2.34 -import sys
    2.35 -import os
    2.36 -from os.path import join, dirname, abspath
    2.37 -from types import DictType, StringTypes
    2.38 -root_dir = dirname(File('SConstruct').rfile().abspath)
    2.39 -src_dir = join(root_dir, 'src')
    2.40 -sys.path.insert(0, join(root_dir, 'tools'))
    2.41 -import js2c, utils
    2.42 -
    2.43 -# ARM_TARGET_LIB is the path to the dynamic library to use on the target
    2.44 -# machine if cross-compiling to an arm machine. You will also need to set
    2.45 -# the additional cross-compiling environment variables to the cross compiler.
    2.46 -ARM_TARGET_LIB = os.environ.get('ARM_TARGET_LIB')
    2.47 -if ARM_TARGET_LIB:
    2.48 -  ARM_LINK_FLAGS = ['-Wl,-rpath=' + ARM_TARGET_LIB + '/lib:' +
    2.49 -                     ARM_TARGET_LIB + '/usr/lib',
    2.50 -                    '-Wl,--dynamic-linker=' + ARM_TARGET_LIB +
    2.51 -                    '/lib/ld-linux.so.3']
    2.52 -else:
    2.53 -  ARM_LINK_FLAGS = []
    2.54 -
    2.55 -GCC_EXTRA_CCFLAGS = []
    2.56 -GCC_DTOA_EXTRA_CCFLAGS = []
    2.57 -
    2.58 -LIBRARY_FLAGS = {
    2.59 -  'all': {
    2.60 -    'CPPPATH': [src_dir],
    2.61 -    'regexp:interpreted': {
    2.62 -      'CPPDEFINES': ['V8_INTERPRETED_REGEXP']
    2.63 -    },
    2.64 -    'mode:debug': {
    2.65 -      'CPPDEFINES': ['V8_ENABLE_CHECKS', 'OBJECT_PRINT', 'VERIFY_HEAP']
    2.66 -    },
    2.67 -    'objectprint:on': {
    2.68 -      'CPPDEFINES':   ['OBJECT_PRINT'],
    2.69 -    },
    2.70 -    'debuggersupport:on': {
    2.71 -      'CPPDEFINES':   ['ENABLE_DEBUGGER_SUPPORT'],
    2.72 -    },
    2.73 -    'inspector:on': {
    2.74 -      'CPPDEFINES':   ['INSPECTOR'],
    2.75 -    },
    2.76 -    'fasttls:off': {
    2.77 -      'CPPDEFINES':   ['V8_NO_FAST_TLS'],
    2.78 -    },
    2.79 -    'liveobjectlist:on': {
    2.80 -      'CPPDEFINES':   ['ENABLE_DEBUGGER_SUPPORT', 'INSPECTOR',
    2.81 -                       'LIVE_OBJECT_LIST', 'OBJECT_PRINT'],
    2.82 -    }
    2.83 -  },
    2.84 -  'gcc': {
    2.85 -    'all': {
    2.86 -      'CCFLAGS':      ['$DIALECTFLAGS', '$WARNINGFLAGS', '-march=armv6'],
    2.87 -      'CXXFLAGS':     ['-fno-rtti', '-fno-exceptions', '-march=armv6'],
    2.88 -    },
    2.89 -    'visibility:hidden': {
    2.90 -      # Use visibility=default to disable this.
    2.91 -      'CXXFLAGS':     ['-fvisibility=hidden']
    2.92 -    },
    2.93 -    'strictaliasing:off': {
    2.94 -      'CCFLAGS':      ['-fno-strict-aliasing']
    2.95 -    },
    2.96 -    'mode:debug': {
    2.97 -      'CCFLAGS':      ['-g', '-O0'],
    2.98 -      'CPPDEFINES':   ['ENABLE_DISASSEMBLER', 'DEBUG'],
    2.99 -    },
   2.100 -    'mode:release': {
   2.101 -      'CCFLAGS':      ['-O3', '-fomit-frame-pointer', '-fdata-sections',
   2.102 -                       '-ffunction-sections'],
   2.103 -    },
   2.104 -    'os:linux': {
   2.105 -      'CCFLAGS':      ['-ansi'] + GCC_EXTRA_CCFLAGS,
   2.106 -      'library:shared': {
   2.107 -        'CPPDEFINES': ['V8_SHARED', 'BUILDING_V8_SHARED'],
   2.108 -        'LIBS': ['pthread']
   2.109 -      }
   2.110 -    },
   2.111 -    'os:macos': {
   2.112 -      'CCFLAGS':      ['-ansi', '-mmacosx-version-min=10.4'],
   2.113 -      'library:shared': {
   2.114 -        'CPPDEFINES': ['V8_SHARED', 'BUILDING_V8_SHARED'],
   2.115 -      }
   2.116 -    },
   2.117 -    'os:freebsd': {
   2.118 -      'CPPPATH' : [src_dir, '/usr/local/include'],
   2.119 -      'LIBPATH' : ['/usr/local/lib'],
   2.120 -      'CCFLAGS':      ['-ansi'],
   2.121 -      'LIBS': ['execinfo']
   2.122 -    },
   2.123 -    'os:openbsd': {
   2.124 -      'CPPPATH' : [src_dir, '/usr/local/include'],
   2.125 -      'LIBPATH' : ['/usr/local/lib'],
   2.126 -      'CCFLAGS':      ['-ansi'],
   2.127 -    },
   2.128 -    'os:solaris': {
   2.129 -      # On Solaris, to get isinf, INFINITY, fpclassify and other macros one
   2.130 -      # needs to define __C99FEATURES__.
   2.131 -      'CPPDEFINES': ['__C99FEATURES__'],
   2.132 -      'CPPPATH' : [src_dir, '/usr/local/include'],
   2.133 -      'LIBPATH' : ['/usr/local/lib'],
   2.134 -      'CCFLAGS':      ['-ansi'],
   2.135 -    },
   2.136 -    'os:netbsd': {
   2.137 -      'CPPPATH' : [src_dir, '/usr/pkg/include'],
   2.138 -      'LIBPATH' : ['/usr/pkg/lib'],
   2.139 -    },
   2.140 -    'os:win32': {
   2.141 -      'CCFLAGS':      ['-DWIN32'],
   2.142 -      'CXXFLAGS':     ['-DWIN32'],
   2.143 -    },
   2.144 -    'arch:ia32': {
   2.145 -      'CPPDEFINES':   ['V8_TARGET_ARCH_IA32'],
   2.146 -      'CCFLAGS':      ['-m32'],
   2.147 -      'LINKFLAGS':    ['-m32']
   2.148 -    },
   2.149 -    'arch:arm': {
   2.150 -      'CPPDEFINES':   ['V8_TARGET_ARCH_ARM'],
   2.151 -      'unalignedaccesses:on' : {
   2.152 -        'CPPDEFINES' : ['CAN_USE_UNALIGNED_ACCESSES=1']
   2.153 -      },
   2.154 -      'unalignedaccesses:off' : {
   2.155 -        'CPPDEFINES' : ['CAN_USE_UNALIGNED_ACCESSES=0']
   2.156 -      },
   2.157 -      'armeabi:soft' : {
   2.158 -        'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
   2.159 -        'simulator:none': {
   2.160 -          'CCFLAGS':     ['-mfloat-abi=soft'],
   2.161 -        }
   2.162 -      },
   2.163 -      'armeabi:softfp' : {
   2.164 -        'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
   2.165 -        'vfp3:on': {
   2.166 -          'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']
   2.167 -        },
   2.168 -        'simulator:none': {
   2.169 -          'CCFLAGS':     ['-mfloat-abi=softfp'],
   2.170 -        }
   2.171 -      },
   2.172 -      'armeabi:hard' : {
   2.173 -        'CPPDEFINES' : ['USE_EABI_HARDFLOAT=1'],
   2.174 -        'vfp3:on': {
   2.175 -          'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']
   2.176 -        },
   2.177 -        'simulator:none': {
   2.178 -          'CCFLAGS':     ['-mfloat-abi=hard'],
   2.179 -        }
   2.180 -      }
   2.181 -    },
   2.182 -    'simulator:arm': {
   2.183 -      'CCFLAGS':      ['-m32'],
   2.184 -      'LINKFLAGS':    ['-m32'],
   2.185 -    },
   2.186 -    'arch:mips': {
   2.187 -      'CPPDEFINES':   ['V8_TARGET_ARCH_MIPS'],
   2.188 -      'mips_arch_variant:mips32r2': {
   2.189 -        'CPPDEFINES':    ['_MIPS_ARCH_MIPS32R2']
   2.190 -      },
   2.191 -      'mips_arch_variant:loongson': {
   2.192 -        'CPPDEFINES':    ['_MIPS_ARCH_LOONGSON']
   2.193 -      },
   2.194 -      'simulator:none': {
   2.195 -        'CCFLAGS':      ['-EL'],
   2.196 -        'LINKFLAGS':    ['-EL'],
   2.197 -        'mips_arch_variant:mips32r2': {
   2.198 -          'CCFLAGS':      ['-mips32r2', '-Wa,-mips32r2']
   2.199 -        },
   2.200 -        'mips_arch_variant:mips32r1': {
   2.201 -          'CCFLAGS':      ['-mips32', '-Wa,-mips32']
   2.202 -        },
   2.203 -        'mips_arch_variant:loongson': {
   2.204 -          'CCFLAGS':      ['-march=mips3', '-Wa,-march=mips3']
   2.205 -        },
   2.206 -        'library:static': {
   2.207 -          'LINKFLAGS':    ['-static', '-static-libgcc']
   2.208 -        },
   2.209 -        'mipsabi:softfloat': {
   2.210 -          'CCFLAGS':      ['-msoft-float'],
   2.211 -          'LINKFLAGS':    ['-msoft-float']
   2.212 -        },
   2.213 -        'mipsabi:hardfloat': {
   2.214 -          'CCFLAGS':      ['-mhard-float'],
   2.215 -          'LINKFLAGS':    ['-mhard-float']
   2.216 -        }
   2.217 -      }
   2.218 -    },
   2.219 -    'simulator:mips': {
   2.220 -      'CCFLAGS':      ['-m32'],
   2.221 -      'LINKFLAGS':    ['-m32'],
   2.222 -      'mipsabi:softfloat': {
   2.223 -        'CPPDEFINES':    ['__mips_soft_float=1'],
   2.224 -        'fpu:on': {
   2.225 -          'CPPDEFINES' : ['CAN_USE_FPU_INSTRUCTIONS']
   2.226 -        }
   2.227 -      },
   2.228 -      'mipsabi:hardfloat': {
   2.229 -        'CPPDEFINES':    ['__mips_hard_float=1', 'CAN_USE_FPU_INSTRUCTIONS'],
   2.230 -      }
   2.231 -    },
   2.232 -    'arch:x64': {
   2.233 -      'CPPDEFINES':   ['V8_TARGET_ARCH_X64'],
   2.234 -      'CCFLAGS':      ['-m64'],
   2.235 -      'LINKFLAGS':    ['-m64'],
   2.236 -    },
   2.237 -    'gdbjit:on': {
   2.238 -      'CPPDEFINES':   ['ENABLE_GDB_JIT_INTERFACE']
   2.239 -    },
   2.240 -    'compress_startup_data:bz2': {
   2.241 -      'CPPDEFINES':   ['COMPRESS_STARTUP_DATA_BZ2']
   2.242 -    }
   2.243 -  },
   2.244 -  'msvc': {
   2.245 -    'all': {
   2.246 -      'CCFLAGS':      ['$DIALECTFLAGS', '$WARNINGFLAGS'],
   2.247 -      'CXXFLAGS':     ['/GR-', '/Gy'],
   2.248 -      'CPPDEFINES':   ['WIN32'],
   2.249 -      'LINKFLAGS':    ['/INCREMENTAL:NO', '/NXCOMPAT', '/IGNORE:4221'],
   2.250 -      'CCPDBFLAGS':   ['/Zi']
   2.251 -    },
   2.252 -    'verbose:off': {
   2.253 -      'DIALECTFLAGS': ['/nologo'],
   2.254 -      'ARFLAGS':      ['/NOLOGO']
   2.255 -    },
   2.256 -    'arch:ia32': {
   2.257 -      'CPPDEFINES':   ['V8_TARGET_ARCH_IA32', '_USE_32BIT_TIME_T'],
   2.258 -      'LINKFLAGS':    ['/MACHINE:X86'],
   2.259 -      'ARFLAGS':      ['/MACHINE:X86']
   2.260 -    },
   2.261 -    'arch:x64': {
   2.262 -      'CPPDEFINES':   ['V8_TARGET_ARCH_X64'],
   2.263 -      'LINKFLAGS':    ['/MACHINE:X64'],
   2.264 -      'ARFLAGS':      ['/MACHINE:X64']
   2.265 -    },
   2.266 -    'mode:debug': {
   2.267 -      'CCFLAGS':      ['/Od', '/Gm'],
   2.268 -      'CPPDEFINES':   ['_DEBUG', 'ENABLE_DISASSEMBLER', 'DEBUG'],
   2.269 -      'LINKFLAGS':    ['/DEBUG'],
   2.270 -      'msvcrt:static': {
   2.271 -        'CCFLAGS': ['/MTd']
   2.272 -      },
   2.273 -      'msvcrt:shared': {
   2.274 -        'CCFLAGS': ['/MDd']
   2.275 -      }
   2.276 -    },
   2.277 -    'mode:release': {
   2.278 -      'CCFLAGS':      ['/O2'],
   2.279 -      'LINKFLAGS':    ['/OPT:REF', '/OPT:ICF'],
   2.280 -      'msvcrt:static': {
   2.281 -        'CCFLAGS': ['/MT']
   2.282 -      },
   2.283 -      'msvcrt:shared': {
   2.284 -        'CCFLAGS': ['/MD']
   2.285 -      },
   2.286 -      'msvcltcg:on': {
   2.287 -        'CCFLAGS':      ['/GL'],
   2.288 -        'ARFLAGS':      ['/LTCG'],
   2.289 -        'pgo:off': {
   2.290 -          'LINKFLAGS':    ['/LTCG'],
   2.291 -        },
   2.292 -        'pgo:instrument': {
   2.293 -          'LINKFLAGS':    ['/LTCG:PGI']
   2.294 -        },
   2.295 -        'pgo:optimize': {
   2.296 -          'LINKFLAGS':    ['/LTCG:PGO']
   2.297 -        }
   2.298 -      }
   2.299 -    }
   2.300 -  }
   2.301 -}
   2.302 -
   2.303 -
   2.304 -V8_EXTRA_FLAGS = {
   2.305 -  'gcc': {
   2.306 -    'all': {
   2.307 -      'WARNINGFLAGS': ['-Wall',
   2.308 -                       '-Werror',
   2.309 -                       '-W',
   2.310 -                       '-Wno-unused-parameter',
   2.311 -                       '-Woverloaded-virtual',
   2.312 -                       '-Wnon-virtual-dtor']
   2.313 -    },
   2.314 -    'os:win32': {
   2.315 -      'WARNINGFLAGS': ['-pedantic',
   2.316 -                       '-Wno-long-long',
   2.317 -                       '-Wno-pedantic-ms-format'],
   2.318 -      'library:shared': {
   2.319 -        'LIBS': ['winmm', 'ws2_32']
   2.320 -      }
   2.321 -    },
   2.322 -    'os:linux': {
   2.323 -      'WARNINGFLAGS': ['-pedantic'],
   2.324 -      'library:shared': {
   2.325 -        'soname:on': {
   2.326 -          'LINKFLAGS': ['-Wl,-soname,${SONAME}']
   2.327 -        }
   2.328 -      }
   2.329 -    },
   2.330 -    'os:macos': {
   2.331 -      'WARNINGFLAGS': ['-pedantic']
   2.332 -    },
   2.333 -    'arch:arm': {
   2.334 -      # This is to silence warnings about ABI changes that some versions of the
   2.335 -      # CodeSourcery G++ tool chain produce for each occurrence of varargs.
   2.336 -      'WARNINGFLAGS': ['-Wno-abi']
   2.337 -    },
   2.338 -    'disassembler:on': {
   2.339 -      'CPPDEFINES':   ['ENABLE_DISASSEMBLER']
   2.340 -    }
   2.341 -  },
   2.342 -  'msvc': {
   2.343 -    'all': {
   2.344 -      'WARNINGFLAGS': ['/W3', '/WX', '/wd4351', '/wd4355', '/wd4800']
   2.345 -    },
   2.346 -    'library:shared': {
   2.347 -      'CPPDEFINES': ['BUILDING_V8_SHARED'],
   2.348 -      'LIBS': ['winmm', 'ws2_32']
   2.349 -    },
   2.350 -    'arch:arm': {
   2.351 -      'CPPDEFINES':   ['V8_TARGET_ARCH_ARM'],
   2.352 -      # /wd4996 is to silence the warning about sscanf
   2.353 -      # used by the arm simulator.
   2.354 -      'WARNINGFLAGS': ['/wd4996']
   2.355 -    },
   2.356 -    'arch:mips': {
   2.357 -      'CPPDEFINES':   ['V8_TARGET_ARCH_MIPS'],
   2.358 -      'mips_arch_variant:mips32r2': {
   2.359 -        'CPPDEFINES':    ['_MIPS_ARCH_MIPS32R2']
   2.360 -      },
   2.361 -    },
   2.362 -    'disassembler:on': {
   2.363 -      'CPPDEFINES':   ['ENABLE_DISASSEMBLER']
   2.364 -    }
   2.365 -  }
   2.366 -}
   2.367 -
   2.368 -
   2.369 -MKSNAPSHOT_EXTRA_FLAGS = {
   2.370 -  'gcc': {
   2.371 -    'os:linux': {
   2.372 -      'LIBS': ['pthread'],
   2.373 -    },
   2.374 -    'os:macos': {
   2.375 -      'LIBS': ['pthread'],
   2.376 -    },
   2.377 -    'os:freebsd': {
   2.378 -      'LIBS': ['execinfo', 'pthread']
   2.379 -    },
   2.380 -    'os:solaris': {
   2.381 -      'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'],
   2.382 -      'LINKFLAGS': ['-mt']
   2.383 -    },
   2.384 -    'os:openbsd': {
   2.385 -      'LIBS': ['execinfo', 'pthread']
   2.386 -    },
   2.387 -    'os:win32': {
   2.388 -      'LIBS': ['winmm', 'ws2_32'],
   2.389 -    },
   2.390 -    'os:netbsd': {
   2.391 -      'LIBS': ['execinfo', 'pthread']
   2.392 -    },
   2.393 -    'compress_startup_data:bz2': {
   2.394 -      'os:linux': {
   2.395 -        'LIBS': ['bz2']
   2.396 -      }
   2.397 -    },
   2.398 -  },
   2.399 -  'msvc': {
   2.400 -    'all': {
   2.401 -      'CPPDEFINES': ['_HAS_EXCEPTIONS=0'],
   2.402 -      'LIBS': ['winmm', 'ws2_32']
   2.403 -    }
   2.404 -  }
   2.405 -}
   2.406 -
   2.407 -
   2.408 -DTOA_EXTRA_FLAGS = {
   2.409 -  'gcc': {
   2.410 -    'all': {
   2.411 -      'WARNINGFLAGS': ['-Werror', '-Wno-uninitialized'],
   2.412 -      'CCFLAGS': GCC_DTOA_EXTRA_CCFLAGS
   2.413 -    }
   2.414 -  },
   2.415 -  'msvc': {
   2.416 -    'all': {
   2.417 -      'WARNINGFLAGS': ['/WX', '/wd4018', '/wd4244']
   2.418 -    }
   2.419 -  }
   2.420 -}
   2.421 -
   2.422 -
   2.423 -CCTEST_EXTRA_FLAGS = {
   2.424 -  'all': {
   2.425 -    'CPPPATH': [src_dir],
   2.426 -    'library:shared': {
   2.427 -      'CPPDEFINES': ['USING_V8_SHARED']
   2.428 -    },
   2.429 -  },
   2.430 -  'gcc': {
   2.431 -    'all': {
   2.432 -      'LIBPATH':      [abspath('.')],
   2.433 -      'CCFLAGS':      ['$DIALECTFLAGS', '$WARNINGFLAGS'],
   2.434 -      'CXXFLAGS':     ['-fno-rtti', '-fno-exceptions'],
   2.435 -      'LINKFLAGS':    ['$CCFLAGS'],
   2.436 -    },
   2.437 -    'os:linux': {
   2.438 -      'LIBS':         ['pthread'],
   2.439 -      'CCFLAGS':      ['-Wno-unused-but-set-variable'],
   2.440 -    },
   2.441 -    'os:macos': {
   2.442 -      'LIBS':         ['pthread'],
   2.443 -    },
   2.444 -    'os:freebsd': {
   2.445 -      'LIBS':         ['execinfo', 'pthread']
   2.446 -    },
   2.447 -    'os:solaris': {
   2.448 -      'LIBS':         ['m', 'pthread', 'socket', 'nsl', 'rt'],
   2.449 -      'LINKFLAGS':    ['-mt']
   2.450 -    },
   2.451 -    'os:openbsd': {
   2.452 -      'LIBS':         ['execinfo', 'pthread']
   2.453 -    },
   2.454 -    'os:win32': {
   2.455 -      'LIBS': ['winmm', 'ws2_32']
   2.456 -    },
   2.457 -    'os:netbsd': {
   2.458 -      'LIBS':         ['execinfo', 'pthread']
   2.459 -    },
   2.460 -    'arch:arm': {
   2.461 -      'LINKFLAGS':   ARM_LINK_FLAGS
   2.462 -    },
   2.463 -  },
   2.464 -  'msvc': {
   2.465 -    'all': {
   2.466 -      'CPPDEFINES': ['_HAS_EXCEPTIONS=0'],
   2.467 -      'LIBS': ['winmm', 'ws2_32']
   2.468 -    },
   2.469 -    'arch:ia32': {
   2.470 -      'CPPDEFINES': ['V8_TARGET_ARCH_IA32']
   2.471 -    },
   2.472 -    'arch:x64': {
   2.473 -      'CPPDEFINES':   ['V8_TARGET_ARCH_X64'],
   2.474 -      'LINKFLAGS': ['/STACK:2097152']
   2.475 -    },
   2.476 -  }
   2.477 -}
   2.478 -
   2.479 -
   2.480 -SAMPLE_FLAGS = {
   2.481 -  'all': {
   2.482 -    'CPPPATH': [join(root_dir, 'include')],
   2.483 -    'library:shared': {
   2.484 -      'CPPDEFINES': ['USING_V8_SHARED']
   2.485 -    },
   2.486 -  },
   2.487 -  'gcc': {
   2.488 -    'all': {
   2.489 -      'LIBPATH':      ['.'],
   2.490 -      'CCFLAGS':      ['$DIALECTFLAGS', '$WARNINGFLAGS'],
   2.491 -      'CXXFLAGS':     ['-fno-rtti', '-fno-exceptions'],
   2.492 -      'LINKFLAGS':    ['$CCFLAGS'],
   2.493 -    },
   2.494 -    'os:linux': {
   2.495 -      'LIBS':         ['pthread'],
   2.496 -    },
   2.497 -    'os:macos': {
   2.498 -      'LIBS':         ['pthread'],
   2.499 -    },
   2.500 -    'os:freebsd': {
   2.501 -      'LIBPATH' :     ['/usr/local/lib'],
   2.502 -      'LIBS':         ['execinfo', 'pthread']
   2.503 -    },
   2.504 -    'os:solaris': {
   2.505 -      # On Solaris, to get isinf, INFINITY, fpclassify and other macros one
   2.506 -      # needs to define __C99FEATURES__.
   2.507 -      'CPPDEFINES': ['__C99FEATURES__'],
   2.508 -      'LIBPATH' :     ['/usr/local/lib'],
   2.509 -      'LIBS':         ['m', 'pthread', 'socket', 'nsl', 'rt'],
   2.510 -      'LINKFLAGS':    ['-mt']
   2.511 -    },
   2.512 -    'os:openbsd': {
   2.513 -      'LIBPATH' :     ['/usr/local/lib'],
   2.514 -      'LIBS':         ['execinfo', 'pthread']
   2.515 -    },
   2.516 -    'os:win32': {
   2.517 -      'LIBS':         ['winmm', 'ws2_32']
   2.518 -    },
   2.519 -    'os:netbsd': {
   2.520 -      'LIBPATH' :     ['/usr/pkg/lib'],
   2.521 -      'LIBS':         ['execinfo', 'pthread']
   2.522 -    },
   2.523 -    'arch:arm': {
   2.524 -      'LINKFLAGS':   ARM_LINK_FLAGS,
   2.525 -      'armeabi:soft' : {
   2.526 -        'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
   2.527 -        'simulator:none': {
   2.528 -          'CCFLAGS':     ['-mfloat-abi=soft'],
   2.529 -        }
   2.530 -      },
   2.531 -      'armeabi:softfp' : {
   2.532 -        'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
   2.533 -        'simulator:none': {
   2.534 -          'CCFLAGS':     ['-mfloat-abi=softfp'],
   2.535 -        }
   2.536 -      },
   2.537 -      'armeabi:hard' : {
   2.538 -        'CPPDEFINES' : ['USE_EABI_HARDFLOAT=1'],
   2.539 -        'vfp3:on': {
   2.540 -          'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']
   2.541 -        },
   2.542 -        'simulator:none': {
   2.543 -          'CCFLAGS':     ['-mfloat-abi=hard'],
   2.544 -        }
   2.545 -      }
   2.546 -    },
   2.547 -    'arch:ia32': {
   2.548 -      'CCFLAGS':      ['-m32'],
   2.549 -      'LINKFLAGS':    ['-m32']
   2.550 -    },
   2.551 -    'arch:x64': {
   2.552 -      'CCFLAGS':      ['-m64'],
   2.553 -      'LINKFLAGS':    ['-m64']
   2.554 -    },
   2.555 -    'arch:mips': {
   2.556 -      'CPPDEFINES':   ['V8_TARGET_ARCH_MIPS'],
   2.557 -      'mips_arch_variant:mips32r2': {
   2.558 -        'CPPDEFINES':    ['_MIPS_ARCH_MIPS32R2']
   2.559 -      },
   2.560 -      'mips_arch_variant:loongson': {
   2.561 -        'CPPDEFINES':    ['_MIPS_ARCH_LOONGSON']
   2.562 -      },
   2.563 -      'simulator:none': {
   2.564 -        'CCFLAGS':      ['-EL'],
   2.565 -        'LINKFLAGS':    ['-EL'],
   2.566 -        'mips_arch_variant:mips32r2': {
   2.567 -          'CCFLAGS':      ['-mips32r2', '-Wa,-mips32r2']
   2.568 -        },
   2.569 -        'mips_arch_variant:mips32r1': {
   2.570 -          'CCFLAGS':      ['-mips32', '-Wa,-mips32']
   2.571 -        },
   2.572 -        'mips_arch_variant:loongson': {
   2.573 -          'CCFLAGS':      ['-march=mips3', '-Wa,-march=mips3']
   2.574 -        },
   2.575 -        'library:static': {
   2.576 -          'LINKFLAGS':    ['-static', '-static-libgcc']
   2.577 -        },
   2.578 -        'mipsabi:softfloat': {
   2.579 -          'CCFLAGS':      ['-msoft-float'],
   2.580 -          'LINKFLAGS':    ['-msoft-float']
   2.581 -        },
   2.582 -        'mipsabi:hardfloat': {
   2.583 -          'CCFLAGS':      ['-mhard-float'],
   2.584 -          'LINKFLAGS':    ['-mhard-float'],
   2.585 -          'fpu:on': {
   2.586 -            'CPPDEFINES' : ['CAN_USE_FPU_INSTRUCTIONS']
   2.587 -          }
   2.588 -        }
   2.589 -      }
   2.590 -    },
   2.591 -    'simulator:arm': {
   2.592 -      'CCFLAGS':      ['-m32'],
   2.593 -      'LINKFLAGS':    ['-m32']
   2.594 -    },
   2.595 -    'simulator:mips': {
   2.596 -      'CCFLAGS':      ['-m32'],
   2.597 -      'LINKFLAGS':    ['-m32']
   2.598 -    },
   2.599 -    'mode:release': {
   2.600 -      'CCFLAGS':      ['-O2']
   2.601 -    },
   2.602 -    'mode:debug': {
   2.603 -      'CCFLAGS':      ['-g', '-O0'],
   2.604 -      'CPPDEFINES':   ['DEBUG']
   2.605 -    },
   2.606 -    'compress_startup_data:bz2': {
   2.607 -      'CPPDEFINES':   ['COMPRESS_STARTUP_DATA_BZ2'],
   2.608 -      'os:linux': {
   2.609 -        'LIBS':       ['bz2']
   2.610 -      }
   2.611 -    },
   2.612 -  },
   2.613 -  'msvc': {
   2.614 -    'all': {
   2.615 -      'LIBS': ['winmm', 'ws2_32']
   2.616 -    },
   2.617 -    'verbose:off': {
   2.618 -      'CCFLAGS': ['/nologo'],
   2.619 -      'LINKFLAGS': ['/NOLOGO']
   2.620 -    },
   2.621 -    'verbose:on': {
   2.622 -      'LINKFLAGS': ['/VERBOSE']
   2.623 -    },
   2.624 -    'prof:on': {
   2.625 -      'LINKFLAGS': ['/MAP']
   2.626 -    },
   2.627 -    'mode:release': {
   2.628 -      'CCFLAGS':   ['/O2'],
   2.629 -      'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'],
   2.630 -      'msvcrt:static': {
   2.631 -        'CCFLAGS': ['/MT']
   2.632 -      },
   2.633 -      'msvcrt:shared': {
   2.634 -        'CCFLAGS': ['/MD']
   2.635 -      },
   2.636 -      'msvcltcg:on': {
   2.637 -        'CCFLAGS':      ['/GL'],
   2.638 -        'pgo:off': {
   2.639 -          'LINKFLAGS':    ['/LTCG'],
   2.640 -        },
   2.641 -      },
   2.642 -      'pgo:instrument': {
   2.643 -        'LINKFLAGS':    ['/LTCG:PGI']
   2.644 -      },
   2.645 -      'pgo:optimize': {
   2.646 -        'LINKFLAGS':    ['/LTCG:PGO']
   2.647 -      }
   2.648 -    },
   2.649 -    'arch:ia32': {
   2.650 -      'CPPDEFINES': ['V8_TARGET_ARCH_IA32', 'WIN32'],
   2.651 -      'LINKFLAGS': ['/MACHINE:X86']
   2.652 -    },
   2.653 -    'arch:x64': {
   2.654 -      'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'],
   2.655 -      'LINKFLAGS': ['/MACHINE:X64', '/STACK:2097152']
   2.656 -    },
   2.657 -    'mode:debug': {
   2.658 -      'CCFLAGS':    ['/Od'],
   2.659 -      'LINKFLAGS':  ['/DEBUG'],
   2.660 -      'CPPDEFINES': ['DEBUG'],
   2.661 -      'msvcrt:static': {
   2.662 -        'CCFLAGS':  ['/MTd']
   2.663 -      },
   2.664 -      'msvcrt:shared': {
   2.665 -        'CCFLAGS':  ['/MDd']
   2.666 -      }
   2.667 -    }
   2.668 -  }
   2.669 -}
   2.670 -
   2.671 -
   2.672 -PREPARSER_FLAGS = {
   2.673 -  'all': {
   2.674 -    'CPPPATH': [join(root_dir, 'include'), src_dir],
   2.675 -    'library:shared': {
   2.676 -      'CPPDEFINES': ['USING_V8_SHARED']
   2.677 -    },
   2.678 -  },
   2.679 -  'gcc': {
   2.680 -    'all': {
   2.681 -      'LIBPATH':      ['.'],
   2.682 -      'CCFLAGS':      ['$DIALECTFLAGS', '$WARNINGFLAGS'],
   2.683 -      'CXXFLAGS':     ['-fno-rtti', '-fno-exceptions'],
   2.684 -      'LINKFLAGS':    ['$CCFLAGS'],
   2.685 -    },
   2.686 -    'os:win32': {
   2.687 -      'LIBS':         ['winmm', 'ws2_32']
   2.688 -    },
   2.689 -    'arch:arm': {
   2.690 -      'LINKFLAGS':   ARM_LINK_FLAGS,
   2.691 -      'armeabi:soft' : {
   2.692 -        'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
   2.693 -        'simulator:none': {
   2.694 -          'CCFLAGS':     ['-mfloat-abi=soft'],
   2.695 -        }
   2.696 -      },
   2.697 -      'armeabi:softfp' : {
   2.698 -        'simulator:none': {
   2.699 -          'CCFLAGS':     ['-mfloat-abi=softfp'],
   2.700 -        }
   2.701 -      },
   2.702 -      'armeabi:hard' : {
   2.703 -        'simulator:none': {
   2.704 -          'CCFLAGS':     ['-mfloat-abi=hard'],
   2.705 -        }
   2.706 -      }
   2.707 -    },
   2.708 -    'arch:ia32': {
   2.709 -      'CCFLAGS':      ['-m32'],
   2.710 -      'LINKFLAGS':    ['-m32']
   2.711 -    },
   2.712 -    'arch:x64': {
   2.713 -      'CCFLAGS':      ['-m64'],
   2.714 -      'LINKFLAGS':    ['-m64']
   2.715 -    },
   2.716 -    'arch:mips': {
   2.717 -      'CPPDEFINES':   ['V8_TARGET_ARCH_MIPS'],
   2.718 -      'mips_arch_variant:mips32r2': {
   2.719 -        'CPPDEFINES':    ['_MIPS_ARCH_MIPS32R2']
   2.720 -      },
   2.721 -      'mips_arch_variant:loongson': {
   2.722 -        'CPPDEFINES':    ['_MIPS_ARCH_LOONGSON']
   2.723 -      },
   2.724 -      'simulator:none': {
   2.725 -        'CCFLAGS':      ['-EL'],
   2.726 -        'LINKFLAGS':    ['-EL'],
   2.727 -        'mips_arch_variant:mips32r2': {
   2.728 -          'CCFLAGS':      ['-mips32r2', '-Wa,-mips32r2']
   2.729 -        },
   2.730 -        'mips_arch_variant:mips32r1': {
   2.731 -          'CCFLAGS':      ['-mips32', '-Wa,-mips32']
   2.732 -        },
   2.733 -        'mips_arch_variant:loongson': {
   2.734 -          'CCFLAGS':      ['-march=mips3', '-Wa,-march=mips3']
   2.735 -        },
   2.736 -        'library:static': {
   2.737 -          'LINKFLAGS':    ['-static', '-static-libgcc']
   2.738 -        },
   2.739 -        'mipsabi:softfloat': {
   2.740 -          'CCFLAGS':      ['-msoft-float'],
   2.741 -          'LINKFLAGS':    ['-msoft-float']
   2.742 -        },
   2.743 -        'mipsabi:hardfloat': {
   2.744 -          'CCFLAGS':      ['-mhard-float'],
   2.745 -          'LINKFLAGS':    ['-mhard-float']
   2.746 -        }
   2.747 -      }
   2.748 -    },
   2.749 -    'simulator:arm': {
   2.750 -      'CCFLAGS':      ['-m32'],
   2.751 -      'LINKFLAGS':    ['-m32']
   2.752 -    },
   2.753 -    'simulator:mips': {
   2.754 -      'CCFLAGS':      ['-m32'],
   2.755 -      'LINKFLAGS':    ['-m32'],
   2.756 -      'mipsabi:softfloat': {
   2.757 -        'CPPDEFINES':    ['__mips_soft_float=1'],
   2.758 -      },
   2.759 -      'mipsabi:hardfloat': {
   2.760 -        'CPPDEFINES':    ['__mips_hard_float=1'],
   2.761 -      }
   2.762 -    },
   2.763 -    'mode:release': {
   2.764 -      'CCFLAGS':      ['-O2']
   2.765 -    },
   2.766 -    'mode:debug': {
   2.767 -      'CCFLAGS':      ['-g', '-O0'],
   2.768 -      'CPPDEFINES':   ['DEBUG']
   2.769 -    },
   2.770 -    'os:freebsd': {
   2.771 -      'LIBPATH' : ['/usr/local/lib'],
   2.772 -    },
   2.773 -  },
   2.774 -  'msvc': {
   2.775 -    'all': {
   2.776 -      'LIBS': ['winmm', 'ws2_32']
   2.777 -    },
   2.778 -    'verbose:off': {
   2.779 -      'CCFLAGS': ['/nologo'],
   2.780 -      'LINKFLAGS': ['/NOLOGO']
   2.781 -    },
   2.782 -    'verbose:on': {
   2.783 -      'LINKFLAGS': ['/VERBOSE']
   2.784 -    },
   2.785 -    'prof:on': {
   2.786 -      'LINKFLAGS': ['/MAP']
   2.787 -    },
   2.788 -    'mode:release': {
   2.789 -      'CCFLAGS':   ['/O2'],
   2.790 -      'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'],
   2.791 -      'msvcrt:static': {
   2.792 -        'CCFLAGS': ['/MT']
   2.793 -      },
   2.794 -      'msvcrt:shared': {
   2.795 -        'CCFLAGS': ['/MD']
   2.796 -      },
   2.797 -      'msvcltcg:on': {
   2.798 -        'CCFLAGS':      ['/GL'],
   2.799 -        'pgo:off': {
   2.800 -          'LINKFLAGS':    ['/LTCG'],
   2.801 -        },
   2.802 -      },
   2.803 -      'pgo:instrument': {
   2.804 -        'LINKFLAGS':    ['/LTCG:PGI']
   2.805 -      },
   2.806 -      'pgo:optimize': {
   2.807 -        'LINKFLAGS':    ['/LTCG:PGO']
   2.808 -      }
   2.809 -    },
   2.810 -    'arch:ia32': {
   2.811 -      'CPPDEFINES': ['V8_TARGET_ARCH_IA32', 'WIN32'],
   2.812 -      'LINKFLAGS': ['/MACHINE:X86']
   2.813 -    },
   2.814 -    'arch:x64': {
   2.815 -      'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'],
   2.816 -      'LINKFLAGS': ['/MACHINE:X64', '/STACK:2097152']
   2.817 -    },
   2.818 -    'mode:debug': {
   2.819 -      'CCFLAGS':    ['/Od'],
   2.820 -      'LINKFLAGS':  ['/DEBUG'],
   2.821 -      'CPPDEFINES': ['DEBUG'],
   2.822 -      'msvcrt:static': {
   2.823 -        'CCFLAGS':  ['/MTd']
   2.824 -      },
   2.825 -      'msvcrt:shared': {
   2.826 -        'CCFLAGS':  ['/MDd']
   2.827 -      }
   2.828 -    }
   2.829 -  }
   2.830 -}
   2.831 -
   2.832 -
   2.833 -D8_FLAGS = {
   2.834 -  'all': {
   2.835 -    'library:shared': {
   2.836 -      'CPPDEFINES': ['V8_SHARED'],
   2.837 -      'LIBS': ['v8'],
   2.838 -      'LIBPATH': ['.']
   2.839 -    },
   2.840 -  },
   2.841 -  'gcc': {
   2.842 -    'all': {
   2.843 -      'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
   2.844 -      'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'],
   2.845 -      'LINKFLAGS': ['$CCFLAGS'],
   2.846 -    },
   2.847 -    'console:readline': {
   2.848 -      'LIBS': ['readline']
   2.849 -    },
   2.850 -    'os:linux': {
   2.851 -      'LIBS': ['pthread'],
   2.852 -    },
   2.853 -    'os:macos': {
   2.854 -      'LIBS': ['pthread'],
   2.855 -    },
   2.856 -    'os:freebsd': {
   2.857 -      'LIBS': ['pthread'],
   2.858 -    },
   2.859 -    'os:solaris': {
   2.860 -      'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'],
   2.861 -      'LINKFLAGS': ['-mt']
   2.862 -    },
   2.863 -    'os:openbsd': {
   2.864 -      'LIBS': ['pthread'],
   2.865 -    },
   2.866 -    'os:win32': {
   2.867 -      'LIBS': ['winmm', 'ws2_32'],
   2.868 -    },
   2.869 -    'os:netbsd': {
   2.870 -      'LIBS': ['pthread'],
   2.871 -    },
   2.872 -    'arch:arm': {
   2.873 -      'LINKFLAGS':   ARM_LINK_FLAGS
   2.874 -    },
   2.875 -    'compress_startup_data:bz2': {
   2.876 -      'CPPDEFINES':   ['COMPRESS_STARTUP_DATA_BZ2'],
   2.877 -      'os:linux': {
   2.878 -        'LIBS': ['bz2']
   2.879 -      }
   2.880 -    }
   2.881 -  },
   2.882 -  'msvc': {
   2.883 -    'all': {
   2.884 -      'LIBS': ['winmm', 'ws2_32']
   2.885 -    },
   2.886 -    'verbose:off': {
   2.887 -      'CCFLAGS': ['/nologo'],
   2.888 -      'LINKFLAGS': ['/NOLOGO']
   2.889 -    },
   2.890 -    'verbose:on': {
   2.891 -      'LINKFLAGS': ['/VERBOSE']
   2.892 -    },
   2.893 -    'prof:on': {
   2.894 -      'LINKFLAGS': ['/MAP']
   2.895 -    },
   2.896 -    'mode:release': {
   2.897 -      'CCFLAGS':   ['/O2'],
   2.898 -      'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'],
   2.899 -      'msvcrt:static': {
   2.900 -        'CCFLAGS': ['/MT']
   2.901 -      },
   2.902 -      'msvcrt:shared': {
   2.903 -        'CCFLAGS': ['/MD']
   2.904 -      },
   2.905 -      'msvcltcg:on': {
   2.906 -        'CCFLAGS':      ['/GL'],
   2.907 -        'pgo:off': {
   2.908 -          'LINKFLAGS':    ['/LTCG'],
   2.909 -        },
   2.910 -      },
   2.911 -      'pgo:instrument': {
   2.912 -        'LINKFLAGS':    ['/LTCG:PGI']
   2.913 -      },
   2.914 -      'pgo:optimize': {
   2.915 -        'LINKFLAGS':    ['/LTCG:PGO']
   2.916 -      }
   2.917 -    },
   2.918 -    'arch:ia32': {
   2.919 -      'CPPDEFINES': ['V8_TARGET_ARCH_IA32', 'WIN32'],
   2.920 -      'LINKFLAGS': ['/MACHINE:X86']
   2.921 -    },
   2.922 -    'arch:x64': {
   2.923 -      'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'],
   2.924 -      'LINKFLAGS': ['/MACHINE:X64', '/STACK:2097152']
   2.925 -    },
   2.926 -    'mode:debug': {
   2.927 -      'CCFLAGS':    ['/Od'],
   2.928 -      'LINKFLAGS':  ['/DEBUG'],
   2.929 -      'CPPDEFINES': ['DEBUG'],
   2.930 -      'msvcrt:static': {
   2.931 -        'CCFLAGS':  ['/MTd']
   2.932 -      },
   2.933 -      'msvcrt:shared': {
   2.934 -        'CCFLAGS':  ['/MDd']
   2.935 -      }
   2.936 -    }
   2.937 -  }
   2.938 -}
   2.939 -
   2.940 -
   2.941 -SUFFIXES = {
   2.942 -  'release': '',
   2.943 -  'debug': '_g'
   2.944 -}
   2.945 -
   2.946 -
   2.947 -def Abort(message):
   2.948 -  print message
   2.949 -  sys.exit(1)
   2.950 -
   2.951 -
   2.952 -def GuessOS(env):
   2.953 -  return utils.GuessOS()
   2.954 -
   2.955 -
   2.956 -def GuessArch(env):
   2.957 -  return utils.GuessArchitecture()
   2.958 -
   2.959 -
   2.960 -def GuessToolchain(env):
   2.961 -  tools = env['TOOLS']
   2.962 -  if 'gcc' in tools:
   2.963 -    return 'gcc'
   2.964 -  elif 'msvc' in tools:
   2.965 -    return 'msvc'
   2.966 -  else:
   2.967 -    return None
   2.968 -
   2.969 -
   2.970 -def GuessVisibility(env):
   2.971 -  os = env['os']
   2.972 -  toolchain = env['toolchain'];
   2.973 -  if (os == 'win32' or os == 'cygwin') and toolchain == 'gcc':
   2.974 -    # MinGW / Cygwin can't do it.
   2.975 -    return 'default'
   2.976 -  elif os == 'solaris':
   2.977 -    return 'default'
   2.978 -  else:
   2.979 -    return 'hidden'
   2.980 -
   2.981 -
   2.982 -def GuessStrictAliasing(env):
   2.983 -  # There seems to be a problem with gcc 4.5.x.
   2.984 -  # See http://code.google.com/p/v8/issues/detail?id=884
   2.985 -  # It can be worked around by disabling strict aliasing.
   2.986 -  toolchain = env['toolchain'];
   2.987 -  if toolchain == 'gcc':
   2.988 -    env = Environment(tools=['gcc'])
   2.989 -    # The gcc version should be available in env['CCVERSION'],
   2.990 -    # but when scons detects msvc this value is not set.
   2.991 -    version = subprocess.Popen([env['CC'], '-dumpversion'],
   2.992 -        stdout=subprocess.PIPE).communicate()[0]
   2.993 -    if version.find('4.5') == 0:
   2.994 -      return 'off'
   2.995 -  return 'default'
   2.996 -
   2.997 -
   2.998 -PLATFORM_OPTIONS = {
   2.999 -  'arch': {
  2.1000 -    'values': ['arm', 'ia32', 'x64', 'mips'],
  2.1001 -    'guess': GuessArch,
  2.1002 -    'help': 'the architecture to build for'
  2.1003 -  },
  2.1004 -  'os': {
  2.1005 -    'values': ['freebsd', 'linux', 'macos', 'win32', 'openbsd', 'solaris', 'cygwin', 'netbsd'],
  2.1006 -    'guess': GuessOS,
  2.1007 -    'help': 'the os to build for'
  2.1008 -  },
  2.1009 -  'toolchain': {
  2.1010 -    'values': ['gcc', 'msvc'],
  2.1011 -    'guess': GuessToolchain,
  2.1012 -    'help': 'the toolchain to use'
  2.1013 -  }
  2.1014 -}
  2.1015 -
  2.1016 -SIMPLE_OPTIONS = {
  2.1017 -  'regexp': {
  2.1018 -    'values': ['native', 'interpreted'],
  2.1019 -    'default': 'native',
  2.1020 -    'help': 'Whether to use native or interpreted regexp implementation'
  2.1021 -  },
  2.1022 -  'snapshot': {
  2.1023 -    'values': ['on', 'off', 'nobuild'],
  2.1024 -    'default': 'off',
  2.1025 -    'help': 'build using snapshots for faster start-up'
  2.1026 -  },
  2.1027 -  'prof': {
  2.1028 -    'values': ['on', 'off'],
  2.1029 -    'default': 'off',
  2.1030 -    'help': 'enable profiling of build target'
  2.1031 -  },
  2.1032 -  'gdbjit': {
  2.1033 -    'values': ['on', 'off'],
  2.1034 -    'default': 'off',
  2.1035 -    'help': 'enable GDB JIT interface'
  2.1036 -  },
  2.1037 -  'library': {
  2.1038 -    'values': ['static', 'shared'],
  2.1039 -    'default': 'static',
  2.1040 -    'help': 'the type of library to produce'
  2.1041 -  },
  2.1042 -  'objectprint': {
  2.1043 -    'values': ['on', 'off'],
  2.1044 -    'default': 'off',
  2.1045 -    'help': 'enable object printing'
  2.1046 -  },
  2.1047 -  'profilingsupport': {
  2.1048 -    'values': ['on', 'off'],
  2.1049 -    'default': 'on',
  2.1050 -    'help': 'enable profiling of JavaScript code'
  2.1051 -  },
  2.1052 -  'debuggersupport': {
  2.1053 -    'values': ['on', 'off'],
  2.1054 -    'default': 'on',
  2.1055 -    'help': 'enable debugging of JavaScript code'
  2.1056 -  },
  2.1057 -  'inspector': {
  2.1058 -    'values': ['on', 'off'],
  2.1059 -    'default': 'off',
  2.1060 -    'help': 'enable inspector features'
  2.1061 -  },
  2.1062 -  'liveobjectlist': {
  2.1063 -    'values': ['on', 'off'],
  2.1064 -    'default': 'off',
  2.1065 -    'help': 'enable live object list features in the debugger'
  2.1066 -  },
  2.1067 -  'soname': {
  2.1068 -    'values': ['on', 'off'],
  2.1069 -    'default': 'off',
  2.1070 -    'help': 'turn on setting soname for Linux shared library'
  2.1071 -  },
  2.1072 -  'msvcrt': {
  2.1073 -    'values': ['static', 'shared'],
  2.1074 -    'default': 'static',
  2.1075 -    'help': 'the type of Microsoft Visual C++ runtime library to use'
  2.1076 -  },
  2.1077 -  'msvcltcg': {
  2.1078 -    'values': ['on', 'off'],
  2.1079 -    'default': 'on',
  2.1080 -    'help': 'use Microsoft Visual C++ link-time code generation'
  2.1081 -  },
  2.1082 -  'simulator': {
  2.1083 -    'values': ['arm', 'mips', 'none'],
  2.1084 -    'default': 'none',
  2.1085 -    'help': 'build with simulator'
  2.1086 -  },
  2.1087 -  'unalignedaccesses': {
  2.1088 -    'values': ['default', 'on', 'off'],
  2.1089 -    'default': 'default',
  2.1090 -    'help': 'set whether the ARM target supports unaligned accesses'
  2.1091 -  },
  2.1092 -  'disassembler': {
  2.1093 -    'values': ['on', 'off'],
  2.1094 -    'default': 'off',
  2.1095 -    'help': 'enable the disassembler to inspect generated code'
  2.1096 -  },
  2.1097 -  'fasttls': {
  2.1098 -    'values': ['on', 'off'],
  2.1099 -    'default': 'on',
  2.1100 -    'help': 'enable fast thread local storage support '
  2.1101 -            '(if available on the current architecture/platform)'
  2.1102 -  },
  2.1103 -  'sourcesignatures': {
  2.1104 -    'values': ['MD5', 'timestamp'],
  2.1105 -    'default': 'MD5',
  2.1106 -    'help': 'set how the build system detects file changes'
  2.1107 -  },
  2.1108 -  'console': {
  2.1109 -    'values': ['dumb', 'readline'],
  2.1110 -    'default': 'dumb',
  2.1111 -    'help': 'the console to use for the d8 shell'
  2.1112 -  },
  2.1113 -  'verbose': {
  2.1114 -    'values': ['on', 'off'],
  2.1115 -    'default': 'off',
  2.1116 -    'help': 'more output from compiler and linker'
  2.1117 -  },
  2.1118 -  'visibility': {
  2.1119 -    'values': ['default', 'hidden'],
  2.1120 -    'guess': GuessVisibility,
  2.1121 -    'help': 'shared library symbol visibility'
  2.1122 -  },
  2.1123 -  'strictaliasing': {
  2.1124 -    'values': ['default', 'off'],
  2.1125 -    'guess': GuessStrictAliasing,
  2.1126 -    'help': 'assume strict aliasing while optimizing'
  2.1127 -  },
  2.1128 -  'pgo': {
  2.1129 -    'values': ['off', 'instrument', 'optimize'],
  2.1130 -    'default': 'off',
  2.1131 -    'help': 'select profile guided optimization variant',
  2.1132 -  },
  2.1133 -  'armeabi': {
  2.1134 -    'values': ['hard', 'softfp', 'soft'],
  2.1135 -    'default': 'softfp',
  2.1136 -    'help': 'generate calling conventiont according to selected ARM EABI variant'
  2.1137 -  },
  2.1138 -  'mipsabi': {
  2.1139 -    'values': ['hardfloat', 'softfloat', 'none'],
  2.1140 -    'default': 'hardfloat',
  2.1141 -    'help': 'generate calling conventiont according to selected mips ABI'
  2.1142 -  },
  2.1143 -  'mips_arch_variant': {
  2.1144 -    'values': ['mips32r2', 'mips32r1', 'loongson'],
  2.1145 -    'default': 'mips32r2',
  2.1146 -    'help': 'mips variant'
  2.1147 -  },
  2.1148 -  'compress_startup_data': {
  2.1149 -    'values': ['off', 'bz2'],
  2.1150 -    'default': 'off',
  2.1151 -    'help': 'compress startup data (snapshot) [Linux only]'
  2.1152 -  },
  2.1153 -  'vfp3': {
  2.1154 -    'values': ['on', 'off'],
  2.1155 -    'default': 'on',
  2.1156 -    'help': 'use vfp3 instructions when building the snapshot [Arm only]'
  2.1157 -  },
  2.1158 -  'fpu': {
  2.1159 -    'values': ['on', 'off'],
  2.1160 -    'default': 'on',
  2.1161 -    'help': 'use fpu instructions when building the snapshot [MIPS only]'
  2.1162 -  },
  2.1163 -  'I_know_I_should_build_with_GYP': {
  2.1164 -    'values': ['yes', 'no'],
  2.1165 -    'default': 'no',
  2.1166 -    'help': 'grace period: temporarily override SCons deprecation'
  2.1167 -  }
  2.1168 -
  2.1169 -}
  2.1170 -
  2.1171 -ALL_OPTIONS = dict(PLATFORM_OPTIONS, **SIMPLE_OPTIONS)
  2.1172 -
  2.1173 -
  2.1174 -def AddOptions(options, result):
  2.1175 -  guess_env = Environment(options=result)
  2.1176 -  for (name, option) in options.iteritems():
  2.1177 -    if 'guess' in option:
  2.1178 -      # Option has a guess function
  2.1179 -      guess = option.get('guess')
  2.1180 -      default = guess(guess_env)
  2.1181 -    else:
  2.1182 -      # Option has a fixed default
  2.1183 -      default = option.get('default')
  2.1184 -    help = '%s (%s)' % (option.get('help'), ", ".join(option['values']))
  2.1185 -    result.Add(name, help, default)
  2.1186 -
  2.1187 -
  2.1188 -def GetOptions():
  2.1189 -  result = Options()
  2.1190 -  result.Add('mode', 'compilation mode (debug, release)', 'release')
  2.1191 -  result.Add('sample', 'build sample (shell, process, lineprocessor)', '')
  2.1192 -  result.Add('cache', 'directory to use for scons build cache', '')
  2.1193 -  result.Add('env', 'override environment settings (NAME0:value0,NAME1:value1,...)', '')
  2.1194 -  result.Add('importenv', 'import environment settings (NAME0,NAME1,...)', '')
  2.1195 -  AddOptions(PLATFORM_OPTIONS, result)
  2.1196 -  AddOptions(SIMPLE_OPTIONS, result)
  2.1197 -  return result
  2.1198 -
  2.1199 -
  2.1200 -def GetTools(opts):
  2.1201 -  env = Environment(options=opts)
  2.1202 -  os = env['os']
  2.1203 -  toolchain = env['toolchain']
  2.1204 -  if os == 'win32' and toolchain == 'gcc':
  2.1205 -    return ['mingw']
  2.1206 -  elif os == 'win32' and toolchain == 'msvc':
  2.1207 -    return ['msvc', 'mslink', 'mslib', 'msvs']
  2.1208 -  else:
  2.1209 -    return ['default']
  2.1210 -
  2.1211 -
  2.1212 -def GetVersionComponents():
  2.1213 -  MAJOR_VERSION_PATTERN = re.compile(r"#define\s+MAJOR_VERSION\s+(.*)")
  2.1214 -  MINOR_VERSION_PATTERN = re.compile(r"#define\s+MINOR_VERSION\s+(.*)")
  2.1215 -  BUILD_NUMBER_PATTERN = re.compile(r"#define\s+BUILD_NUMBER\s+(.*)")
  2.1216 -  PATCH_LEVEL_PATTERN = re.compile(r"#define\s+PATCH_LEVEL\s+(.*)")
  2.1217 -
  2.1218 -  patterns = [MAJOR_VERSION_PATTERN,
  2.1219 -              MINOR_VERSION_PATTERN,
  2.1220 -              BUILD_NUMBER_PATTERN,
  2.1221 -              PATCH_LEVEL_PATTERN]
  2.1222 -
  2.1223 -  source = open(join(root_dir, 'src', 'version.cc')).read()
  2.1224 -  version_components = []
  2.1225 -  for pattern in patterns:
  2.1226 -    match = pattern.search(source)
  2.1227 -    if match:
  2.1228 -      version_components.append(match.group(1).strip())
  2.1229 -    else:
  2.1230 -      version_components.append('0')
  2.1231 -
  2.1232 -  return version_components
  2.1233 -
  2.1234 -
  2.1235 -def GetVersion():
  2.1236 -  version_components = GetVersionComponents()
  2.1237 -
  2.1238 -  if version_components[len(version_components) - 1] == '0':
  2.1239 -    version_components.pop()
  2.1240 -  return '.'.join(version_components)
  2.1241 -
  2.1242 -
  2.1243 -def GetSpecificSONAME():
  2.1244 -  SONAME_PATTERN = re.compile(r"#define\s+SONAME\s+\"(.*)\"")
  2.1245 -
  2.1246 -  source = open(join(root_dir, 'src', 'version.cc')).read()
  2.1247 -  match = SONAME_PATTERN.search(source)
  2.1248 -
  2.1249 -  if match:
  2.1250 -    return match.group(1).strip()
  2.1251 -  else:
  2.1252 -    return ''
  2.1253 -
  2.1254 -
  2.1255 -def SplitList(str):
  2.1256 -  return [ s for s in str.split(",") if len(s) > 0 ]
  2.1257 -
  2.1258 -
  2.1259 -def IsLegal(env, option, values):
  2.1260 -  str = env[option]
  2.1261 -  for s in SplitList(str):
  2.1262 -    if not s in values:
  2.1263 -      Abort("Illegal value for option %s '%s'." % (option, s))
  2.1264 -      return False
  2.1265 -  return True
  2.1266 -
  2.1267 -
  2.1268 -def WarnAboutDeprecation():
  2.1269 -  print """
  2.1270 -    #####################################################################
  2.1271 -    #                                                                   #
  2.1272 -    #  LAST WARNING: Building V8 with SCons is deprecated.              #
  2.1273 -    #                                                                   #
  2.1274 -    #  This only works because you have overridden the kill switch.     #
  2.1275 -    #                                                                   #
  2.1276 -    #              MIGRATE TO THE GYP-BASED BUILD NOW!                  #
  2.1277 -    #                                                                   #
  2.1278 -    #  Instructions: http://code.google.com/p/v8/wiki/BuildingWithGYP.  #
  2.1279 -    #                                                                   #
  2.1280 -    #####################################################################
  2.1281 -  """
  2.1282 -
  2.1283 -
  2.1284 -def VerifyOptions(env):
  2.1285 -  if env['I_know_I_should_build_with_GYP'] != 'yes':
  2.1286 -    Abort("Building V8 with SCons is no longer supported. Please use GYP "
  2.1287 -          "instead; you can find instructions are at "
  2.1288 -          "http://code.google.com/p/v8/wiki/BuildingWithGYP.\n\n"
  2.1289 -          "Quitting.\n\n"
  2.1290 -          "For a limited grace period, you can specify "
  2.1291 -          "\"I_know_I_should_build_with_GYP=yes\" to override.")
  2.1292 -  else:
  2.1293 -    WarnAboutDeprecation()
  2.1294 -    import atexit
  2.1295 -    atexit.register(WarnAboutDeprecation)
  2.1296 -
  2.1297 -  if not IsLegal(env, 'mode', ['debug', 'release']):
  2.1298 -    return False
  2.1299 -  if not IsLegal(env, 'sample', ["shell", "process", "lineprocessor"]):
  2.1300 -    return False
  2.1301 -  if not IsLegal(env, 'regexp', ["native", "interpreted"]):
  2.1302 -    return False
  2.1303 -  if env['os'] == 'win32' and env['library'] == 'shared' and env['prof'] == 'on':
  2.1304 -    Abort("Profiling on windows only supported for static library.")
  2.1305 -  if env['gdbjit'] == 'on' and ((env['os'] != 'linux' and env['os'] != 'macos') or (env['arch'] != 'ia32' and env['arch'] != 'x64' and env['arch'] != 'arm')):
  2.1306 -    Abort("GDBJIT interface is supported only for Intel-compatible (ia32 or x64) Linux/OSX target.")
  2.1307 -  if env['os'] == 'win32' and env['soname'] == 'on':
  2.1308 -    Abort("Shared Object soname not applicable for Windows.")
  2.1309 -  if env['soname'] == 'on' and env['library'] == 'static':
  2.1310 -    Abort("Shared Object soname not applicable for static library.")
  2.1311 -  if env['os'] != 'win32' and env['pgo'] != 'off':
  2.1312 -    Abort("Profile guided optimization only supported on Windows.")
  2.1313 -  if env['cache'] and not os.path.isdir(env['cache']):
  2.1314 -    Abort("The specified cache directory does not exist.")
  2.1315 -  if not (env['arch'] == 'arm' or env['simulator'] == 'arm') and ('unalignedaccesses' in ARGUMENTS):
  2.1316 -    print env['arch']
  2.1317 -    print env['simulator']
  2.1318 -    Abort("Option unalignedaccesses only supported for the ARM architecture.")
  2.1319 -  if env['os'] != 'linux' and env['compress_startup_data'] != 'off':
  2.1320 -    Abort("Startup data compression is only available on Linux")
  2.1321 -  for (name, option) in ALL_OPTIONS.iteritems():
  2.1322 -    if (not name in env):
  2.1323 -      message = ("A value for option %s must be specified (%s)." %
  2.1324 -          (name, ", ".join(option['values'])))
  2.1325 -      Abort(message)
  2.1326 -    if not env[name] in option['values']:
  2.1327 -      message = ("Unknown %s value '%s'.  Possible values are (%s)." %
  2.1328 -          (name, env[name], ", ".join(option['values'])))
  2.1329 -      Abort(message)
  2.1330 -
  2.1331 -
  2.1332 -class BuildContext(object):
  2.1333 -
  2.1334 -  def __init__(self, options, env_overrides, samples):
  2.1335 -    self.library_targets = []
  2.1336 -    self.mksnapshot_targets = []
  2.1337 -    self.cctest_targets = []
  2.1338 -    self.sample_targets = []
  2.1339 -    self.d8_targets = []
  2.1340 -    self.options = options
  2.1341 -    self.env_overrides = env_overrides
  2.1342 -    self.samples = samples
  2.1343 -    self.preparser_targets = []
  2.1344 -    self.use_snapshot = (options['snapshot'] != 'off')
  2.1345 -    self.build_snapshot = (options['snapshot'] == 'on')
  2.1346 -    self.flags = None
  2.1347 -
  2.1348 -  def AddRelevantFlags(self, initial, flags):
  2.1349 -    result = initial.copy()
  2.1350 -    toolchain = self.options['toolchain']
  2.1351 -    if toolchain in flags:
  2.1352 -      self.AppendFlags(result, flags[toolchain].get('all'))
  2.1353 -      for option in sorted(self.options.keys()):
  2.1354 -        value = self.options[option]
  2.1355 -        self.AppendFlags(result, flags[toolchain].get(option + ':' + value))
  2.1356 -    self.AppendFlags(result, flags.get('all'))
  2.1357 -    return result
  2.1358 -
  2.1359 -  def AddRelevantSubFlags(self, options, flags):
  2.1360 -    self.AppendFlags(options, flags.get('all'))
  2.1361 -    for option in sorted(self.options.keys()):
  2.1362 -      value = self.options[option]
  2.1363 -      self.AppendFlags(options, flags.get(option + ':' + value))
  2.1364 -
  2.1365 -  def GetRelevantSources(self, source):
  2.1366 -    result = []
  2.1367 -    result += source.get('all', [])
  2.1368 -    for (name, value) in self.options.iteritems():
  2.1369 -      source_value = source.get(name + ':' + value, [])
  2.1370 -      if type(source_value) == dict:
  2.1371 -        result += self.GetRelevantSources(source_value)
  2.1372 -      else:
  2.1373 -        result += source_value
  2.1374 -    return sorted(result)
  2.1375 -
  2.1376 -  def AppendFlags(self, options, added):
  2.1377 -    if not added:
  2.1378 -      return
  2.1379 -    for (key, value) in added.iteritems():
  2.1380 -      if key.find(':') != -1:
  2.1381 -        self.AddRelevantSubFlags(options, { key: value })
  2.1382 -      else:
  2.1383 -        if not key in options:
  2.1384 -          options[key] = value
  2.1385 -        else:
  2.1386 -          prefix = options[key]
  2.1387 -          if isinstance(prefix, StringTypes): prefix = prefix.split()
  2.1388 -          options[key] = prefix + value
  2.1389 -
  2.1390 -  def ConfigureObject(self, env, input, **kw):
  2.1391 -    if (kw.has_key('CPPPATH') and env.has_key('CPPPATH')):
  2.1392 -      kw['CPPPATH'] += env['CPPPATH']
  2.1393 -    if self.options['library'] == 'static':
  2.1394 -      return env.StaticObject(input, **kw)
  2.1395 -    else:
  2.1396 -      return env.SharedObject(input, **kw)
  2.1397 -
  2.1398 -  def ApplyEnvOverrides(self, env):
  2.1399 -    if not self.env_overrides:
  2.1400 -      return
  2.1401 -    if type(env['ENV']) == DictType:
  2.1402 -      env['ENV'].update(**self.env_overrides)
  2.1403 -    else:
  2.1404 -      env['ENV'] = self.env_overrides
  2.1405 -
  2.1406 -
  2.1407 -def PostprocessOptions(options, os):
  2.1408 -  # Adjust architecture if the simulator option has been set
  2.1409 -  if (options['simulator'] != 'none') and (options['arch'] != options['simulator']):
  2.1410 -    if 'arch' in ARGUMENTS:
  2.1411 -      # Print a warning if arch has explicitly been set
  2.1412 -      print "Warning: forcing architecture to match simulator (%s)" % options['simulator']
  2.1413 -    options['arch'] = options['simulator']
  2.1414 -  if (options['prof'] != 'off') and (options['profilingsupport'] == 'off'):
  2.1415 -    # Print a warning if profiling is enabled without profiling support
  2.1416 -    print "Warning: forcing profilingsupport on when prof is on"
  2.1417 -    options['profilingsupport'] = 'on'
  2.1418 -  if os == 'win32' and options['pgo'] != 'off' and options['msvcltcg'] == 'off':
  2.1419 -    if 'msvcltcg' in ARGUMENTS:
  2.1420 -      print "Warning: forcing msvcltcg on as it is required for pgo (%s)" % options['pgo']
  2.1421 -    options['msvcltcg'] = 'on'
  2.1422 -  if (options['mipsabi'] != 'none') and (options['arch'] != 'mips') and (options['simulator'] != 'mips'):
  2.1423 -    options['mipsabi'] = 'none'
  2.1424 -  if options['liveobjectlist'] == 'on':
  2.1425 -    if (options['debuggersupport'] != 'on') or (options['mode'] == 'release'):
  2.1426 -      # Print a warning that liveobjectlist will implicitly enable the debugger
  2.1427 -      print "Warning: forcing debuggersupport on for liveobjectlist"
  2.1428 -    options['debuggersupport'] = 'on'
  2.1429 -    options['inspector'] = 'on'
  2.1430 -    options['objectprint'] = 'on'
  2.1431 -
  2.1432 -
  2.1433 -def ParseEnvOverrides(arg, imports):
  2.1434 -  # The environment overrides are in the format NAME0:value0,NAME1:value1,...
  2.1435 -  # The environment imports are in the format NAME0,NAME1,...
  2.1436 -  overrides = {}
  2.1437 -  for var in imports.split(','):
  2.1438 -    if var in os.environ:
  2.1439 -      overrides[var] = os.environ[var]
  2.1440 -  for override in arg.split(','):
  2.1441 -    pos = override.find(':')
  2.1442 -    if pos == -1:
  2.1443 -      continue
  2.1444 -    overrides[override[:pos].strip()] = override[pos+1:].strip()
  2.1445 -  return overrides
  2.1446 -
  2.1447 -
  2.1448 -def BuildSpecific(env, mode, env_overrides, tools):
  2.1449 -  options = {'mode': mode}
  2.1450 -  for option in ALL_OPTIONS:
  2.1451 -    options[option] = env[option]
  2.1452 -  PostprocessOptions(options, env['os'])
  2.1453 -
  2.1454 -  context = BuildContext(options, env_overrides, samples=SplitList(env['sample']))
  2.1455 -
  2.1456 -  # Remove variables which can't be imported from the user's external
  2.1457 -  # environment into a construction environment.
  2.1458 -  user_environ = os.environ.copy()
  2.1459 -  try:
  2.1460 -    del user_environ['ENV']
  2.1461 -  except KeyError:
  2.1462 -    pass
  2.1463 -
  2.1464 -  library_flags = context.AddRelevantFlags(user_environ, LIBRARY_FLAGS)
  2.1465 -  v8_flags = context.AddRelevantFlags(library_flags, V8_EXTRA_FLAGS)
  2.1466 -  mksnapshot_flags = context.AddRelevantFlags(library_flags, MKSNAPSHOT_EXTRA_FLAGS)
  2.1467 -  dtoa_flags = context.AddRelevantFlags(library_flags, DTOA_EXTRA_FLAGS)
  2.1468 -  cctest_flags = context.AddRelevantFlags(v8_flags, CCTEST_EXTRA_FLAGS)
  2.1469 -  sample_flags = context.AddRelevantFlags(user_environ, SAMPLE_FLAGS)
  2.1470 -  preparser_flags = context.AddRelevantFlags(user_environ, PREPARSER_FLAGS)
  2.1471 -  d8_flags = context.AddRelevantFlags(library_flags, D8_FLAGS)
  2.1472 -
  2.1473 -  context.flags = {
  2.1474 -    'v8': v8_flags,
  2.1475 -    'mksnapshot': mksnapshot_flags,
  2.1476 -    'dtoa': dtoa_flags,
  2.1477 -    'cctest': cctest_flags,
  2.1478 -    'sample': sample_flags,
  2.1479 -    'd8': d8_flags,
  2.1480 -    'preparser': preparser_flags
  2.1481 -  }
  2.1482 -
  2.1483 -  # Generate library base name.
  2.1484 -  target_id = mode
  2.1485 -  suffix = SUFFIXES[target_id]
  2.1486 -  library_name = 'v8' + suffix
  2.1487 -  preparser_library_name = 'v8preparser' + suffix
  2.1488 -  version = GetVersion()
  2.1489 -  if context.options['soname'] == 'on':
  2.1490 -    # When building shared object with SONAME version the library name.
  2.1491 -    library_name += '-' + version
  2.1492 -
  2.1493 -  # Generate library SONAME if required by the build.
  2.1494 -  if context.options['soname'] == 'on':
  2.1495 -    soname = GetSpecificSONAME()
  2.1496 -    if soname == '':
  2.1497 -      soname = 'lib' + library_name + '.so'
  2.1498 -    env['SONAME'] = soname
  2.1499 -
  2.1500 -  # Build the object files by invoking SCons recursively.
  2.1501 -  d8_env = Environment(tools=tools)
  2.1502 -  d8_env.Replace(**context.flags['d8'])
  2.1503 -  (object_files, shell_files, mksnapshot, preparser_files) = env.SConscript(
  2.1504 -    join('src', 'SConscript'),
  2.1505 -    build_dir=join('obj', target_id),
  2.1506 -    exports='context tools d8_env',
  2.1507 -    duplicate=False
  2.1508 -  )
  2.1509 -
  2.1510 -  context.mksnapshot_targets.append(mksnapshot)
  2.1511 -
  2.1512 -  # Link the object files into a library.
  2.1513 -  env.Replace(**context.flags['v8'])
  2.1514 -
  2.1515 -  context.ApplyEnvOverrides(env)
  2.1516 -  if context.options['library'] == 'static':
  2.1517 -    library = env.StaticLibrary(library_name, object_files)
  2.1518 -    preparser_library = env.StaticLibrary(preparser_library_name,
  2.1519 -                                          preparser_files)
  2.1520 -  else:
  2.1521 -    # There seems to be a glitch in the way scons decides where to put
  2.1522 -    # PDB files when compiling using MSVC so we specify it manually.
  2.1523 -    # This should not affect any other platforms.
  2.1524 -    pdb_name = library_name + '.dll.pdb'
  2.1525 -    library = env.SharedLibrary(library_name, object_files, PDB=pdb_name)
  2.1526 -    preparser_pdb_name = preparser_library_name + '.dll.pdb';
  2.1527 -    preparser_soname = 'lib' + preparser_library_name + '.so';
  2.1528 -    preparser_library = env.SharedLibrary(preparser_library_name,
  2.1529 -                                          preparser_files,
  2.1530 -                                          PDB=preparser_pdb_name,
  2.1531 -                                          SONAME=preparser_soname)
  2.1532 -  context.library_targets.append(library)
  2.1533 -  context.library_targets.append(preparser_library)
  2.1534 -
  2.1535 -  context.ApplyEnvOverrides(d8_env)
  2.1536 -  if context.options['library'] == 'static':
  2.1537 -    shell = d8_env.Program('d8' + suffix, object_files + shell_files)
  2.1538 -  else:
  2.1539 -    shell = d8_env.Program('d8' + suffix, shell_files)
  2.1540 -    d8_env.Depends(shell, library)
  2.1541 -  context.d8_targets.append(shell)
  2.1542 -
  2.1543 -  for sample in context.samples:
  2.1544 -    sample_env = Environment(tools=tools)
  2.1545 -    sample_env.Replace(**context.flags['sample'])
  2.1546 -    sample_env.Prepend(LIBS=[library_name])
  2.1547 -    context.ApplyEnvOverrides(sample_env)
  2.1548 -    sample_object = sample_env.SConscript(
  2.1549 -      join('samples', 'SConscript'),
  2.1550 -      build_dir=join('obj', 'sample', sample, target_id),
  2.1551 -      exports='sample context tools',
  2.1552 -      duplicate=False
  2.1553 -    )
  2.1554 -    sample_name = sample + suffix
  2.1555 -    sample_program = sample_env.Program(sample_name, sample_object)
  2.1556 -    sample_env.Depends(sample_program, library)
  2.1557 -    context.sample_targets.append(sample_program)
  2.1558 -
  2.1559 -  cctest_env = env.Copy()
  2.1560 -  cctest_env.Prepend(LIBS=[library_name])
  2.1561 -  cctest_program = cctest_env.SConscript(
  2.1562 -    join('test', 'cctest', 'SConscript'),
  2.1563 -    build_dir=join('obj', 'test', target_id),
  2.1564 -    exports='context object_files tools',
  2.1565 -    duplicate=False
  2.1566 -  )
  2.1567 -  context.cctest_targets.append(cctest_program)
  2.1568 -
  2.1569 -  preparser_env = env.Copy()
  2.1570 -  preparser_env.Replace(**context.flags['preparser'])
  2.1571 -  preparser_env.Prepend(LIBS=[preparser_library_name])
  2.1572 -  context.ApplyEnvOverrides(preparser_env)
  2.1573 -  preparser_object = preparser_env.SConscript(
  2.1574 -    join('preparser', 'SConscript'),
  2.1575 -    build_dir=join('obj', 'preparser', target_id),
  2.1576 -    exports='context tools',
  2.1577 -    duplicate=False
  2.1578 -  )
  2.1579 -  preparser_name = join('obj', 'preparser', target_id, 'preparser')
  2.1580 -  preparser_program = preparser_env.Program(preparser_name, preparser_object);
  2.1581 -  preparser_env.Depends(preparser_program, preparser_library)
  2.1582 -  context.preparser_targets.append(preparser_program)
  2.1583 -
  2.1584 -  return context
  2.1585 -
  2.1586 -
  2.1587 -def Build():
  2.1588 -  opts = GetOptions()
  2.1589 -  tools = GetTools(opts)
  2.1590 -  env = Environment(options=opts, tools=tools)
  2.1591 -
  2.1592 -  Help(opts.GenerateHelpText(env))
  2.1593 -  VerifyOptions(env)
  2.1594 -  env_overrides = ParseEnvOverrides(env['env'], env['importenv'])
  2.1595 -
  2.1596 -  SourceSignatures(env['sourcesignatures'])
  2.1597 -
  2.1598 -  libraries = []
  2.1599 -  mksnapshots = []
  2.1600 -  cctests = []
  2.1601 -  samples = []
  2.1602 -  preparsers = []
  2.1603 -  d8s = []
  2.1604 -  modes = SplitList(env['mode'])
  2.1605 -  for mode in modes:
  2.1606 -    context = BuildSpecific(env.Copy(), mode, env_overrides, tools)
  2.1607 -    libraries += context.library_targets
  2.1608 -    mksnapshots += context.mksnapshot_targets
  2.1609 -    cctests += context.cctest_targets
  2.1610 -    samples += context.sample_targets
  2.1611 -    preparsers += context.preparser_targets
  2.1612 -    d8s += context.d8_targets
  2.1613 -
  2.1614 -  env.Alias('library', libraries)
  2.1615 -  env.Alias('mksnapshot', mksnapshots)
  2.1616 -  env.Alias('cctests', cctests)
  2.1617 -  env.Alias('sample', samples)
  2.1618 -  env.Alias('d8', d8s)
  2.1619 -  env.Alias('preparser', preparsers)
  2.1620 -
  2.1621 -  if env['sample']:
  2.1622 -    env.Default('sample')
  2.1623 -  else:
  2.1624 -    env.Default('library')
  2.1625 -
  2.1626 -  if env['cache']:
  2.1627 -    CacheDir(env['cache'])
  2.1628 -
  2.1629 -# We disable deprecation warnings because we need to be able to use
  2.1630 -# env.Copy without getting warnings for compatibility with older
  2.1631 -# version of scons.  Also, there's a bug in some revisions that
  2.1632 -# doesn't allow this flag to be set, so we swallow any exceptions.
  2.1633 -# Lovely.
  2.1634 -try:
  2.1635 -  SetOption('warn', 'no-deprecated')
  2.1636 -except:
  2.1637 -  pass
  2.1638 -
  2.1639 -Build()
     3.1 --- a/node/stuff/SConstruct.patch	Mon Dec 26 14:19:02 2016 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,13 +0,0 @@
     3.4 ---- deps/v8/SConstruct
     3.5 -+++ deps/v8/SConstruct
     3.6 -@@ -80,8 +80,8 @@
     3.7 -   },
     3.8 -   'gcc': {
     3.9 -     'all': {
    3.10 --      'CCFLAGS':      ['$DIALECTFLAGS', '$WARNINGFLAGS'],
    3.11 --      'CXXFLAGS':     ['-fno-rtti', '-fno-exceptions'],
    3.12 -+      'CCFLAGS':      ['$DIALECTFLAGS', '$WARNINGFLAGS', '-march=armv6'],
    3.13 -+      'CXXFLAGS':     ['-fno-rtti', '-fno-exceptions', '-march=armv6'],
    3.14 -     },
    3.15 -     'visibility:hidden': {
    3.16 -       # Use visibility=default to disable this.