前面讲到了自定义NDK编译工具链为编译FFMPEG提供环境,
目录
- 自定义NDK交叉编译链(toolchain) (建议先去了解)
编译环境
操作系统:mac os 10.14.2
NDK版本:android-ndk-r20
编译器:clang
FFMPEG版本:4.2.1
编译脚本
- 整理了一个编译环境的脚本build.sh,放在FFMPEG目录下
#!/bin/sh
# Android NDK sources and standalone toolchain is put here
DEV=~/Library/Android/sdk
NDK_HOME=~/Library/Android/sdk/ndk-bundle
#自定义NDK toolchain目录
CHAIN_ENV=${NDK_HOME}/Chain/android-toolchain
# Set Android target arch
ANDROID_ARCH=arm
# All the built binaries, libs and their header will be installed here
PREFIX=~
# static or share libs dir
OUT_PUT=${PREFIX}/android-output
# Don't mix up .pc files from your host and build target
PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
# Set Android target API level
ANDROID_API=21
# The cross-compile toolchain we use
TOOLCHAIN=${ANDROID_ARCH}-linux-androidea