How to Download and Build V8
请注意,基于arm系统的最低要求ARMv6 + VFP2。
V8 JavaScript Engine
V8 is Google’s open source JavaScript engine.
V8 implements ECMAScript as specified in ECMA-262.
V8 is written in C++ and is used in Google Chrome, the open source browser from Google.
V8 can run standalone, or can be embedded into any C++ application.
V8 Project page: https://github.com/v8/v8/wiki
Download the source code
V8的git存储库位于:这里。
V8的主分支也正式git在github镜像:这里。不要只是git clone这些url的如果你想从你checkout编译V8,请遵循下面说明的一切正确设置。
先决条件
Checkout depot tools, and run
fetch v8
Chromium and Chromium OS use a package of scripts called depot_tools to manage checkouts and code reviews.
The depot_tools package includes gclient, gcl, git-cl, repo, and others.- Build V8
There is a page Building with GYP in the V8 wiki. In brief, you should use GYP to generate a Visual Studio solution and then build it.
Install Python, Subversion client; make it available from a command line.
Open Visual Studio Command Prompt, do next steps there. - Fetch V8 sources into some directory, say it would be named v8-build:
svn checkout http://v8.googlecode.com/svn/trunk v8-build
for the recent version (either some tagged version, for example http://v8.googlecode.com/svn/tags/3.28.57)
4.On Windows you need Cygwin: svn checkout http://src.chromium.org/svn/trunk/deps/third_party/cygwin@66844 v8-build/third_party/cygwin
(see actual URL in a v8-build/DEPS file)
5.Fetch GYP:
svn checkout http://gyp.googlecode.com/svn/trunk@1831 v8-build/gyp
6.Optionally fetch ICU:
svn checkout https://src.chromium.org/svn/trunk/deps/third_party/icu46@258359 v8-build/third_party/icu
7.Make tools available in the command line:
•set CYGWIN_ROOT=%cd%\v8-build\third_party\cygwin
•set PATH=%CYGWIN_ROOT%\bin;%PATH%
•set PYTHONPATH=%cd%\v8-build\gyp\pylib
•v8-build\third_party\cygwin\setup_mount.bat
•v8-build\third_party\cygwin\setup_env.bat
8.Run GYP with desired options:
python v8-build\build\gyp_v8 -Dcomponent=static_library -Dtarget_arch=x64 -v8_enable_i18n_support=0 -Dv8_use_snapshot=0
(see allowed variables in v8-build\build\features.gypi)
9.Build generated project with Visual Studio using the Cygwin environment:
msbuild /m /p:UseEnv=true /p:Configuration=Release /p:Platform=x64 v8-build\tools\gyp\v8.vcxproj
10.Result libraries should be in the v8-build\build directory
I use a Python script to automate the steps above.