tank1781053 2015-12-07 02:57 采纳率: 0%
浏览 1950

iOS配置编译ffmpeg无法编译成功

#!/bin/bash
SDKVERSION="9.1"

ARCHS="armv7 armv7s i386"

DEVELOPER=xcode-select -print-path

cd "dirname \"$0\""
REPOROOT=$(pwd)

where we will store intermediary builds

INTERDIR="${REPOROOT}/built"
mkdir -p $INTERDIR

########################################

Exit the script if an error happens

for ARCH in ${ARCHS}
do
if [ "${ARCH}" == "i386" ];
then
PLATFORM="iPhoneSimulator"
EXTRA_CONFIG="--arch=i386 --disable-asm --enable-cross-compile --target-os=darwin --cpu=i386"
EXTRA_CFLAGS="-arch i386"
EXTRA_LDFLAGS="-I${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk/usr/lib"
else
PLATFORM="iPhoneOS"
EXTRA_CONFIG="--arch=arm --target-os=darwin --enable-cross-compile --cpu=cortex-a9 --disable-armv5te"
EXTRA_CFLAGS="-w -arch ${ARCH}"
fi

mkdir -p "${INTERDIR}/${ARCH}"

./configure --prefix="${INTERDIR}/${ARCH}" \
--disable-neon \
--disable-armv6 \
--disable-armv6t2 \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-iconv \
--disable-bzlib \
--enable-avresample \
--sysroot="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk" \
--cc="${DEVELOPER}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" \
--as='/usr/sbin/gas-preprocessor.pl' \
--extra-cflags="${EXTRA_CFLAGS} -miphoneos-version-min=${SDKVERSION}" \
--extra-ldflags="-arch ${ARCH} ${EXTRA_LDFLAGS} -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk -miphoneos-version-min=${SDKVERSION}" ${EXTRA_CONFIG} \
--enable-pic \
--extra-cxxflags="$CPPFLAGS -isysroot ${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk"

make && make install && make clean

done

mkdir -p "${INTERDIR}/universal/lib"

cd "${INTERDIR}/armv7/lib"
for file in *.a
do

cd ${INTERDIR}
xcrun -sdk iphoneos lipo -output universal/lib/$file -create -arch armv7 armv7/lib/$file -arch armv7s armv7s/lib/$file -arch i386 i386/lib/$file
echo "Universal $file created."

done
cp -r ${INTERDIR}/armv7/include ${INTERDIR}/universal/

echo "Done."

以上为config.sh执行后只生成了i386的库,armv7和armv7s都没有生成东西,提示如下:
-bash: cd: /Users/nevermore/Downloads/ffmpeg-2.8.3/built/armv7/lib: No such file or directory
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: armv7/lib/*.a (No such file or directory)
Universal *.a created.
cp: /Users/nevermore/Downloads/ffmpeg-2.8.3/built/armv7/include: No such file or directory
Done.

机器的os操作系统为最新版10.10.5,xcode7.1也是最新的,请大家帮帮忙应该怎么解决

  • 写回答

1条回答

  • 普通网友 2015-12-07 07:14
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示