init.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/bin/bash
  2. # Unfinished
  3. source "bin/init/env.sh"
  4. CURR="plugin/trojan"
  5. CURR_PATH="$PROJECT/$CURR"
  6. # git submodule update --init "$CURR/*"
  7. BUILD_DIR=$CURR_PATH/build
  8. cd $BUILD_DIR
  9. if [ ! -d boost ]; then
  10. curl -Lo boost_1_76_0.tar.gz https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz
  11. tar -xvf boost_1_76_0.tar.gz
  12. mv boost_1_76_0 boost
  13. fi
  14. cd boost
  15. export CXXFLAGS+=" -std=c++14"
  16. export CC=$ANDROID_ARM_CC_21
  17. export CXX=$ANDROID_ARM_CXX_21
  18. echo "using clang : arm : $ANDROID_ARM_CXX_21 ; " >project-config.jam
  19. echo "using clang : arm64 : $ANDROID_ARM64_CXX ; " >>project-config.jam
  20. echo "using clang : x86 : $ANDROID_X86_CXX_21 ; " >>project-config.jam
  21. echo "using clang : x64 : $ANDROID_X86_64_CXX ; " >>project-config.jam
  22. rm -rf bin.v2
  23. ./b2 \
  24. --prefix="$BUILD_DIR/armeabi-v7a" \
  25. --with-system \
  26. --with-program_options \
  27. toolset=clang-arm \
  28. architecture=arm \
  29. variant=release \
  30. --layout=versioned \
  31. target-os=android \
  32. threading=multi \
  33. threadapi=pthread \
  34. cxxflags="-std=c++14" \
  35. link=static \
  36. runtime-link=static \
  37. install
  38. ./b2 \
  39. --prefix="$BUILD_DIR/arm64-v8a" \
  40. --with-system \
  41. --with-program_options \
  42. toolset=clang-arm64 \
  43. architecture=arm \
  44. address-model=64 \
  45. variant=release \
  46. --layout=versioned \
  47. target-os=android \
  48. threading=multi \
  49. threadapi=pthread \
  50. cxxflags="-std=c++14" \
  51. link=static \
  52. runtime-link=static \
  53. install
  54. ./b2 \
  55. --prefix="$BUILD_DIR/x86" \
  56. --with-system \
  57. --with-program_options \
  58. toolset=clang-x86 \
  59. architecture=x86 \
  60. variant=release \
  61. --layout=versioned \
  62. target-os=android \
  63. threading=multi \
  64. threadapi=pthread \
  65. cxxflags="-std=c++14" \
  66. link=static \
  67. runtime-link=static \
  68. install
  69. ./b2 \
  70. --prefix="$BUILD_DIR/x86_64" \
  71. --with-system \
  72. --with-program_options \
  73. toolset=clang-x64 \
  74. architecture=x86 \
  75. address-model=64 \
  76. variant=release \
  77. --layout=versioned \
  78. target-os=android \
  79. threading=multi \
  80. threadapi=pthread \
  81. cxxflags="-std=c++14" \
  82. link=static \
  83. runtime-link=static \
  84. install