iPhone SDK 4.3 libav编译问题

我遇到了奇怪的问题。我安装了iPhone SDK 4.3和xCode 4,现在我无法从ffmpeg为ARMv6架构编译libav。这是我编译它的脚本(适用于iPhone SDK 4.2):
./configure 
--disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile 
--enable-encoder=rawvideo 
--enable-decoder=h264 
--enable-decoder=mpeg4 
--enable-encoder=mjpeg 
--enable-muxer=rawvideo 
--enable-demuxer=h264 
--enable-parser=h264 
--enable-cross-compile 
--arch=c 
--target-os=darwin 
--enable-libopencore-amrnb --enable-libopencore-amrwb 
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 
--as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer    /usr/bin/arm-apple-darwin10-gcc-4.2.1' 
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk 
--cpu=arm1176jzf-s --extra-cflags='-arch armv6' --extra-ldflags='-arch armv6'

make clean
make   
因此我得到了库文件,但是当我用lipo -info命令检查它时,它显示库是为i386架构编译的。 也许有人面临这样的问题?请帮帮我。 谢谢。     
已邀请:
更新的帖子 这是一个更新的脚本,删除armv6,添加armv7s,使用iOS 6.0 SDK,并修复了对
lipo
工具的更改问题。确保你拥有最新的
gas-preprocessor.pl
来自
/usr/local/bin
的github:
rm -r ./compiled

# configure for armv7 build
./configure 
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc 
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' 
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk 
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib/system 
--target-os=darwin 
--arch=arm 
--cpu=cortex-a8 
--extra-cflags='-arch armv7' 
--extra-ldflags='-arch armv7' 
--extra-cflags='-mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad' 
--prefix=compiled/armv7 
--enable-pic 
--enable-neon 
--enable-cross-compile 
--enable-optimizations 
--disable-debug 
--disable-armv5te 
--disable-armv6 
--disable-armv6t2 
--disable-armvfp 
--disable-ffmpeg 
--disable-ffplay 
--disable-ffserver 
--disable-ffprobe 
--disable-doc

# build for armv7
make clean
make && make install

# configure for armv7s build
./configure 
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc 
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' 
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk 
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib/system 
--target-os=darwin 
--arch=arm 
--cpu=cortex-a8 
--extra-cflags='-arch armv7s' 
--extra-ldflags='-arch armv7s' 
--extra-cflags='-mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad' 
--prefix=compiled/armv7s 
--enable-pic 
--enable-neon 
--enable-cross-compile 
--enable-optimizations 
--disable-debug 
--disable-armv5te 
--disable-armv6 
--disable-armv6t2 
--disable-armvfp 
--disable-ffmpeg 
--disable-ffplay 
--disable-ffserver 
--disable-ffprobe 
--disable-doc

# build for armv7s
make clean
make && make install

# configure for i386 build
./configure 
--cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc 
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' 
--sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk 
--extra-ldflags=-L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/lib/system 
--target-os=darwin 
--arch=i386 
--cpu=i386 
--extra-cflags='-arch i386' 
--extra-ldflags='-arch i386' 
--prefix=compiled/i386 
--enable-cross-compile 
--disable-mmx 
--disable-armv5te 
--disable-armv6 
--disable-armv6t2 
--disable-armvfp 
--disable-ffmpeg 
--disable-ffplay 
--disable-ffserver 
--disable-ffprobe 
--disable-doc

# build for i386
make clean
make && make install

# make fat (universal) libs
mkdir -p ./compiled/fat/lib

lipo -output ./compiled/fat/lib/libavcodec.a  -create 
./compiled/armv7s/lib/libavcodec.a 
./compiled/armv7/lib/libavcodec.a 
./compiled/i386/lib/libavcodec.a

lipo -output ./compiled/fat/lib/libavdevice.a  -create 
./compiled/armv7s/lib/libavdevice.a 
./compiled/armv7/lib/libavdevice.a 
./compiled/i386/lib/libavdevice.a

lipo -output ./compiled/fat/lib/libavfilter.a  -create 
./compiled/armv7s/lib/libavfilter.a 
./compiled/armv7/lib/libavfilter.a 
./compiled/i386/lib/libavfilter.a

lipo -output ./compiled/fat/lib/libavformat.a  -create 
./compiled/armv7s/lib/libavformat.a 
./compiled/armv7/lib/libavformat.a 
./compiled/i386/lib/libavformat.a

lipo -output ./compiled/fat/lib/libavutil.a  -create 
./compiled/armv7s/lib/libavutil.a 
./compiled/armv7/lib/libavutil.a 
./compiled/i386/lib/libavutil.a

lipo -output ./compiled/fat/lib/libswresample.a  -create 
./compiled/armv7s/lib/libswresample.a 
./compiled/armv7/lib/libswresample.a 
./compiled/i386/lib/libswresample.a

lipo -output ./compiled/fat/lib/libswscale.a  -create 
./compiled/armv7s/lib/libswscale.a 
./compiled/armv7/lib/libswscale.a 
./compiled/i386/lib/libswscale.a
原帖 这将为armv6,armv7和i386架构构建ffmpeg静态库,并将它们组合成iOS 4.3(iPhoneOS4.3和iPhoneSimulator4.3)的胖(通用)文件:
rm -r ./compiled

# configure for armv7 build
./configure 
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc 
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' 
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk 
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/system 
--target-os=darwin 
--arch=arm 
--cpu=cortex-a8 
--extra-cflags='-arch armv7' 
--extra-ldflags='-arch armv7' 
--prefix=compiled/armv7 
--enable-pic 
--enable-cross-compile 
--disable-armv5te 
--disable-ffmpeg 
--disable-ffplay 
--disable-ffserver 
--disable-ffprobe 
--disable-doc

# build for armv7
make clean
make && make install

# configure for armv6 build
./configure 
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc 
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' 
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk 
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/system 
--target-os=darwin 
--arch=arm 
--cpu=arm1176jzf-s 
--extra-cflags='-arch armv6' 
--extra-ldflags='-arch armv6' 
--prefix=compiled/armv6 
--enable-cross-compile 
--disable-armv5te 
--disable-ffmpeg 
--disable-ffplay 
--disable-ffserver 
--disable-ffprobe 
--disable-doc

# build for armv6
make clean
make && make install

# configure for i386 build
./configure 
--cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc 
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' 
--sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk 
--extra-ldflags=-L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/system 
--target-os=darwin 
--arch=i386 
--cpu=i386 
--extra-cflags='-arch i386' 
--extra-ldflags='-arch i386' 
--prefix=compiled/i386 
--enable-cross-compile 
--disable-armv5te 
--disable-ffmpeg 
--disable-ffplay 
--disable-ffserver 
--disable-ffprobe 
--disable-doc

# build for i386
make clean
make && make install

# make fat (universal) libs
mkdir -p ./compiled/fat/lib

lipo -output ./compiled/fat/lib/libavcodec.a  -create 
-arch armv6 ./compiled/armv6/lib/libavcodec.a 
-arch armv7 ./compiled/armv7/lib/libavcodec.a 
-arch i386 ./compiled/i386/lib/libavcodec.a

lipo -output ./compiled/fat/lib/libavdevice.a  -create 
-arch armv6 ./compiled/armv6/lib/libavdevice.a 
-arch armv7 ./compiled/armv7/lib/libavdevice.a 
-arch i386 ./compiled/i386/lib/libavdevice.a

lipo -output ./compiled/fat/lib/libavfilter.a  -create 
-arch armv6 ./compiled/armv6/lib/libavfilter.a 
-arch armv7 ./compiled/armv7/lib/libavfilter.a 
-arch i386 ./compiled/i386/lib/libavfilter.a

lipo -output ./compiled/fat/lib/libavformat.a  -create 
-arch armv6 ./compiled/armv6/lib/libavformat.a 
-arch armv7 ./compiled/armv7/lib/libavformat.a 
-arch i386 ./compiled/i386/lib/libavformat.a

lipo -output ./compiled/fat/lib/libavutil.a  -create 
-arch armv6 ./compiled/armv6/lib/libavutil.a 
-arch armv7 ./compiled/armv7/lib/libavutil.a 
-arch i386 ./compiled/i386/lib/libavutil.a

lipo -output ./compiled/fat/lib/libpostproc.a  -create 
-arch armv6 ./compiled/armv6/lib/libpostproc.a 
-arch armv7 ./compiled/armv7/lib/libpostproc.a 
-arch i386 ./compiled/i386/lib/libpostproc.a

lipo -output ./compiled/fat/lib/libswscale.a  -create 
-arch armv6 ./compiled/armv6/lib/libswscale.a 
-arch armv7 ./compiled/armv7/lib/libswscale.a 
-arch i386 ./compiled/i386/lib/libswscale.a
    

要回复问题请先登录注册