本人初步追踪到的原始出处,可能是:
http://stackoverflow.com/questions/13233880/building-ffmpeg-library-for-ios6-0-armv7-processor-success-but-compile-error
本人转载自 http://blog.csdn.net/zengconggen/article/details/8179355
在此感谢原创作者和转载者。
严重注意,实际操作和文中所说有点出入,请看下面的特别说明部分。
本人所用Mac OS X 版本是 10.8.3, 编译时所用的xCode版本是4.5.1,ffmpeg版本是1.2.1
=========Howard 2013-06-17 特别说明==BEGIN===================
1. 下载ffmpeg:
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
2. 下载gas-preprocessor
地址: https://github.com/yuvi/gas-preprocessor,
下载完后把gas-preprocessor.pl 复制到 /usr/bin/ 目录下,修改权限 chmod 777
就是在控制台输入: chmod 777 /usr/bin/gas-preprocessor.pl
3. 本人所用Mac没有下面所说的/usr/local/这个路径,编译出来的.a 文件是在 ffmpeg对应的子目录当中,在ffmpeg目录查找一下.a文件,可以找到。
===========Howard 2013-06-17 特别说明==END===================
Here is my working Configure for cross-compiling FFmpeg
on iOS 6 the arch is ARMv7
NOTE: You must have to have gas-preprocessor.pl inside /usr/local/bin/
please do not continue until you have gas-preprocessor.pl on your bin directory
Download FFmpeg 1.0 "Angel" from here
Unzip it and place it somewhere i.e. your Desktop
folder
Open terminal and browse to unzipped FFmpeg folder
Copy and paste the following command, (be patient will take a while)
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch=arm --target-os=darwin --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk' --enable-pic --enable-decoder=rawvideo --disable-asm
Now type the following command on terminal make
(wait a little more)
Once it has finished now type on terminal sudo make install
(wait again)
Go to /usr/local/lib
to find your freshly baked armv7
libs
Enjoy!
This armv7s configure is totally untested and i dont really know if this would work, i don't own an iPhone 5 so we need someone to test the final armv7s libs
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch=arm --target-os=darwin --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7s' --extra-ldflags='-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk' --enable-pic --enable-decoder=rawvideo --disable-asm
====模拟器版本=====================================================
//Howard 2013-06-17 以下是本人参考网上资料,针对Mac OS X 10.8.2, xCode 4.5.1 写的:
./configure --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" --extra-cflags="-arch i386" --extra-ldflags="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk" --arch=i386 --cpu=i386 --enable-pic --disable-asm
===========================================================