[FFmpeg-devel] FFmpeg for Mac

David Conrad lessen42
Wed May 20 19:49:50 CEST 2009


On May 20, 2009, at 1:27 PM, Neal Krawetz wrote:

> Hi folks,
>
> I managed to port FFMpeg to Macs as a Universal Binary (runs on both  
> ppc
> and x86 architectures).  There were a couple of changes that I needed
> to make in order for this work.
>
> I've tested this on the x86 architecture.  It compiles for a PPC,  
> but I
> have not tested it yet.  I suspect that it will fail because the  
> ENDIAN
> is hard-coded in config.h.

CFLAGS='-arch ppc -arch i386' ../configure --arch=x86
[...]
ARCH                      unknown (generic)
big-endian                yes

which produces

$ file ffmpeg
ffmpeg: Mach-O executable i386

which is completely broken.

IIRC ld only supports one architecture at a time so you'd have to use  
lipo in the last step anyway. Plus it's impossible to build MMX/SSE/ 
Altivec optimizations this way.

> Anyway, here is my notes of things I needed to change for porting to  
> the Mac:
>
> * Install ffmpeg.
>  Unforutnately, ffmpeg does not support universal binaries and  
> configure
>  does not set all of the configuration variables correctly.  So we  
> will
>  force it.
>  Edit libavformat/framehook.c and comment out the header check:
>        // #if HAVE_DLFCN_H
>        #include <dlfcn.h>
>        // #endif
>  This header DOES exist when Xcode for MacOSX 10.5 is installed.

gcc-4.0: -E, -S, -save-temps and -M options are not allowed with  
multiple -arch flags
is the reason these aren't set.



More information about the ffmpeg-devel mailing list