在没有VC ++的Windows上使用MinGw构建mozilla NSPR

时间:2011-03-23 14:52:03

标签: javascript perl mingw spidermonkey nspr

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

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

我首先下载了mozilla-build并打开了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。

3 个答案:

答案 0 :(得分:3)

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

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

答案 1 :(得分:1)

Windows上没有直接的方法。你有两种选择。请按照以下说明进行操作:

  1. Compiming Mozilla with MinGW
  2. 或满足Windows pre-requisities页面上提到的预先填写并开始编译。
  3. 我没有亲自尝试过第一个选项,但是对于第二个选项,您需要使用Microsoft Visual Studio。再说一遍,如果你只需要NSPR 4,为什么不从Firefox安装工具中提取这些文件呢?我猜这些DLL的名称类似于nspr4.dll,plc4.dll和plds4.dll。

答案 2 :(得分:0)

您可以通过以下方式使用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。其余的都是成功的。

相关问题