50-libvpx.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/bin/bash
  2. SCRIPT_REPO="https://chromium.googlesource.com/webm/libvpx"
  3. SCRIPT_COMMIT="6f0c446c7b88d384a1c09caf33ec132e7ee24aea"
  4. ffbuild_enabled() {
  5. [[ $TARGET == winarm64 ]] && return -1
  6. return 0
  7. }
  8. ffbuild_dockerbuild() {
  9. local myconf=(
  10. --disable-shared
  11. --enable-static
  12. --enable-pic
  13. --disable-examples
  14. --disable-tools
  15. --disable-docs
  16. --disable-unit-tests
  17. --enable-vp9-highbitdepth
  18. --prefix="$FFBUILD_PREFIX"
  19. )
  20. if [[ $TARGET == win64 ]]; then
  21. myconf+=(
  22. --target=x86_64-win64-gcc
  23. )
  24. export CROSS="$FFBUILD_CROSS_PREFIX"
  25. elif [[ $TARGET == win32 ]]; then
  26. myconf+=(
  27. --target=x86-win32-gcc
  28. )
  29. export CROSS="$FFBUILD_CROSS_PREFIX"
  30. elif [[ $TARGET == winarm64 ]]; then
  31. myconf+=(
  32. --target=arm64-win64-gcc
  33. )
  34. export CROSS="$FFBUILD_CROSS_PREFIX"
  35. elif [[ $TARGET == linux64 ]]; then
  36. myconf+=(
  37. --target=x86_64-linux-gcc
  38. )
  39. export CROSS="$FFBUILD_CROSS_PREFIX"
  40. elif [[ $TARGET == linuxarm64 ]]; then
  41. myconf+=(
  42. --target=arm64-linux-gcc
  43. )
  44. export CROSS="$FFBUILD_CROSS_PREFIX"
  45. else
  46. echo "Unknown target"
  47. return -1
  48. fi
  49. ./configure "${myconf[@]}"
  50. make -j$(nproc)
  51. make install
  52. # Work around strip breaking LTO symbol index
  53. "$RANLIB" "$FFBUILD_PREFIX"/lib/libvpx.a
  54. }
  55. ffbuild_configure() {
  56. echo --enable-libvpx
  57. }
  58. ffbuild_unconfigure() {
  59. echo --disable-libvpx
  60. }