I am trying to build ffmpeg on iOS5.1 (armv7), when I try to run ./configure like this:
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable
There is a few things wrong with your configure script, that I can tell. First of all, you are using:
--cc=/applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc
This is wrong. You should be using the architecture specific gcc compilers, so in your case (armv7) you should be using, for example:
--cc=/applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1
Notice you're calling upon the arm-apple-darwin10-gcc-4.2.1
version of apple's own gcc.
Since this is only an example, look in your ../Developer/../bin/
and use the latest arm-apple-darwin10-gcc-x.x.x
that you have. I see that there are a lot of answers on SO that suggest you do it the way you have done it, this is just flat out wrong! and doesn't work for arm, it'll work for i386 (simulator) only.
You will need to update the assembler directive to reflect using the same gcc version:
--as='gas-preprocessor/gas-preprocessor.pl /applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1'
Additionally, don't put an -arch armv7
in your --extra-cflags
, you may get an
error: unrecognized command line option "-arch"
Lastly and depending on your situation, might I suggest the following, in addition to what you already have:
--disable-bzlib --disable-gpl --disable-shared --enable-static --disable-mmx --disable-debug --disable-neon
and change to this:
--extra-cflags='-pipe -Os -gdwarf-2 -isysroot /applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -m${thumb_opt:-no-thumb} -mthumb-interwork'
Hope this helps.