您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

84 行
3.5KB

  1. #!/bin/bash
  2. set -ex
  3. # I guess now we have to install ninja ourselves.. sigh..
  4. git clone https://github.com/ninja-build/ninja.git
  5. pushd ninja
  6. git checkout v1.11.1
  7. cmake -Bbuild-cmake
  8. cmake --build build-cmake
  9. export PATH=`pwd`/build-cmake:"$PATH" # ninja available now
  10. popd
  11. export PATH=`pwd`/depot_tools:"$PATH" # depot tools available now (used to include ninja)
  12. # https://github.com/prahladyeri/tuxdrive/issues/3
  13. apt-get install python3-pip -y
  14. pip3 install httplib2 --upgrade
  15. fetch v8
  16. cd v8 # if this fails, exit! hence the set -ex
  17. #gclient sync -r 6.9.427.6 # 55da769bafac8b531cd8b388df56161b8b7c6416
  18. #gclient sync -r 7.1.69 #
  19. #gclient sync -r lkgr/6.9
  20. #gclient sync -r 6.9.427.13 # https://ci.appveyor.com/project/pmed/v8pp
  21. #gclient sync -r 7.5.288.23 # https://github.com/pmed/v8-nuget/
  22. #gclient sync -r 8.0.426.15 # stupid test
  23. #gclient sync -r 7.2.1 # stupid test
  24. #gclient sync -r 8.2.297.1 # https://github.com/pmed/v8-nuget/
  25. #gclient sync -r 9.3.345.3 # https://github.com/pmed/v8-nuget/
  26. #gclient sync -r 10.0.139.9 # https://github.com/pmed/v8-nuget/
  27. gclient sync -r 11.9.169.4 # https://github.com/pmed/v8-nuget/
  28. # Looks like we have to use GN now: https://github.com/v8/v8/wiki/Building-with-GN
  29. # initial build
  30. # temp
  31. #rm -rf out/x64.release
  32. ./tools/dev/gm.py x64.release
  33. # we don't want std::_Cr, but std::__1 like everybody else is using
  34. # note that this is only relevant if use_custom_libcxx = true.
  35. # unfortunately I don't know how to specify v8 to use libc++ from the system
  36. # I asked a question about this here: https://groups.google.com/forum/#!topic/v8-users/Do5MvAvYFgs
  37. sed -i.bak 's/_LIBCPP_ABI_VERSION=Cr/_LIBCPP_ABI_VERSION=1/' build/config/c++/BUILD.gn
  38. # https://groups.google.com/g/v8-dev/c/AJjIyKMpFmA
  39. sed -i.bak 's/"-Wctad-maybe-unsupported"//' BUILD.gn
  40. # workaround, see notes.txt
  41. echo "v8_enable_embedded_builtins = false" | tee -a out/x64.release/args.gn
  42. echo "v8_use_external_startup_data = false" | tee -a out/x64.release/args.gn
  43. echo "v8_use_snapshot = false" | tee -a out/x64.release/args.gn
  44. echo "v8_enable_gdbjit = true" | tee -a out/x64.release/args.gn
  45. # set below to true to make it use libc++ (although it will use the one it is bundled with,
  46. # and also it will enable unsafe abi stuff, which means basically alpha features afaik)
  47. echo "use_custom_libcxx = false" | tee -a out/x64.release/args.gn
  48. # possibly they use a different version of clang compiling v8.
  49. # however, I already set my own, probably newer clang version.
  50. # ran into: https://groups.google.com/forum/#!topic/v8-users/Jb1VSouy2Z0
  51. #echo "is_clang = false" | tee -a out/x64.release/args.gn
  52. # setting to true now, and see if we use this clang on starcry if it works..
  53. echo "is_clang = true" | tee -a out/x64.release/args.gn
  54. # the only remaining issue was: undefined reference to `typeinfo for v8::ArrayBuffer::Allocator'
  55. # this is the case with (gnu) libstd++ , only remaining issue for me
  56. # https://github.com/danbev/learning-v8/pull/4
  57. echo "use_rtti = true" | tee -a out/x64.release/args.gn
  58. # produce monolith (single static all in one .a file)
  59. echo "v8_monolithic = true" | tee -a out/x64.release/args.gn
  60. ninja -C out/x64.release v8_monolith
  61. # produce .so files (shared libs)
  62. # temporary disable the .so files (I'm not using them for now, and they are slow to build)
  63. #sed -i.bak '/^v8_monolithic/d' out/x64.release/args.gn
  64. #echo "is_component_build = true" | tee -a out/x64.release/args.gn
  65. #ninja -C out/x64.release