diff options
| author | Ben Murdoch <benm@google.com> | 2011-05-05 13:52:32 +0100 |
|---|---|---|
| committer | Ben Murdoch <benm@google.com> | 2011-05-10 15:41:47 +0100 |
| commit | b0fe1620dcb4135ac3ab2d66ff93072373911299 (patch) | |
| tree | 3487cdc7e01ec56a6f84ea20f4bae596a0b73986 /build | |
| parent | df5bff59602802b769e994b0dc1d8869a27fa40c (diff) | |
| download | android_external_v8-b0fe1620dcb4135ac3ab2d66ff93072373911299.tar.gz android_external_v8-b0fe1620dcb4135ac3ab2d66ff93072373911299.tar.bz2 android_external_v8-b0fe1620dcb4135ac3ab2d66ff93072373911299.zip | |
Update V8 to r6101 as required by WebKit r74534
Change-Id: I7f84af8dd732f11898fd644b2c2b1538914cb78d
Diffstat (limited to 'build')
| -rw-r--r-- | build/README.txt | 25 | ||||
| -rw-r--r-- | build/all.gyp | 18 | ||||
| -rw-r--r-- | build/armu.gypi | 32 | ||||
| -rw-r--r-- | build/common.gypi | 82 | ||||
| -rwxr-xr-x | build/gyp_v8 | 145 |
5 files changed, 302 insertions, 0 deletions
diff --git a/build/README.txt b/build/README.txt new file mode 100644 index 00000000..7cd7e18b --- /dev/null +++ b/build/README.txt @@ -0,0 +1,25 @@ +This directory contains the V8 GYP files used to generate actual project files +for different build systems. + +This is currently work in progress but this is expected to replace the SCons +based build system. + +To use this a checkout of GYP is needed inside this directory. From the root of +the V8 project do the following + +$ svn co http://gyp.googlecode.com/svn/trunk build/gyp + +To generate Makefiles and build 32-bit version on Linux: + +$ GYP_DEFINES=target_arch=ia32 build/gyp_v8 +$ make + +To generate Makefiles and build 64-bit version on Linux: + +$ GYP_DEFINES=target_arch=x64 build/gyp_v8 +$ make + +To generate Makefiles and build for the arm simulator on Linux: + +$ build/gyp_v8 -I build/arm.gypi +$ make diff --git a/build/all.gyp b/build/all.gyp new file mode 100644 index 00000000..544e2c29 --- /dev/null +++ b/build/all.gyp @@ -0,0 +1,18 @@ +# Copyright (c) 2010 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'All', + 'type': 'none', + 'dependencies': [ + '../samples/samples.gyp:*', + '../test/cctest/cctest.gyp:*', + '../src/d8.gyp:*', + ] + } + ] +} + diff --git a/build/armu.gypi b/build/armu.gypi new file mode 100644 index 00000000..72eb4d15 --- /dev/null +++ b/build/armu.gypi @@ -0,0 +1,32 @@ +# Copyright 2010 the V8 project authors. All rights reserved. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +{ + 'variables': { + 'v8_target_arch': 'arm', + } +} diff --git a/build/common.gypi b/build/common.gypi new file mode 100644 index 00000000..3b5358e3 --- /dev/null +++ b/build/common.gypi @@ -0,0 +1,82 @@ +# Copyright 2010 the V8 project authors. All rights reserved. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +{ + 'variables': { + 'library%': 'static_library', + 'component%': 'static_library', + 'visibility%': 'hidden', + 'variables': { + 'conditions': [ + [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', { + # This handles the Linux platforms we generally deal with. Anything + # else gets passed through, which probably won't work very well; such + # hosts should pass an explicit target_arch to gyp. + 'host_arch%': + '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/")', + }, { # OS!="linux" and OS!="freebsd" and OS!="openbsd" + 'host_arch%': 'ia32', + }], + ], + }, + 'host_arch%': '<(host_arch)', + 'target_arch%': '<(host_arch)', + 'v8_target_arch%': '<(target_arch)', + }, + 'target_defaults': { + 'default_configuration': 'Debug', + 'configurations': { + 'Debug': { + 'cflags': [ '-g', '-O0' ], + 'defines': [ 'ENABLE_DISASSEMBLER', 'DEBUG' ], + }, + 'Release': { + 'cflags': [ '-O3', '-fomit-frame-pointer', '-fdata-sections', '-ffunction-sections' ], + }, + }, + }, + 'conditions': [ + [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { + 'target_defaults': { + 'cflags': [ '-Wall', '-pthread', '-fno-rtti', '-fno-exceptions' ], + 'ldflags': [ '-pthread', ], + 'conditions': [ + [ 'target_arch=="ia32"', { + 'cflags': [ '-m32' ], + 'ldflags': [ '-m32' ], + }], + [ 'OS=="linux"', { + 'cflags': [ '-ansi' ], + }], + [ 'visibility=="hidden"', { + 'cflags': [ '-fvisibility=hidden' ], + }], + ], + }, + }], + ], +} diff --git a/build/gyp_v8 b/build/gyp_v8 new file mode 100755 index 00000000..0c2221e2 --- /dev/null +++ b/build/gyp_v8 @@ -0,0 +1,145 @@ +#!/usr/bin/python +# +# Copyright 2010 the V8 project authors. All rights reserved. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# This script is wrapper for V8 that adds some support for how GYP +# is invoked by V8 beyond what can be done in the gclient hooks. + +import glob +import os +import shlex +import sys + +script_dir = os.path.dirname(__file__) +v8_root = os.path.normpath(os.path.join(script_dir, os.pardir)) + +sys.path.insert(0, os.path.join(v8_root, 'build', 'gyp', 'pylib')) +import gyp + +def apply_gyp_environment(file_path=None): + """ + Reads in a *.gyp_env file and applies the valid keys to os.environ. + """ + if not file_path or not os.path.exists(file_path): + return + file_contents = open(file_path).read() + try: + file_data = eval(file_contents, {'__builtins__': None}, None) + except SyntaxError, e: + e.filename = os.path.abspath(file_path) + raise + supported_vars = ( 'V8_GYP_FILE', + 'V8_GYP_SYNTAX_CHECK', + 'GYP_DEFINES', + 'GYP_GENERATOR_FLAGS', + 'GYP_GENERATOR_OUTPUT', ) + for var in supported_vars: + val = file_data.get(var) + if val: + if var in os.environ: + print 'INFO: Environment value for "%s" overrides value in %s.' % ( + var, os.path.abspath(file_path) + ) + else: + os.environ[var] = val + +def additional_include_files(args=[]): + """ + Returns a list of additional (.gypi) files to include, without + duplicating ones that are already specified on the command line. + """ + # Determine the include files specified on the command line. + # This doesn't cover all the different option formats you can use, + # but it's mainly intended to avoid duplicating flags on the automatic + # makefile regeneration which only uses this format. + specified_includes = set() + for arg in args: + if arg.startswith('-I') and len(arg) > 2: + specified_includes.add(os.path.realpath(arg[2:])) + + result = [] + def AddInclude(path): + if os.path.realpath(path) not in specified_includes: + result.append(path) + + # Always include common.gypi & features_override.gypi + AddInclude(os.path.join(script_dir, 'common.gypi')) + + # Optionally add supplemental .gypi files if present. + supplements = glob.glob(os.path.join(v8_root, '*', 'supplement.gypi')) + for supplement in supplements: + AddInclude(supplement) + + return result + +if __name__ == '__main__': + args = sys.argv[1:] + + if 'SKIP_V8_GYP_ENV' not in os.environ: + # Update the environment based on v8.gyp_env + gyp_env_path = os.path.join(os.path.dirname(v8_root), 'v8.gyp_env') + apply_gyp_environment(gyp_env_path) + + # This could give false positives since it doesn't actually do real option + # parsing. Oh well. + gyp_file_specified = False + for arg in args: + if arg.endswith('.gyp'): + gyp_file_specified = True + break + + # If we didn't get a file, check an env var, and then fall back to + # assuming 'all.gyp' from the same directory as the script. + if not gyp_file_specified: + gyp_file = os.environ.get('V8_GYP_FILE') + if gyp_file: + # Note that V8_GYP_FILE values can't have backslashes as + # path separators even on Windows due to the use of shlex.split(). + args.extend(shlex.split(gyp_file)) + else: + args.append(os.path.join(script_dir, 'all.gyp')) + + args.extend(['-I' + i for i in additional_include_files(args)]) + + # There shouldn't be a circular dependency relationship between .gyp files + args.append('--no-circular-check') + + # Set the GYP DEPTH variable to the root of the V8 project. + args.append('--depth=' + v8_root) + + # If V8_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check + # to enfore syntax checking. + syntax_check = os.environ.get('V8_GYP_SYNTAX_CHECK') + if syntax_check and int(syntax_check): + args.append('--check') + + print 'Updating projects from gyp files...' + sys.stdout.flush() + + # Off we go... + sys.exit(gyp.main(args)) |
