Ticket #4893: mozjs52.patch

File mozjs52.patch, 4.6 KB (added by Ludovic Rousseau, 6 years ago)

preliminary patch to build 0ad using system libmozjs-52

  • build/premake/extern_libs4.lua

    Author: Ludovic Rousseau <rousseau@debian.org>
    Subject: build using libmozjs provided by Debian
    Last-Update: 2017-12-07
    
    old new extern_lib_defs = {  
    591591    },
    592592    spidermonkey = {
    593593        compile_settings = function()
    594             if _OPTIONS["with-system-mozjs38"] then
     594            if _OPTIONS["with-system-mozjs52"] then
    595595                if not _OPTIONS["android"] then
    596                     pkgconfig_cflags("mozjs-38")
     596                    pkgconfig_cflags("mozjs-52")
    597597                end
    598598            else
    599599                if os.is("windows") then
    extern_lib_defs = {  
    611611            end
    612612        end,
    613613        link_settings = function()
    614             if _OPTIONS["with-system-mozjs38"] then
     614            if _OPTIONS["with-system-mozjs52"] then
    615615                if _OPTIONS["android"] then
    616                     links { "mozjs-38" }
     616                    links { "mozjs-52" }
    617617                else
    618618                    pkgconfig_libs("nspr")
    619                     pkgconfig_libs("mozjs-38")
     619                    pkgconfig_libs("mozjs-52")
    620620                end
    621621            else
    622622                if os.is("macosx") then
    extern_lib_defs = {  
    624624                    links { "nspr4", "plc4", "plds4" }
    625625                end
    626626                configuration "Debug"
    627                     links { "mozjs38-ps-debug" }
     627                    links { "mozjs52-ps-debug" }
    628628                configuration "Release"
    629                     links { "mozjs38-ps-release" }
     629                    links { "mozjs52-ps-release" }
    630630                configuration { }
    631631                add_source_lib_paths("spidermonkey")
    632632            end
  • build/workspaces/update-workspaces.sh

    old new premake_args=""  
    3535
    3636without_nvtt=false
    3737with_system_nvtt=false
    38 with_system_mozjs38=false
     38with_system_mozjs52=false
    3939enable_atlas=true
    4040
    4141for i in "$@"
    do  
    4343  case $i in
    4444    --without-nvtt ) without_nvtt=true; premake_args="${premake_args} --without-nvtt" ;;
    4545    --with-system-nvtt ) with_system_nvtt=true; premake_args="${premake_args} --with-system-nvtt" ;;
    46     --with-system-mozjs38 ) with_system_mozjs38=true; premake_args="${premake_args} --with-system-mozjs38" ;;
     46    --with-system-mozjs52 ) with_system_mozjs52=true; premake_args="${premake_args} --with-system-mozjs52" ;;
    4747    --enable-atlas ) enable_atlas=true ;;
    4848    --disable-atlas ) enable_atlas=false ;;
    4949    -j* ) JOBS=$i ;;
    if [ "`uname -s`" != "Darwin" ]; then  
    7878  # Build/update bundled external libraries
    7979  (cd ../../libraries/source/fcollada/src && ${MAKE} ${JOBS}) || die "FCollada build failed"
    8080  echo
    81   if [ "$with_system_mozjs38" = "false" ]; then
     81  if [ "$with_system_mozjs52" = "false" ]; then
    8282    (cd ../../libraries/source/spidermonkey && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "SpiderMonkey build failed"
    8383  fi
    8484  echo
  • build/premake/premake4.lua

    old new newoption { trigger = "icc", description  
    77newoption { trigger = "jenkins-tests", description = "Configure CxxTest to use the XmlPrinter runner which produces Jenkins-compatible output" }
    88newoption { trigger = "minimal-flags", description = "Only set compiler/linker flags that are really needed. Has no effect on Windows builds" }
    99newoption { trigger = "outpath", description = "Location for generated project files" }
    10 newoption { trigger = "with-system-mozjs38", description = "Search standard paths for libmozjs38, instead of using bundled copy" }
     10newoption { trigger = "with-system-mozjs52", description = "Search standard paths for libmozjs52, instead of using bundled copy" }
    1111newoption { trigger = "with-system-nvtt", description = "Search standard paths for nvidia-texture-tools library, instead of using bundled copy" }
    1212newoption { trigger = "without-audio", description = "Disable use of OpenAL/Ogg/Vorbis APIs" }
    1313newoption { trigger = "without-lobby", description = "Disable the use of gloox and the multiplayer lobby" }
  • source/scriptinterface/ScriptTypes.h

    old new  
    7171# pragma GCC diagnostic pop
    7272#endif
    7373
    74 #if MOZJS_MAJOR_VERSION != 38
     74#if MOZJS_MAJOR_VERSION != 52
    7575#error Your compiler is trying to use an incorrect major version of the \
    7676SpiderMonkey library. The only version that works is the one in the \
    7777libraries/spidermonkey/ directory, and it will not work with a typical \