XCode6编译opencore

将下面脚本拷贝并到build.sh文件中保存到opencore-amr库根目录下,修改build.sh文件权限为可执行,运行./build.sh则可以编译出支持xcode6下模拟器及真机执行库。

其生成的头和库文件在桌面opencore-amr-lib-store目录下. 希望对要移植的朋友有帮助.

然后修改为有可运行chmod 777 build.sh

如果出现编译错误,要下载最新的command line tools


#!/bin/sh


#xcode6.0.1 iOS8
set -xe


VERSION="0.1.3"
SDKVERSION="8.1"


DEVELOPER=`xcode-select -print-path`
#CURRENTDIR =`pwd`


DEST=${HOME}/Desktop/opencore-amr-lib-store
ARCHS="i386 x86_64 armv7 armv7s arm64"
LIBS="libopencore-amrnb.a libopencore-amrwb.a"


for arch in $ARCHS; do
case $arch in
arm*)

echo "Building opencore-amr for iPhone $arch ****************"
PLATFORM="iPhoneOS"
PATH="${DEVELOPER}/usr/bin:$PATH"
SDK="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk"
#FRMWORKS = "${SDK}/System/Library/Frameworks"
#PRVFRMWORKS = "${SDK}/System/Library/PrivateFrameworks"
CC="gcc -arch $arch --sysroot=$SDK -F $FRMWORKS" \
CXX="g++ -arch $arch --sysroot=$SDK" \
LDFLAGS="-Wl,-syslibroot,$SDK" ./configure \
--host=arm-apple-darwin --prefix=$DEST \
--disable-shared
;;
*)
PLATFORM="iPhoneSimulator"
PATH="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/usr/bin:$PATH"
SDK="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk"
echo "Building opencore-amr for iPhoneSimulator $arch*****************"
CC="gcc -arch $arch" CXX="g++ -arch $arch" \
./configure \
--prefix=$DEST \
--disable-shared
;;
esac
make -j3
make install
make clean
for i in $LIBS; do
mv $DEST/lib/$i $DEST/lib/$i.$arch
done
done


for i in $LIBS; do
input=""
for arch in $ARCHS; do
input="$input $DEST/lib/$i.$arch"
done
lipo -create -output $DEST/lib/$i $input
done

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值