2011-03-23 42 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。其餘的都是成功的。

相關問題