谷歌已经决定放弃建立V8。推荐的方法是使用gn构建。
但是,v8js无法找到所需的库,并通过以下方式退出:
checking for V8 Javascript Engine... yes, shared
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for C standard version... c++11
checking how to allow c++11 narrowing... -Wno-narrowing
checking for V8 version... NONE
configure: error: could not determine libv8 version在用gn编译v8js之后,需要做些什么来编译V8扩展?
谢谢!
发布于 2016-10-17 17:14:05
经过两天的实验,我成功地编译了用gn构建的针对v8js的V8 (相对于现在不推荐的gyp)。
遵循初始的结帐说明https://github.com/v8/v8/wiki/Building%20with%20GN。
在tools/dev/v8gen.py x64.release步骤之后,请执行以下操作:
$ nano out.gn/x64.release/args.gn应该是这样的:
is_debug = false
target_cpu = "x64"
is_component_build = true
v8_enable_i18n_support = false此时,我不知道如何正确构建i18n支持。
不确定这是否真的是必需的,但我也用:"v8_enable_i18n_support":false更新了。
编译(大约需要45分钟):
$ ninja -C out.gn/x64.release一经汇编:
$ cp out.gn/x64.release/lib*.so /usr/lib/ && cp -R include/* /usr/include
$ cp out.gn/x64.release/natives_blob.bin /usr/lib
$ cp out.gn/x64.release/snapshot_blob.bin /usr/lib
$ cd out.gn/x64.release/obj
$ ar rcsDT libv8_libplatform.a v8_libplatform/*.o
$ echo -e "create /usr/lib/libv8_libplatform.a\naddlib /usr/local/src/v8/out.gn/x64.release/obj/libv8_libplatform.a\nsave\nend" | sudo ar -M在此之后,请签出v8js并像往常一样编译:
phpize
./configure
make && make install发布于 2019-06-01 04:33:22
创建/usr/lib/lib 8_libplatform.a\naddlib /usr/local/src/v8/out.gn/x64.release/obj/libv8_libplatform.a\nsave\nend“sudo ar -M
打印:/usr/local/src/v8/out.gn/x64.release/obj/libv8_libplatform.a:没有这样的文件或目录
https://stackoverflow.com/questions/40091987
复制相似问题