From 7ce99678c2c4e65407a2928effef32b2c1758508 Mon Sep 17 00:00:00 2001 From: Yves Date: Thu, 27 Mar 2014 14:37:03 +0100 Subject: [PATCH] Improved documentation and build script style fix. Adds more detailed documentation how to build on Windows. Fixes incorrect information how to build on Mac OS X. Removes the special section for BSD suffixes from build.sh because the suffixes are currently the same. If we figure out it needs different suffixes, we can add that again with the correct suffixes. --- libraries/source/spidermonkey/README.txt | 53 +++++++++++++++++++++--- libraries/source/spidermonkey/build.sh | 10 ++--- 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/libraries/source/spidermonkey/README.txt b/libraries/source/spidermonkey/README.txt index 1683afdd693..68046f1d191 100644 --- a/libraries/source/spidermonkey/README.txt +++ b/libraries/source/spidermonkey/README.txt @@ -1,9 +1,5 @@ -To build SpiderMonkey for use in 0 A.D. on Linux or OS X, run ./build.sh - -To build on Windows (if you don't want to use the precompiled binaries in SVN), -get https://developer.mozilla.org/en/Windows_Build_Prerequisites#MozillaBuild -then run start-msvc8.bat and run ./build.sh here. - +Important notice: +----------------- This version of SpiderMonkey comes from https://ftp.mozilla.org/pub/mozilla.org/js/mozjs-24.2.0.tar.bz2 @@ -13,3 +9,48 @@ cause subtle bugs or network out-of-sync errors. A standard system-provided version of the library may only be used if it's exactly the same version or if it's another minor release that does not change the behaviour of the scripts executed by SpiderMonkey. + + +Building on Linux: +------------------ +To build SpiderMonkey for use in 0 A.D. on Linux, you need libnspr4-dev, which +should be installed from the distribution's package management system. +As an alternative you can build nspr yourself, but we don't provide a guide for +that here. When you have nspr, just run build.sh. + +NSPR ist available here: +https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/ + + +Building on Mac OS X: +--------------------- +Use the build-osx-libs.sh script in libraries/osx. + + +Building on Windows: +-------------------- +We provide precompiled binaries for Windows. +If you still need to build on Windows, here's a short guide. + +Setting up the build environment: +1. Get https://developer.mozilla.org/en/Windows_Build_Prerequisites#MozillaBuild +2. I had to adjust some paths to the correct SDK folders in start-msvc10.bat. + That depends a lot on your setup and the version of mozilla build, so you have + to figure out yourself how to get it working. + +Building NSPR: +1. Get nspr. We are using nspr-4.10.3 which is the newest version at the moment. + Newer versions should probably work too. + Download link: https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/ +2. Run mozillabuild (start-msvc10.bat) as administrator +3. Extract nspr to libraries/source/spidermonkey + tar -xzvf nspr-4.10.3.tar.gz + cd nspr-4.10.3 + cd nspr +4. Build nspr by calling make + +Building SpiderMonkey: +1. Adjust the absolute paths to nspr in the build.sh file to match your environment. +2. Run mozillabuild (start-msvc10.bat) as administrator and run ./build.sh. + + diff --git a/libraries/source/spidermonkey/build.sh b/libraries/source/spidermonkey/build.sh index 64df8ab8e38..c364751ce41 100755 --- a/libraries/source/spidermonkey/build.sh +++ b/libraries/source/spidermonkey/build.sh @@ -21,6 +21,9 @@ MAKE=${MAKE:="make"} MAKE_OPTS="${JOBS}" +# We bundle prebuilt binaries for Windows and the .libs for nspr aren't included. +# If you want to build on Windows, check README.txt and edit the absolute paths +# to match your enviroment. if [ "${OS}" = "Windows_NT" ] then NSPR_INCLUDES="-IC:/Projects/0ad/libraries/source/spidermonkey/nspr-4.10.3/nspr/dist/include/nspr" @@ -100,13 +103,6 @@ else LIB_PREFIX=lib LIB_SRC_SUFFIX=.so LIB_DST_SUFFIX=.so - # Fix suffix issue on OpenBSD - if [ "`uname -s`" = "OpenBSD" ] - then - DLL_SRC_SUFFIX=.so - LIB_SRC_SUFFIX=.so - LIB_DST_SUFFIX=.so - fi fi # Copy files into the necessary locations for building and running the game