1. 程式人生 > >mac環境ndk編譯lame

mac環境ndk編譯lame

超級簡單直接上步驟
1 下載
wget https://downloads.sourceforge.net/lame/lame-3.100.tar.gz –no-check-certificat

2 解壓
tar xvf lame-3.100.tar.gz

3 建立交叉編譯環境

$NDK/build/tools/make-standalone-toolchain.sh –arch=x86_64 –platform=android-21 –install-dir=/tmp/x86_64-android-toolchain

4 在lame根目錄建立編譯指令碼build_x86.sh


export
PATH=/tmp/x86_64-android-toolchain/bin:$PATH export CC=x86_64-linux-android-gcc # or export CC=clang export CXX=x86_64-linux-android-g++ # or export CXX=clang++ export RANLIB="x86_64-linux-android-ranlib" export STRIP="x86_64-linux-android-strip" export AS=x86_64-linux-android-ar export LD=x86_64-linux-android-ld export
NM=x86_64-linux-android-NM export AR=x86_64-linux-android-ar export CFLAGS="-D__ANDROID_API__=21" export CXXFLAGS="-D__ANDROID_API__=21" MYPATH=`pwd` ./configure --host=x86_64 \ --disable-shared \ --disable-frontend \ --enable-static \ --prefix=$MYPATH/x86_64 make clean make -j8 make install

5 執行指令碼


./build_x86.sh

交叉環境編譯參考:
https://developer.android.com/ndk/guides/standalone_toolchain?hl=zh-cn