From 83107852a19cc11c66d85ccc0b69f85b5e66906e Mon Sep 17 00:00:00 2001
From: Vijay Kiran Kamuju <infyquest@gmail.com>
Date: Sun, 9 Oct 2011 13:13:40 +0200
Subject: [PATCH] add with-system-mozjs185 parameter to build system, to build
with libmozjs185 (it comes with js-devel). This is
currently only for linux.
---
build/premake/extern_libs4.lua | 37 ++++++++++++++++++++++----------
build/premake/premake4.lua | 1 +
build/workspaces/update-workspaces.sh | 6 ++++-
3 files changed, 31 insertions(+), 13 deletions(-)
diff --git a/build/premake/extern_libs4.lua b/build/premake/extern_libs4.lua
index 99b4b25..e034ba5 100644
a
|
b
|
extern_lib_defs = {
|
470 | 470 | compile_settings = function() |
471 | 471 | if os.is("windows") then |
472 | 472 | include_dir = "include-win32" |
| 473 | configuration "Debug" |
| 474 | includedirs { libraries_dir.."spidermonkey/"..include_dir } |
| 475 | configuration "Release" |
| 476 | includedirs { libraries_dir.."spidermonkey/"..include_dir } |
| 477 | configuration { } |
473 | 478 | else |
474 | | include_dir = "include-unix" |
| 479 | if _OPTIONS["with-system-mozjs185"] then |
| 480 | pkgconfig_cflags("mozjs185") |
| 481 | else |
| 482 | include_dir = "include-unix" |
| 483 | configuration "Debug" |
| 484 | includedirs { libraries_dir.."spidermonkey/"..include_dir } |
| 485 | configuration "Release" |
| 486 | includedirs { libraries_dir.."spidermonkey/"..include_dir } |
| 487 | configuration { } |
| 488 | end |
475 | 489 | end |
476 | | configuration "Debug" |
477 | | includedirs { libraries_dir.."spidermonkey/"..include_dir } |
478 | | configuration "Release" |
479 | | includedirs { libraries_dir.."spidermonkey/"..include_dir } |
480 | | configuration { } |
481 | 490 | end, |
482 | 491 | link_settings = function() |
483 | | configuration "Debug" |
484 | | links { "mozjs185-ps-debug" } |
485 | | configuration "Release" |
486 | | links { "mozjs185-ps-release" } |
487 | | configuration { } |
488 | | add_default_lib_paths("spidermonkey") |
| 492 | if _OPTIONS["with-system-mozjs185"] then |
| 493 | pkgconfig_libs("mozjs185") |
| 494 | else |
| 495 | configuration "Debug" |
| 496 | links { "mozjs185-ps-debug" } |
| 497 | configuration "Release" |
| 498 | links { "mozjs185-ps-release" } |
| 499 | configuration { } |
| 500 | add_default_lib_paths("spidermonkey") |
| 501 | end |
489 | 502 | end, |
490 | 503 | }, |
491 | 504 | valgrind = { |
diff --git a/build/premake/premake4.lua b/build/premake/premake4.lua
index 7b464f6..b1bc2c0 100644
a
|
b
|
newoption { trigger = "without-tests", description = "Disable generation of test
|
8 | 8 | newoption { trigger = "without-pch", description = "Disable generation and usage of precompiled headers" } |
9 | 9 | newoption { trigger = "with-system-nvtt", description = "Search standard paths for nvidia-texture-tools library, instead of using bundled copy" } |
10 | 10 | newoption { trigger = "with-system-enet", description = "Search standard paths for libenet, instead of using bundled copy" } |
| 11 | newoption { trigger = "with-system-mozjs185", description = "Search standard paths for libmozjs185, instead of using bundled copy" } |
11 | 12 | newoption { trigger = "bindir", description = "Directory for executables (typically '/usr/games'); default is to be relocatable" } |
12 | 13 | newoption { trigger = "datadir", description = "Directory for data files (typically '/usr/share/games/0ad'); default is ../data/ relative to executable" } |
13 | 14 | newoption { trigger = "libdir", description = "Directory for libraries (typically '/usr/lib/games/0ad'); default is ./ relative to executable" } |
diff --git a/build/workspaces/update-workspaces.sh b/build/workspaces/update-workspaces.sh
index 95e6644..7661c72 100755
a
|
b
|
premake_args=""
|
14 | 14 | |
15 | 15 | with_system_nvtt=false |
16 | 16 | with_system_enet=false |
| 17 | with_system_mozjs185=false |
17 | 18 | enable_atlas=true |
18 | 19 | |
19 | 20 | for i in "$@" |
… |
… |
do
|
21 | 22 | case $i in |
22 | 23 | --with-system-nvtt ) with_system_nvtt=true; premake_args="${premake_args} --with-system-nvtt" ;; |
23 | 24 | --with-system-enet ) with_system_enet=true; premake_args="${premake_args} --with-system-enet" ;; |
| 25 | --with-system-mozjs185 ) with_system_mozjs185=true; premake_args="${premake_args} --with-system-mozjs185" ;; |
24 | 26 | --enable-atlas ) enable_atlas=true ;; |
25 | 27 | --disable-atlas ) enable_atlas=false ;; |
26 | 28 | -j* ) JOBS=$i ;; |
… |
… |
echo
|
44 | 46 | # Build/update bundled external libraries |
45 | 47 | (cd ../../libraries/fcollada/src && make ${JOBS}) || die "FCollada build failed" |
46 | 48 | echo |
47 | | (cd ../../libraries/spidermonkey && JOBS=${JOBS} ./build.sh) || die "SpiderMonkey build failed" |
| 49 | if [ "$with_system_mozjs185" = "false" ]; then |
| 50 | (cd ../../libraries/spidermonkey && JOBS=${JOBS} ./build.sh) || die "SpiderMonkey build failed" |
| 51 | fi |
48 | 52 | echo |
49 | 53 | if [ "$with_system_nvtt" = "false" ]; then |
50 | 54 | (cd ../../libraries/nvtt && JOBS=${JOBS} ./build.sh) || die "NVTT build failed" |