Skip to content

Commit

Permalink
add deps/v8/build ???
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Aug 6, 2011
1 parent bea4827 commit f55f478
Show file tree
Hide file tree
Showing 6 changed files with 607 additions and 0 deletions.
66 changes: 66 additions & 0 deletions deps/v8/build/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
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

Note for the command lines below that Debug is the default configuration,
so specifying that on the command lines is not required.


To generate Makefiles on Linux:
-------------------------------

$ build/gyp_v8

This will build makefiles for ia32, x64 and the ARM simulator with names
Makefile-ia32, Makefile-x64 and Makefile-armu respectively.

To build and run for ia32 in debug and release version do:

$ make -f Makefile-ia32
$ out/Debug/shell
$ make -f Makefile-ia32 BUILDTYPE=Release
$ out/Release/shell

Change the makefile to build and run for the other architectures.


To generate Xcode project files on Mac OS:
------------------------------------------

$ build/gyp_v8

This will make an Xcode project for the ia32 architecture. To build and run do:

$ xcodebuild -project build/all.xcodeproj
$ samples/build/Debug/shell
$ xcodebuild -project build/all.xcodeproj -configuration Release
$ samples/build/Release/shell


To generate Visual Studio solution and project files on Windows:
----------------------------------------------------------------

On Windows an additional third party component is required. This is cygwin in
the same version as is used by the Chromium project. This can be checked out
from the Chromium repository. From the root of the V8 project do the following:

> svn co http://src.chromium.org/svn/trunk/deps/third_party/cygwin@66844 third_party/cygwin

To run GYP Python is required and it is reccomended to use the same version as
is used by the Chromium project. This can also be checked out from the Chromium
repository. From the root of the V8 project do the following:

> svn co http://src.chromium.org/svn/trunk/tools/third_party/python_26@70627 third_party/python_26

Now generate Visual Studio solution and project files for the ia32 architecture:

> third_party\python_26\python build/gyp_v8

Now open build\All.sln in Visual Studio.
24 changes: 24 additions & 0 deletions deps/v8/build/all.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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:*',
'../src/d8.gyp:d8',
],
'conditions': [
[ 'component!="shared_library"', {
'dependencies': [
'../test/cctest/cctest.gyp:*',
],
}]
],
}
]
}

36 changes: 36 additions & 0 deletions deps/v8/build/armu.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2011 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': {
'target_arch': 'ia32',
'v8_target_arch': 'arm',
'armv7': 1,
'arm_neon': 0,
'arm_fpu': 'vfpv3',
}
}
183 changes: 183 additions & 0 deletions deps/v8/build/common.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
# 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' ],
}],
],
},
}], # 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"'
['OS=="win"', {
'target_defaults': {
'defines': [
'WIN32',
'_CRT_SECURE_NO_DEPRECATE',
'_CRT_NONSTDC_NO_DEPRECATE',
],
'conditions': [
['component=="static_library"', {
'defines': [
'_HAS_EXCEPTIONS=0',
],
}],
],
'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
'msvs_disabled_warnings': [4355, 4800],
'msvs_settings': {
'VCCLCompilerTool': {
'MinimalRebuild': 'false',
'BufferSecurityCheck': 'true',
'EnableFunctionLevelLinking': 'true',
'RuntimeTypeInfo': 'false',
'WarningLevel': '3',
'WarnAsError': 'true',
'DebugInformationFormat': '3',
'Detect64BitPortabilityProblems': 'false',
'conditions': [
[ 'msvs_multi_core_compile', {
'AdditionalOptions': ['/MP'],
}],
['component=="shared_library"', {
'ExceptionHandling': '1', # /EHsc
}, {
'ExceptionHandling': '0',
}],
],
},
'VCLibrarianTool': {
'AdditionalOptions': ['/ignore:4221'],
},
'VCLinkerTool': {
'AdditionalDependencies': [
'ws2_32.lib',
],
'GenerateDebugInformation': 'true',
'MapFileName': '$(OutDir)\\$(TargetName).map',
'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
'FixedBaseAddress': '1',
# LinkIncremental values:
# 0 == default
# 1 == /INCREMENTAL:NO
# 2 == /INCREMENTAL
'LinkIncremental': '1',
# SubSystem values:
# 0 == not set
# 1 == /SUBSYSTEM:CONSOLE
# 2 == /SUBSYSTEM:WINDOWS
'SubSystem': '1',
},
},
},
}], # OS=="win"
['OS=="mac"', {
'target_defaults': {
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'GCC_C_LANGUAGE_STANDARD': 'ansi', # -ansi
'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
# (Equivalent to -fPIC)
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
# GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
'GCC_VERSION': '4.2',
'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
'MACOSX_DEPLOYMENT_TARGET': '10.4', # -mmacosx-version-min=10.4
'PREBINDING': 'NO', # No -Wl,-prebind
'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [
'-fno-strict-aliasing',
],
'WARNING_CFLAGS': [
'-Wall',
'-Wendif-labels',
'-W',
'-Wno-unused-parameter',
'-Wnon-virtual-dtor',
],
},
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
}],
], # target_conditions
}, # target_defaults
}], # OS=="mac"
],
}
Loading

0 comments on commit f55f478

Please sign in to comment.