• 安装依赖库
sudo apt install build-essential git autoconf libtool pkg-config gperf gettext yasm python-lxml
  • 下载NDK

 

  • 编译
#!/bin/bash
make clean
export NDK=${NDKROOT}
export SYSROOT=$NDK/platforms/android-19/arch-arm/
export TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
export CPU=arm
export PREFIX=$(pwd)/android/$CPU
export ADDI_CFLAGS="-marm"

./configure --target-os=linux \
    --prefix=$PREFIX --arch=arm \
    --disable-doc \
    --extra-libs=-lgcc \
    --enable-shared \
    --disable-static \
    --disable-yasm \
    --disable-symver \
    --disable-gpl \
    --enable-libx264 \
    --disable-ffmpeg \
    --disable-ffplay \
    --disable-ffprobe \
    --disable-ffserver \
    --disable-doc \
    --disable-symver \
    --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
    --enable-cross-compile \
    --sysroot=$SYSROOT \
    --extra-cflags="-Os -fpic $ADDI_CFLAGS" \
    --extra-ldflags="$ADDI_LDFLAGS" \
    $ADDITIONAL_CONFIGURE_FLAG

#    --enable-gpl \

make clean

make

make install