Skip to content

Commit

Permalink
Improved documentation and build script style fix.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Yves-G committed Mar 27, 2014
1 parent 9605909 commit 7ce9967
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 13 deletions.
53 changes: 47 additions & 6 deletions 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

Expand All @@ -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.


10 changes: 3 additions & 7 deletions libraries/source/spidermonkey/build.sh
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7ce9967

Please sign in to comment.