Ticket #990: 0001-add-with-system-mozjs185-parameter-to-build-system-t.patch

File 0001-add-with-system-mozjs185-parameter-to-build-system-t.patch, 4.7 KB (added by infyquest, 13 years ago)
  • build/premake/extern_libs4.lua

    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 = {  
    470470        compile_settings = function()
    471471            if os.is("windows") then
    472472                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 { }
    473478            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
    475489            end
    476             configuration "Debug"
    477                 includedirs { libraries_dir.."spidermonkey/"..include_dir }
    478             configuration "Release"
    479                 includedirs { libraries_dir.."spidermonkey/"..include_dir }
    480             configuration { }
    481490        end,
    482491        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
    489502        end,
    490503    },
    491504    valgrind = {
  • build/premake/premake4.lua

    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  
    88newoption { trigger = "without-pch", description = "Disable generation and usage of precompiled headers" }
    99newoption { trigger = "with-system-nvtt", description = "Search standard paths for nvidia-texture-tools library, instead of using bundled copy" }
    1010newoption { trigger = "with-system-enet", description = "Search standard paths for libenet, instead of using bundled copy" }
     11newoption { trigger = "with-system-mozjs185", description = "Search standard paths for libmozjs185, instead of using bundled copy" }
    1112newoption { trigger = "bindir", description = "Directory for executables (typically '/usr/games'); default is to be relocatable" }
    1213newoption { trigger = "datadir", description = "Directory for data files (typically '/usr/share/games/0ad'); default is ../data/ relative to executable" }
    1314newoption { trigger = "libdir", description = "Directory for libraries (typically '/usr/lib/games/0ad'); default is ./ relative to executable" }
  • build/workspaces/update-workspaces.sh

    diff --git a/build/workspaces/update-workspaces.sh b/build/workspaces/update-workspaces.sh
    index 95e6644..7661c72 100755
    a b premake_args=""  
    1414
    1515with_system_nvtt=false
    1616with_system_enet=false
     17with_system_mozjs185=false
    1718enable_atlas=true
    1819
    1920for i in "$@"
    do  
    2122  case $i in
    2223    --with-system-nvtt ) with_system_nvtt=true; premake_args="${premake_args} --with-system-nvtt" ;;
    2324    --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" ;;
    2426    --enable-atlas ) enable_atlas=true ;;
    2527    --disable-atlas ) enable_atlas=false ;;
    2628    -j* ) JOBS=$i ;;
    echo  
    4446# Build/update bundled external libraries
    4547(cd ../../libraries/fcollada/src && make ${JOBS}) || die "FCollada build failed"
    4648echo
    47 (cd ../../libraries/spidermonkey && JOBS=${JOBS} ./build.sh) || die "SpiderMonkey build failed"
     49if [ "$with_system_mozjs185" = "false" ]; then
     50  (cd ../../libraries/spidermonkey && JOBS=${JOBS} ./build.sh) || die "SpiderMonkey build failed"
     51fi
    4852echo
    4953if [ "$with_system_nvtt" = "false" ]; then
    5054  (cd ../../libraries/nvtt && JOBS=${JOBS} ./build.sh) || die "NVTT build failed"