简体   繁体   English

如何在 Windows 下构建 SpiderMonkey?

[英]How to build SpiderMonkey under Windows?

I try to build SpiderMonkey under Windows.我尝试在 Windows 下构建 SpiderMonkey。 I follow the documentation under https://wiki.mozilla.org/JavaScript:New_to_SpiderMonkey我遵循https://wiki.mozilla.org/JavaScript:New_to_SpiderMonkey下的文档

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

Differently I use the current VS 15.9.11 instead the old 15.8.不同的是,我使用当前的 VS 15.9.11 而不是旧的 15.8。

If I try to call configure inside the Mozilla build shell then it can't find the c compiler:如果我尝试在 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

Where is the Mozilla build shell searching for the C compiler? Mozilla 构建 shell 在哪里搜索 C 编译器? What can be the cause of the problem?问题的原因是什么? Which of the 3 possible C compiler is coming from VS? 3 种可能的 C 编译器中的哪一种来自 VS?

I (finaly) got it to build.我(最终)得到了它的构建。 It took me days.我花了几天时间。

I used these instructions in addition to mozillas spidermonkey documentation.除了 mozillas spidermonkey 文档之外,我还使用了这些说明。

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

I will list a few important things to remember.我将列出一些需要记住的重要事项。

  • Launch x86 Native Tools Command Prompt for VS2017 x86 Native Tools Command Prompt for VS2017启动x86 Native Tools Command Prompt for VS2017
  • in VS2017 cmd prompt set MOZ_NO_RESET_PATH=1在 VS2017 cmd 提示中set MOZ_NO_RESET_PATH=1
  • in VS2017 cmd prompt launch minGW mozilla-build/start-shell.bat在 VS2017 cmd 提示符下启动 minGW mozilla-build/start-shell.bat
  • Download legacy Autconf and compile it http://www.linuxfromscratch.org/blfs/view/cvs/general/autoconf213.html下载旧版 Autconf 并编译它http://www.linuxfromscratch.org/blfs/view/cvs/general/autoconf213.html
  • clone esr60 branch code.克隆 esr60 分支代码。 I tried latest code , I tried latest released code, but it had to this branch until it compiled.我尝试了最新的代码,我尝试了最新发布的代码,但它必须到这个分支才能编译。

So emphasis no those points and these linked instructions may work.所以强调没有这些要点,这些链接的说明可能会起作用。

Instructions from the answer above were moved to a new location https://theqwertiest.github.io/foo_spider_monkey_panel/docs/for_developers/building_spidermonkey以上答案中的说明已移至新位置https://theqwertiest.github.io/foo_spider_monkey_panel/docs/for_developers/building_spidermonkey

PS: esr68 branch (as well as master branch) has a slightly different build procedure and requires additional patching to be compatible with MSVC. PS:esr68 分支(以及 master 分支)的构建过程略有不同,需要额外的补丁才能与 MSVC 兼容。 The linked instructions will be updated once I start using the corresponding branch.一旦我开始使用相应的分支,链接的指令就会更新。

PPS: I had to post an answer instead of comment due to the lack of rep. PPS:由于缺少代表,我不得不发布答案而不是发表评论。

PPPS: Never expected anyone to actually use this guide =) PPPS:从没想过有人会实际使用本指南 =)

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

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