【问题标题】:building mozilla NSPR using MinGw on windows without VC++在没有 VC++ 的 Windows 上使用 MinGw 构建 mozilla NSPR
【发布时间】:2011-03-23 14:52:03
【问题描述】:

我需要为我的 perl javascript 引擎使用 spidermonkey。为此,我需要使用线程安全库构建 spidermonkey。因此,据我所知,我需要先构建 NSPR,然后再构建 spidermonkey。

所以,正如我从以下链接中了解到的那样 https://developer.mozilla.org/en/NSPR_build_instructions

我首先下载了 mozilla-build 并打开了 mingw。我按照上面提到的说明进行操作,比如创建 target.debug 目录等等.....

当我做 make 时,我收到以下错误消息

make[3]: nsinstall: Command not found
make[3]: *** [export] Error 127
make[3]: Leaving directory `/c/target.debug/pr/include/md'
make[2]: *** [export] Error 2
make[2]: Leaving directory `/c/target.debug/pr/include'
make[1]: *** [export] Error 2
make[1]: Leaving directory `/c/target.debug/pr'
make: *** [export] Error 2

看起来 nsinstall 不见了。

我不是 C/C++ 的专业程序员,因此寻求您的帮助。

我需要使用 Mingw 在窗口上成功构建蜘蛛猴。

我尝试按照以下链接中提到的步骤进行操作: http://jargon.ca/spidermonkey/

但是当我运行 js.exe 时,它​​抱怨缺少 libnspr4.dll 文件。

所以请帮助我如何在 Windows 操作系统上构建 nspr 和 spidermonkey。

【问题讨论】:

标签: javascript perl mingw spidermonkey nspr


【解决方案1】:

您可以从 mozilla 获取 nsinstall 的副本。

  • 下载moztools-static.zip并解压。
  • 将 moztools-static/moztools/bin/nsinstall.exe 复制到 /mingw/bin。

【讨论】:

    【解决方案2】:

    在 Windows 上没有直接的方法。你有两个选择来做到这一点。请遵循以下说明:

    1. Compiming Mozilla with MinGW
    2. 或者满足Windows pre-requisities页面上提到的先决条件并开始编译。

    我没有亲自尝试过第一个选项,但对于第二个选项,您需要 Microsoft Visual Studio 才能使用。再说一次,如果您只需要 NSPR 4,为什么不从 Firefox 安装目录中提取这些文件呢?我猜这些 DLL 的名称类似于 nspr4.dll、plc4.dll 和 plds4.dll。

    【讨论】:

    • 忘了说:编译nspr4的时候,我觉得调用../configure脚本的时候需要说一下windows平台。指定 win95 而不是默认生成 libnspr4.dll 的 Winnt。阅读其帮助以获取更多信息。要让 js.exe 开始工作,nspr4.dll/libnspr4.dll 应该与 js.exe 位于同一目录中或位于 %PATH% 中。
    • 我的 Firefox 27.0.1 安装不包含 nspr4.dll。但是它包含 nss3.dll。用-lnss3 代替-lnspr4 链接似乎效果很好。
    • Thunderbird 版本包含 nspr4.dll 文件。
    【解决方案3】:

    您可以通过以下方式使用 cygwin 构建nsinstall

    mkdir cygwinbuild
    ../configure --host=i386-pc-linux-gnu
    cd config
    make nsinstall
    

    然后使用 mingw (--enable-win32-target=WIN95) 构建几乎成功。我必须解决以下问题:

    (1) pr/include/md/_win95.h

    // these should be defined in winbase.h, but in my mingw
    // they are not
    #ifndef STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000
      #define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000
    #endif
    #ifndef CRITICAL_SECTION_NO_DEBUG_INFO
      #define CRITICAL_SECTION_NO_DEBUG_INFO  0x01000000
    #endif
    

    (2) pr/include/pratom.h,第 80 行

    // my mingw cannot link InterlockedIncrement, probably there's a better
    // option than turning this off
    #if 0 && defined(_WIN32) && !defined(_WIN32_WCE) && \
    

    (3) 如果要运行测试,第 1 点的技巧也应该适用于测试 attach、foreign、testfile。

    某些测试使用我的构建失败:cvar、gethost、op_2long、parent、reinit、selct_nm、socket、sockopt、writev。其余的都成功了。

    【讨论】:

      猜你喜欢
      • 2012-01-30
      • 1970-01-01
      • 2021-11-15
      • 2023-03-19
      • 1970-01-01
      • 2017-06-22
      • 1970-01-01
      • 2013-06-13
      • 1970-01-01
      相关资源
      最近更新 更多