You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
3.5 KiB

2 years ago
2 years ago
2 years ago
  1. #!/bin/bash
  2. # 全局变量
  3. # Config
  4. CONFIG_SUPPORT_ALSA=true
  5. CONFIG_SUPPORT_FFMPEG=true
  6. CONFIG_SUPPORT_IFLYTOP_VOICE_PROCESS=true
  7. CONFIG_SUPPORT_IXWEBSOCKET=true
  8. # Code Begin
  9. mkdir -p ${LIBSDIR}
  10. cd ${LIBSDIR}
  11. # 下载依赖库
  12. # CONFIG_SUPPORT_ALSA
  13. if [ "$CONFIG_SUPPORT_ALSA" = true ]; then
  14. wget -c "192.168.1.2:8021/sdk_firefly_rk3328_v2.5.1/buildtools/libasound2_dev1.1.3-5ubuntu0.6.tar.gz"
  15. wget -c "192.168.1.2:8021/sdk_firefly_rk3328_v2.5.1/buildtools/libz.tar.gz"
  16. rm -rf ${LIBSDIR}/alsa
  17. rm -rf libasound2_dev1.1.3-5ubuntu0.6
  18. tar -xvf libasound2_dev1.1.3-5ubuntu0.6.tar.gz >/dev/null
  19. tar -xvf libz.tar.gz >/dev/null
  20. mkdir -p ${LIBSDIR}/alsa/pkgconfig/
  21. mkdir -p ${LIBSDIR}/alsa/include/sys/
  22. mkdir -p ${LIBSDIR}/alsa/lib/
  23. mkdir -p ${LIBSDIR}/alsa/include/sys/
  24. mv libasound2_dev1.1.3-5ubuntu0.6/unpack/usr/lib/aarch64-linux-gnu/libasound.* ${LIBSDIR}/alsa/lib/
  25. mv libasound2_dev1.1.3-5ubuntu0.6/unpack/usr/lib/aarch64-linux-gnu/pkgconfig/alsa.pc ${LIBSDIR}/alsa/pkgconfig/
  26. mv libasound2_dev1.1.3-5ubuntu0.6/unpack/usr/include/alsa ${LIBSDIR}/alsa/include/
  27. mv libasound2_dev1.1.3-5ubuntu0.6/unpack/usr/include/sys/* ${LIBSDIR}/alsa/include/sys/
  28. mv libz.so.1 ${LIBSDIR}/alsa/lib/
  29. PUBLIC_LINK_DIRECTORIES="${PUBLIC_LINK_DIRECTORIES};${LIBSDIR}/alsa/lib"
  30. PUBLIC_INCLUDE_DIRECTORIES="${PUBLIC_INCLUDE_DIRECTORIES};${LIBSDIR}/alsa/include"
  31. PUBLIC_LINK_LIBS="${PUBLIC_LINK_LIBS};asound"
  32. fi
  33. # CONFIG_SUPPORT_FFMPEG
  34. if [ "$CONFIG_SUPPORT_FFMPEG" = true ]; then
  35. wget -c "192.168.1.2:8021/sdk_firefly_rk3328_v2.5.1/buildtools/ffmpeg-4.1.10-aarch64-20230301.tar.gz"
  36. rm -rf ${LIBSDIR}/ffmpeg
  37. tar -xvf ffmpeg-4.1.10-aarch64-20230301.tar.gz >/dev/null
  38. mv ffmpeg-4.1.10-aarch64-20230301 ${LIBSDIR}/ffmpeg
  39. PUBLIC_LINK_DIRECTORIES="${PUBLIC_LINK_DIRECTORIES};${LIBSDIR}/ffmpeg/lib"
  40. PUBLIC_INCLUDE_DIRECTORIES="${PUBLIC_INCLUDE_DIRECTORIES};${LIBSDIR}/ffmpeg/include"
  41. PUBLIC_LINK_LIBS="${PUBLIC_LINK_LIBS};avcodec;avdevice;avfilter;avformat;avutil;swresample;swscale"
  42. fi
  43. # CONFIG_SUPPORT_IFLYTOP_VOICE_PROCESS
  44. if [ "$CONFIG_SUPPORT_IFLYTOP_VOICE_PROCESS" = true ]; then
  45. wget -c "http://iflytop.local:8021/zlibrelease/libiflytop_voice_process/libiflytop_voice_process_v1.0_aarch64_ubuntu18.04_static_0.tar.gz"
  46. tar -xvf libiflytop_voice_process_v1.0_aarch64_ubuntu18.04_static_0.tar.gz >/dev/null
  47. rm -rf ${LIBSDIR}/libiflytop_voice_process
  48. mv libiflytop_voice_process_v1.0_aarch64_ubuntu18.04_static_0 ${LIBSDIR}/libiflytop_voice_process
  49. PUBLIC_LINK_DIRECTORIES="${PUBLIC_LINK_DIRECTORIES};${LIBSDIR}/libiflytop_voice_process/lib"
  50. PUBLIC_INCLUDE_DIRECTORIES="${PUBLIC_INCLUDE_DIRECTORIES};${LIBSDIR}/libiflytop_voice_process/include"
  51. PUBLIC_LINK_LIBS="${PUBLIC_LINK_LIBS};iflytopvoice;NE10_static"
  52. fi
  53. if [ "$CONFIG_SUPPORT_IXWEBSOCKET" = true ]; then
  54. wget -c "http://iflytop.local:8021/zlibrelease/libixwebsocket/libixwebsocket_v11.4.3_aarch64_static_ubuntu18.04_0.tar.gz"
  55. tar -xvf libixwebsocket_v11.4.3_aarch64_static_ubuntu18.04_0.tar.gz >/dev/null
  56. rm -rf ${LIBSDIR}/libixwebsocket
  57. mv libixwebsocket_v11.4.3_aarch64_static_ubuntu18.04_0 ${LIBSDIR}/libixwebsocket
  58. PUBLIC_LINK_DIRECTORIES="${PUBLIC_LINK_DIRECTORIES};${LIBSDIR}/libixwebsocket/lib"
  59. PUBLIC_INCLUDE_DIRECTORIES="${PUBLIC_INCLUDE_DIRECTORIES};${LIBSDIR}/libixwebsocket/include"
  60. PUBLIC_LINK_LIBS="${PUBLIC_LINK_LIBS};ixwebsocket"
  61. fi
  62. CROSS_TOOLCHAIN_C_COMPILER=aarch64-linux-gnu-gcc
  63. CROSS_TOOLCHAIN_CXX_COMPILER=aarch64-linux-gnu-g++