Download and compile V8

Source: Internet
Author: User
Tags svn client

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=debugThe generated library contains debugging information and asstert.
    • Compile and release the version, sconsAdd 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.