在 Windows 上使用 MinGw 构建 mozilla NSPR,无需 VC++

发布于 2024-10-25 22:34:58 字数 1043 浏览 2 评论 0原文

我需要为我的 Perl JavaScript 引擎使用 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。

I need to use spidermonkey for my perl javascript engine. For that I need to build spidermonkey with thread-safe libraries. So as I understand I need to first build NSPR and then spidermonkey.

So, as I understood from following link
https://developer.mozilla.org/en/NSPR_build_instructions

I first downloaded the mozilla-build and opened the mingw. I followed the instructions as mentioned like creating target.debug directory and so on .....

when I am doing make, I am getting following error message

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

looks like nsinstall is missing.

I am not a professional programmer in C/C++ so looking for your help.

I need to successfully build the spidermonkey on window using Mingw.

I tried to follow the steps as mentioned in following link:
http://jargon.ca/spidermonkey/

but when I am running the js.exe, it's complaining about missing libnspr4.dll file.

So please help me how can I build nspr and spidermonkey on windows operating system.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

找回味觉 2024-11-01 22:34:58

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

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

You can get a copy of nsinstall from mozilla.

  • Download moztools-static.zip and unzip it.
  • copy moztools-static/moztools/bin/nsinstall.exe to /mingw/bin.
栀梦 2024-11-01 22:34:58

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

  1. 使用 MinGW 编译 Mozilla
  2. 或满足 Windows 先决条件页面并开始编译。

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

There is no straight forward way on Windows. You have two options to do that. Either follow instructions on:

  1. Compiming Mozilla with MinGW
  2. Or satisfy the pre-requisities mentioned on Windows pre-requisities page and start compiling.

I have not personally tried the 1st option, but for second option you will need Microsoft Visual Studio to work with. Then again, if you need just NSPR 4 why don't you pull out those files from your Firefox installation directoy? I guess the DLLs are named something like nspr4.dll, plc4.dll and plds4.dll.

离不开的别离 2024-11-01 22:34:58

您可以按照以下方式使用 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。剩下的就成功了。

You can build nsinstall with cygwin the following way:

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

Then building with mingw (with --enable-win32-target=WIN95) almost succeeds. I had to fix the following things:

(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, line 80

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

(3) If one wants to run the tests, the trick from point 1 should also be applied to tests attach, foreign, testfile.

Some tests fail using my build: cvar, gethost, op_2long, parent, reinit, selct_nm, socket, sockopt, writev. The rest is successful.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文