#!/bin/bash # 全局变量 # Config CONFIG_SUPPORT_ALSA=true CONFIG_SUPPORT_FFMPEG=true CONFIG_SUPPORT_IFLYTOP_VOICE_PROCESS=true # Code Begin mkdir -p ${LIBSDIR} cd ${LIBSDIR} # 下载依赖库 # CONFIG_SUPPORT_ALSA if [ "$CONFIG_SUPPORT_ALSA" = true ]; then wget -c "192.168.1.2:8021/sdk_firefly_rk3328_v2.5.1/buildtools/libasound2_dev1.1.3-5ubuntu0.6.tar.gz" wget -c "192.168.1.2:8021/sdk_firefly_rk3328_v2.5.1/buildtools/libz.tar.gz" rm -rf ${LIBSDIR}/alsa rm -rf libasound2_dev1.1.3-5ubuntu0.6 tar -xvf libasound2_dev1.1.3-5ubuntu0.6.tar.gz >/dev/null tar -xvf libz.tar.gz >/dev/null mkdir -p ${LIBSDIR}/alsa/pkgconfig/ mkdir -p ${LIBSDIR}/alsa/include/sys/ mkdir -p ${LIBSDIR}/alsa/lib/ mkdir -p ${LIBSDIR}/alsa/include/sys/ mv libasound2_dev1.1.3-5ubuntu0.6/unpack/usr/lib/aarch64-linux-gnu/libasound.* ${LIBSDIR}/alsa/lib/ mv libasound2_dev1.1.3-5ubuntu0.6/unpack/usr/lib/aarch64-linux-gnu/pkgconfig/alsa.pc ${LIBSDIR}/alsa/pkgconfig/ mv libasound2_dev1.1.3-5ubuntu0.6/unpack/usr/include/alsa ${LIBSDIR}/alsa/include/ mv libasound2_dev1.1.3-5ubuntu0.6/unpack/usr/include/sys/* ${LIBSDIR}/alsa/include/sys/ mv libz.so.1 ${LIBSDIR}/alsa/lib/ PUBLIC_LINK_DIRECTORIES="${PUBLIC_LINK_DIRECTORIES};${LIBSDIR}/alsa/lib" PUBLIC_INCLUDE_DIRECTORIES="${PUBLIC_INCLUDE_DIRECTORIES};${LIBSDIR}/alsa/include" PUBLIC_LINK_LIBS="${PUBLIC_LINK_LIBS};asound" fi # CONFIG_SUPPORT_FFMPEG if [ "$CONFIG_SUPPORT_FFMPEG" = true ]; then wget -c "192.168.1.2:8021/sdk_firefly_rk3328_v2.5.1/buildtools/ffmpeg-4.1.10-aarch64-20230301.tar.gz" rm -rf ${LIBSDIR}/ffmpeg tar -xvf ffmpeg-4.1.10-aarch64-20230301.tar.gz >/dev/null mv ffmpeg-4.1.10-aarch64-20230301 ${LIBSDIR}/ffmpeg PUBLIC_LINK_DIRECTORIES="${PUBLIC_LINK_DIRECTORIES};${LIBSDIR}/ffmpeg/lib" PUBLIC_INCLUDE_DIRECTORIES="${PUBLIC_INCLUDE_DIRECTORIES};${LIBSDIR}/ffmpeg/include" PUBLIC_LINK_LIBS="${PUBLIC_LINK_LIBS};avcodec;avdevice;avfilter;avformat;avutil;swresample;swscale" fi # CONFIG_SUPPORT_IFLYTOP_VOICE_PROCESS if [ "$CONFIG_SUPPORT_IFLYTOP_VOICE_PROCESS" = true ]; then wget -c "http://iflytop.local:8021/zlibrelease/libiflytop_voice_process/libiflytop_voice_process_v1.0_aarch64_ubuntu18.04_static_0.tar.gz" tar -xvf libiflytop_voice_process_v1.0_aarch64_ubuntu18.04_static_0.tar.gz >/dev/null rm -rf ${LIBSDIR}/libiflytop_voice_process mv libiflytop_voice_process_v1.0_aarch64_ubuntu18.04_static_0 ${LIBSDIR}/libiflytop_voice_process PUBLIC_LINK_DIRECTORIES="${PUBLIC_LINK_DIRECTORIES};${LIBSDIR}/libiflytop_voice_process/lib" PUBLIC_INCLUDE_DIRECTORIES="${PUBLIC_INCLUDE_DIRECTORIES};${LIBSDIR}/libiflytop_voice_process/include" PUBLIC_LINK_LIBS="${PUBLIC_LINK_LIBS};iflytopvoice;NE10_static" fi CROSS_TOOLCHAIN_C_COMPILER=aarch64-linux-gnu-gcc CROSS_TOOLCHAIN_CXX_COMPILER=aarch64-linux-gnu-g++