2011-03-23 41 views
2

我需要为我的perl javascript引擎使用spidermonkey。为此,我需要使用线程安全库构建spidermonkey。所以据我所知,我需要先建立NSPR,然后是spidermonkey。使用MinGw在Windows上创建Mozilla NSPR而不使用VC++

所以,我从以下链接 https://developer.mozilla.org/en/NSPR_build_instructions

理解我先下载了Mozilla的构建和打开MinGW的。我也跟着像创建target.debug目录等等.....

当我做制作,我收到以下错误消息

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在窗口上成功构建spidermonkey。

我试图按照步骤在下面的链接中提到: http://jargon.ca/spidermonkey/

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

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

+0

您是否试图按照我的博客http://opensourcepack.blogspot.com/2012/01/spidermonkey-185-mingw.html – 2012-04-02 12:55:00

回答

1

在Windows上没有直接的方法。你有两个选择来做到这一点。无论是按照说明上:

  1. Compiming Mozilla with MinGW
  2. 或满足于Windows pre-requisities页提到的预requisities并开始编制。

我还没有亲自尝试的第一个选项,但对于第二个选项,你需要微软的Visual Studio的工作。再说一遍,如果你只需要NSPR 4,你为什么不从Firefox安装directoy中提取这些文件呢?我猜这些DLL被命名为nspr4.dll,plc4.dll和plds4.dll。

+0

中的说明忘记提及:当您编译nspr4时,我认为您需要说Windows平台在调用../configure脚本时。指定win95而不是Winnt,它是生成libnspr4.dll的默认值。阅读帮助以获取更多信息。为使js.exe开始工作,nspr4.dll/libnspr4.dll应与js.exe位于同一目录中,或者位于%PATH%中。 – 2011-04-11 05:21:40

+0

我的Firefox 27.0.1安装不包含nspr4.dll。但是它包含nss3.dll。用'-lnss3'代替'-lnspr4'连接似乎很好。 – Jarekczek 2014-03-12 09:56:52

+0

Thunderbird版本包含'nspr4.dll'文件。 – Jarekczek 2014-03-12 12:25:37

3

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

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

您可以使用Cygwin下面的方式建立nsinstall

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

然后用MinGW的大楼(--enable-win32-target=WIN95)几乎成功。我不得不修正以下东西:

(1)PR /包括/ 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 /包含/ 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的伎俩也应适用于测试连接,国外,testfile的。

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

相关问题