Csdn lidp: http://blog.csdn.net/perfectpdl
This document describes how to download and compile the V8 engine on the Linux (Intel or ARM-based), Windows XP or Vista, or Mac OS X 10.5 (Leopard) platform.
1. preparation:
Packages on all platforms:
- Subversion 1.4 or higher-see http://subversion.tigris.org/links.html#clients
- Python 2.4 or higher-see http://www.python.org
- Scons 1.0.0 or higher-see http://www.scons.org
Compile dependency packages for specific platforms:
- Linux and Mac OS X 10.5: GCC 4.x. X-see http://gcc.gnu.org
- Windows: Visual Studio 2005, Visual Studio 2008, or the free visual
C ++ 2008 express Edition
Check whether the dependency package is successfully installed:
$ svn --version $ python -V $ scons --version
2. Download source code
The V8 project is hosted on Google Code and can be downloaded using the svn Client
SVN checkout
HTTP: // V8.googlecode.com/svn/trunk/ v8_trunk
3. Compile:
The simplest way to compile V8 is to enter scons In the downloaded source code directory. This script will automatically detect the platform and generate an optimized V8 library in the current directory,
You can also specify some compilation parameters after scons. Enter:
# Scons -- Help
mode=[release|debug]
Specifies whether to compile or debug the version. The default version is the release version.
- Compile and debug the version, which is added after scons.
mode=debug
The generated library contains debugging information and asstert.
- Compile and release the version, scons
Add ode = release after M
.
snapshot=[on|off]
Specify whether to use snapshots. Enabling this option increases the startup speed of the program, but increases the size of the executable program by about KB.
library=[static|shared]
Specifies whether to generate a dynamic or static library.
For example, compile the dynamic library of the debug version in the following example and enable the snapshot function.
scons mode=debug library=shared snapshot=on
The following command is used to compile the shell of release V8:
scons sample=shell
The following command is used to compile the developer shell of the release version:
scons d8