ffmpeg won't ./configure in iOS5.1

后端 未结 2 923
梦毁少年i
梦毁少年i 2021-01-06 04:40

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         


        
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-06 04:56

    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.

提交回复
热议问题