2012年5月11日 星期五

Build SpiderMonkey on Windows


SpiderMonkey is Mozilla's JavaScript engine written in C/C++. It is used in various Mozilla products, including Firefox, and is available under MPL/GPL/LGPL tri-license.

https://developer.mozilla.org/en/Building_only_SpiderMonkey


Requirement:
     Visual Studio 2008

  1. Download SpiderMonkey v1.8.5 after and unzip it https://developer.mozilla.org/En/SpiderMonkey/Getting_SpiderMonkey_source_code#Getting_the_latest_SpiderMonkey_source_code
  2. Download and install MozillaBuild.exe https://wiki.mozilla.org/MozillaBuild
  3. Download NSPR and unzip http://www.mozilla.org/projects/nspr/
  4. Open Visual Studio 2008 Command Line 
  5. Enter MozillaBuild folder, type start-msvc9.bat
  6. Compile NSPR
    cd c:/nspr-4.8.9
    mkdir Debug
    cd Debug
    ../mozilla/nsprpub/configure --enable-win32-target=WIN95    (  WIN95 means Win32 not Windows 95)
    make
  7. Compile SpiderMonkey
    cd /c/js-1.8.5/js/src
    autoconf-2.13
    mkdir Release
    cd Release
    ../configure --enable-win32-target=WIN95         (*)

    cd ..
    mkdir Debug
    cd Debug
    ../configure --enable-win32-target=WIN95 --enable-debug --disable-optimize    (*)
    make
  8. Test js
    At Release or Debug folder, type
    ./js ../Y.js
    5! is 120



(*)1.8.5 default OS version is Win7. If you use WinXP, you should set the version to  --with-windows-version=600

1.8.7 just support later than Win7 version...

http://wenku.baidu.com/view/3a0980dbce2f0066f533220b.html

沒有留言:

張貼留言