在mac下編譯lame店溢,lame版本:3.10,ndk版本:15委乌,shell腳本如下:
NDK=/Users/admin/Desktop/xxx/e/ndks/android-ndk-r15c
SYSROOT=$NDK/platforms/android-14/arch-arm
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64
export?PATH=$PATH:$TOOLCHAIN/bin:$SYSROOT/usr/include:
export?LDFLAGS="-L$SYSROOT/usr/lib?-L$TOOLCHAIN/arm-linux-androideabi/lib?-march=armv7-a"
export?CFLAGS="-I$SYSROOT/usr/include?-march=armv7-a?-mfloat-abi=softfp?-mfpu=vfp?-ffast-math?-O2"
export?CPPFLAGS="$CFLAGS"
export?CFLAGS="$CFLAGS"
export?CXXFLAGS="$CFLAGS"
export?LDFLAGS="$LDFLAGS"
export?AS=$TOOLCHAIN/bin/arm-linux-androideabi-as
export?LD=$TOOLCHAIN/bin/arm-linux-androideabi-ld
export?CXX="$TOOLCHAIN/bin/arm-linux-androideabi-g++?--sysroot=${SYSROOT}"
export?CC="$TOOLCHAIN/bin/arm-linux-androideabi-gcc?--sysroot=${SYSROOT}?-march=armv7-a"
export?NM=$TOOLCHAIN/bin/arm-linux-androideabi-nm
export?STRIP=$TOOLCHAIN/bin/arm-linux-androideabi-strip
export?RANLIB=$TOOLCHAIN/bin/arm-linux-androideabi-ranlib
export?AR=$TOOLCHAIN/bin/arm-linux-androideabi-ar
PREFIX=$(pwd)/armv7a
./configure?--host=arm-linux?\
--disable-shared?\
--disable-frontend?\
--enable-static?\
--prefix=$PREFIX
make?clean
make?-j8
sudo?make?install
以上編譯處頭文件和靜態(tài)文件庫
來源:音視頻開發(fā)進(jìn)階指南