fix: 启用 opus 静态链接修复交叉编译

- 添加 OPUS_STATIC=1 和 PKG_CONFIG_ALL_STATIC=1 环境变量
- 为 libopus 配置添加 --prefix 参数确保静态链接
This commit is contained in:
mofeng-git
2026-01-10 13:03:43 +08:00
parent e670f1ffd1
commit 9feb74b72c
2 changed files with 6 additions and 0 deletions

View File

@@ -167,6 +167,7 @@ RUN git clone --depth 1 https://github.com/xiph/opus /tmp/opus \
&& export RANLIB=aarch64-linux-gnu-ranlib \ && export RANLIB=aarch64-linux-gnu-ranlib \
&& ./autogen.sh \ && ./autogen.sh \
&& ./configure \ && ./configure \
--prefix=/usr/aarch64-linux-gnu \
--host=aarch64-linux-gnu \ --host=aarch64-linux-gnu \
--enable-static --disable-shared \ --enable-static --disable-shared \
--disable-doc \ --disable-doc \
@@ -316,4 +317,6 @@ ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
PKG_CONFIG_ALLOW_CROSS=1 \ PKG_CONFIG_ALLOW_CROSS=1 \
FFMPEG_STATIC=1 \ FFMPEG_STATIC=1 \
LIBYUV_STATIC=1 \ LIBYUV_STATIC=1 \
OPUS_STATIC=1 \
PKG_CONFIG_ALL_STATIC=1 \
RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc" RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc"

View File

@@ -156,6 +156,7 @@ RUN git clone --depth 1 https://github.com/xiph/opus /tmp/opus \
&& export RANLIB=arm-linux-gnueabihf-ranlib \ && export RANLIB=arm-linux-gnueabihf-ranlib \
&& ./autogen.sh \ && ./autogen.sh \
&& ./configure \ && ./configure \
--prefix=/usr/arm-linux-gnueabihf \
--host=arm-linux-gnueabihf \ --host=arm-linux-gnueabihf \
--enable-static --disable-shared \ --enable-static --disable-shared \
--disable-doc \ --disable-doc \
@@ -305,6 +306,8 @@ ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
PKG_CONFIG_ALLOW_CROSS=1 \ PKG_CONFIG_ALLOW_CROSS=1 \
FFMPEG_STATIC=1 \ FFMPEG_STATIC=1 \
LIBYUV_STATIC=1 \ LIBYUV_STATIC=1 \
OPUS_STATIC=1 \
PKG_CONFIG_ALL_STATIC=1 \
RUSTFLAGS="-C linker=arm-linux-gnueabihf-gcc" RUSTFLAGS="-C linker=arm-linux-gnueabihf-gcc"
# Default command # Default command