我按照这些说明尝试在Mac Lion上构建V8: http://code.google.com/apis/v8/build.html
我收到此错误:
$ scons sample=shell mode=release snapshot=on
scons: Reading SConscript files ...
OSError: [Errno 2] No such file or directory:
File "/Users/pottmi/Tools/v8/v8-read-only/SConstruct", line 1569:
Build()
File "/Users/pottmi/Tools/v8/v8-read-only/SConstruct", line 1517:
opts = GetOptions()
File "/Users/pottmi/Tools/v8/v8-read-only/SConstruct", line 1153:
AddOptions(SIMPLE_OPTIONS, result)
File "/Users/pottmi/Tools/v8/v8-read-only/SConstruct", line 1137:
default = guess(guess_env)
File "/Users/pottmi/Tools/v8/v8-read-only/SConstruct", line 959:
stdout=subprocess.PIPE).communicate()[0]
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672:
None
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202:
None
以下是我安装的软件版本:
svn, version 1.6.17 (r1128011)
Python 2.7.1
SCons by Steven Knight et al.:
script: v2.1.0.r5357[MODIFIED], 2011/09/09 21:31:03, by bdeegan on ubuntu
engine: v2.1.0.r5357[MODIFIED], 2011/09/09 21:31:03, by bdeegan on ubuntu
engine path: ['/usr/local/lib/scons-2.1.0/SCons']
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/路径存在,但没有subprocess.py文件。
答案 0 :(得分:1)
我认为构建v8的推荐方法是使用gyp。有关以这种方式构建它的信息,请参阅http://code.google.com/p/v8/wiki/BuildingWithGYP。
答案 1 :(得分:0)
在过去的两年中,使用Homebrew比使用手动编译更好运。通过Homebrew安装v8 Javascript引擎非常简单:
[12:26] Bryson@Galactica ~ :$ brew install v8
==> Installing v8 dependency: scons
==> Downloading http://downloads.sourceforge.net/scons/scons-2.2.0.tar.gz
######################################################################## 100.0%
==> /usr/bin/gzip scons-time.1
==> /usr/bin/gzip scons.1
==> /usr/bin/gzip sconsign.1
==> /usr/bin/python setup.py install --prefix=/usr/local/Cellar/scons/2.2.0 --standalone-lib --install-lib=/usr/
/usr/local/Cellar/scons/2.2.0: 393 files, 4.2M, built in 4 seconds
==> Installing v8
==> Downloading https://github.com/v8/v8/tarball/3.9.24
######################################################################## 100.0%
==> scons -j 8 arch=x64 mode=release snapshot=on library=shared visibility=default console=readline sample=shell
==> install_name_tool -change libv8.dylib /usr/local/Cellar/v8/3.9.24/lib/libv8.dylib /usr/local/Cellar/v8/3.9.2
/usr/local/Cellar/v8/3.9.24: 12 files, 5.8M, built in 55 seconds
安装Dependancies,检查版本等。从这里开始,只需输入v8
即可进入shell。