繁体   English   中英

如何在 Windows 下构建 SpiderMonkey?

[英]How to build SpiderMonkey under Windows?

我尝试在 Windows 下构建 SpiderMonkey。 我遵循https://wiki.mozilla.org/JavaScript:New_to_SpiderMonkey下的文档

我已经从https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites安装了先决条件

不同的是,我使用当前的 VS 15.9.11 而不是旧的 15.8。

如果我尝试在 Mozilla 构建 shell 中调用configure ,那么它找不到 c 编译器:

Winuser@Winuser /c/workspace-cpp/spidermonkey/js/src/build_DBG.OBJ
$ ../configure --enable-debug --disable-optimize
Reexecuting in the virtualenv
checking for vcs source checkout... hg
checking for a shell... C:/mozilla-build/msys/bin/sh.exe
checking for host system type... x86_64-pc-mingw32
checking for target system type... x86_64-pc-mingw32
checking for Python 3... C:/mozilla-build//python3/python3.exe (3.6.5)
checking for hg... c:/mozilla-build/python/Scripts/hg.exe
checking for Mercurial version... 4.5.3
checking for sparse checkout... no
checking whether cross compiling... no
checking for yasm... c:/mozilla-build/bin/yasm.exe
checking yasm version... 1.3.0
checking for the target C compiler... not found
DEBUG: _cc: Trying clang-cl
DEBUG: _cc: Trying gcc
DEBUG: _cc: Trying clang
ERROR: Cannot find the target C compiler

Mozilla 构建 shell 在哪里搜索 C 编译器? 问题的原因是什么? 3 种可能的 C 编译器中的哪一种来自 VS?

我(最终)得到了它的构建。 我花了几天时间。

除了 mozillas spidermonkey 文档之外,我还使用了这些说明。

https://github.com/TheQwertiest/foo_spider_monkey_panel/wiki/Building-SpiderMonkey

我将列出一些需要记住的重要事项。

  • x86 Native Tools Command Prompt for VS2017启动x86 Native Tools Command Prompt for VS2017
  • 在 VS2017 cmd 提示中set MOZ_NO_RESET_PATH=1
  • 在 VS2017 cmd 提示符下启动 minGW mozilla-build/start-shell.bat
  • 下载旧版 Autconf 并编译它http://www.linuxfromscratch.org/blfs/view/cvs/general/autoconf213.html
  • 克隆 esr60 分支代码。 我尝试了最新的代码,我尝试了最新发布的代码,但它必须到这个分支才能编译。

所以强调没有这些要点,这些链接的说明可能会起作用。

以上答案中的说明已移至新位置https://theqwertiest.github.io/foo_spider_monkey_panel/docs/for_developers/building_spidermonkey

PS:esr68 分支(以及 master 分支)的构建过程略有不同,需要额外的补丁才能与 MSVC 兼容。 一旦我开始使用相应的分支,链接的指令就会更新。

PPS:由于缺少代表,我不得不发布答案而不是发表评论。

PPPS:从没想过有人会实际使用本指南 =)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM