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.

65 lines
2.8 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. # Code Begin
  8. mkdir -p ${LIBSDIR}
  9. cd ${LIBSDIR}
  10. # 下载依赖库
  11. # CONFIG_SUPPORT_ALSA
  12. if [ "$CONFIG_SUPPORT_ALSA" = true ]; then
  13. wget -c "192.168.1.2:8021/sdk_firefly_rk3328_v2.5.1/buildtools/libasound2_dev1.1.3-5ubuntu0.6.tar.gz"
  14. wget -c "192.168.1.2:8021/sdk_firefly_rk3328_v2.5.1/buildtools/libz.tar.gz"
  15. rm -rf ${LIBSDIR}/alsa
  16. rm -rf libasound2_dev1.1.3-5ubuntu0.6
  17. tar -xvf libasound2_dev1.1.3-5ubuntu0.6.tar.gz >/dev/null
  18. tar -xvf libz.tar.gz >/dev/null
  19. mkdir -p ${LIBSDIR}/alsa/pkgconfig/
  20. mkdir -p ${LIBSDIR}/alsa/include/sys/
  21. mkdir -p ${LIBSDIR}/alsa/lib/
  22. mkdir -p ${LIBSDIR}/alsa/include/sys/
  23. mv libasound2_dev1.1.3-5ubuntu0.6/unpack/usr/lib/aarch64-linux-gnu/libasound.* ${LIBSDIR}/alsa/lib/
  24. mv libasound2_dev1.1.3-5ubuntu0.6/unpack/usr/lib/aarch64-linux-gnu/pkgconfig/alsa.pc ${LIBSDIR}/alsa/pkgconfig/
  25. mv libasound2_dev1.1.3-5ubuntu0.6/unpack/usr/include/alsa ${LIBSDIR}/alsa/include/
  26. mv libasound2_dev1.1.3-5ubuntu0.6/unpack/usr/include/sys/* ${LIBSDIR}/alsa/include/sys/
  27. mv libz.so.1 ${LIBSDIR}/alsa/lib/
  28. PUBLIC_LINK_DIRECTORIES="${PUBLIC_LINK_DIRECTORIES};${LIBSDIR}/alsa/lib"
  29. PUBLIC_INCLUDE_DIRECTORIES="${PUBLIC_INCLUDE_DIRECTORIES};${LIBSDIR}/alsa/include"
  30. PUBLIC_LINK_LIBS="${PUBLIC_LINK_LIBS};asound"
  31. fi
  32. # CONFIG_SUPPORT_FFMPEG
  33. if [ "$CONFIG_SUPPORT_FFMPEG" = true ]; then
  34. wget -c "192.168.1.2:8021/sdk_firefly_rk3328_v2.5.1/buildtools/ffmpeg-4.1.10-aarch64-20230301.tar.gz"
  35. rm -rf ${LIBSDIR}/ffmpeg
  36. tar -xvf ffmpeg-4.1.10-aarch64-20230301.tar.gz >/dev/null
  37. mv ffmpeg-4.1.10-aarch64-20230301 ${LIBSDIR}/ffmpeg
  38. PUBLIC_LINK_DIRECTORIES="${PUBLIC_LINK_DIRECTORIES};${LIBSDIR}/ffmpeg/lib"
  39. PUBLIC_INCLUDE_DIRECTORIES="${PUBLIC_INCLUDE_DIRECTORIES};${LIBSDIR}/ffmpeg/include"
  40. PUBLIC_LINK_LIBS="${PUBLIC_LINK_LIBS};avcodec;avdevice;avfilter;avformat;avutil;swresample;swscale"
  41. fi
  42. # CONFIG_SUPPORT_IFLYTOP_VOICE_PROCESS
  43. if [ "$CONFIG_SUPPORT_IFLYTOP_VOICE_PROCESS" = true ]; then
  44. wget -c "http://iflytop.local:8021/zlibrelease/libiflytop_voice_process/libiflytop_voice_process_v1.0_aarch64_ubuntu18.04_static_0.tar.gz"
  45. tar -xvf libiflytop_voice_process_v1.0_aarch64_ubuntu18.04_static_0.tar.gz >/dev/null
  46. rm -rf ${LIBSDIR}/libiflytop_voice_process
  47. mv libiflytop_voice_process_v1.0_aarch64_ubuntu18.04_static_0 ${LIBSDIR}/libiflytop_voice_process
  48. PUBLIC_LINK_DIRECTORIES="${PUBLIC_LINK_DIRECTORIES};${LIBSDIR}/libiflytop_voice_process/lib"
  49. PUBLIC_INCLUDE_DIRECTORIES="${PUBLIC_INCLUDE_DIRECTORIES};${LIBSDIR}/libiflytop_voice_process/include"
  50. PUBLIC_LINK_LIBS="${PUBLIC_LINK_LIBS};iflytopvoice;NE10_static"
  51. fi
  52. CROSS_TOOLCHAIN_C_COMPILER=aarch64-linux-gnu-gcc
  53. CROSS_TOOLCHAIN_CXX_COMPILER=aarch64-linux-gnu-g++