【问题标题】:How to build SpiderMonkey under Windows?如何在 Windows 下构建 SpiderMonkey?
【发布时间】:2019-09-24 06:32:48
【问题描述】:

我尝试在 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?

【问题讨论】:

    标签: windows visual-studio build spidermonkey


    【解决方案1】:

    我(最终)完成了它。我花了几天时间。

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

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

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

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

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

    【讨论】:

    • 谢谢!我还遇到了一个相关的问题,即 mozilla-build shell 正在清除 LIB 和 INCLUDE 环境变量。从 start-shell.bat 文件中删除 "SET INCLUDE=" 和 "SET LIB=" 行为我解决了这个问题。
    【解决方案2】:

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

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

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

    PPPS:没想到会有人真正使用本指南 =)

    【讨论】:

      猜你喜欢
      • 2020-03-10
      • 1970-01-01
      • 1970-01-01
      • 2020-05-29
      • 2017-01-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-25
      相关资源
      最近更新 更多