脚本如下:放在 mp3lame 源文件目录外面 执行
</pre><pre name="code" class="plain">#!/bin/bash
DEVELOPER=`xcode-select -print-path`
SDK_VERSION="7.1"
MIN_VERSION="6.0"
# PLATFORM="i386"
# SDK_TYPE="iPhoneSimulator"
PLATFORM="armv7"
SDK_TYPE="iPhoneOS"
CURDIR=$(pwd)
cd lame-3.99.5
mkdir ${CURDIR}/lame-build
make clean
./configure --prefix=${CURDIR}/lame-build/${PLATFORM} \
CCACHE="" \
CFLAGS="-isysroot ${DEVELOPER}/Platforms/${SDK_TYPE}.platform/Developer/SDKs/${SDK_TYPE}${SDK_VERSION}.sdk -arch ${PLATFORM} -miphoneos-version-min=${MIN_VERSION}" \
LDFLAGS="-L${DEVELOPER}/Platforms/${SDK_TYPE}.platform/Developer/SDKs/${SDK_TYPE}${SDK_VERSION}.sdk/usr/lib -L${DEVELOPER}/Platforms/${SDK_TYPE}.platform/Developer/SDKs/${SDK_TYPE}${SDK_VERSION}.sdk/usr/lib/system -arch ${PLATFORM} -miphoneos-version-min=${MIN_VERSION}" \
CC="${DEVELOPER}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch ${PLATFORM} -miphoneos-version-min=${MIN_VERSION}" \
--host="arm-apple-darwin" \
--build="${PLATFORM}-apple-darwin" \
--target="${PLATFORM}" \
--enable-shared \
--enable-static \
--disable-decoder \
--disable-frontend
make && sudo make install && make clean
echo "Done."
修改前面几个参数就可以了
PLATFORM="armv7"
SDK_TYPE="iPhoneOS"