[Ffmpeg-devel] [PATCH] ffmpeg doesn't compile on Mac OS X anymore...

Patrice Bensoussan patrice.bensoussan
Wed Oct 19 00:33:12 CEST 2005


Hello,

Here is an attempt to fix both issues (use CFLAGS/LDFLAGS so that  
lrintf detection doesn't fail if extra libs
are not installed in standard locations and get rid of this  
MACOSX_DEPLOYMENT_TARGET issue. Not sure
about this one, but at least it seems to work fine on 10.4 with gcc  
3.3 and gcc 4. Can anyone test on 10.2/10.3?)
Also, I had to use -undefined suppress for vhook libs... not sure how  
it's meant to be used, but I guess binaries
using this libs should actually link with all the required libs).

I hope this helps,
Patrice


Index: configure
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/configure,v
retrieving revision 1.211
diff -u -p -r1.211 configure
--- configure   12 Oct 2005 22:24:03 -0000      1.211
+++ configure   18 Oct 2005 22:25:42 -0000
@@ -329,7 +329,7 @@ v4l="no"
audio_oss="no"
dv1394="no"
ffserver="no"
-SHFLAGS="-dynamiclib -Wl,-single_module,-undefined,dynamic_lookup"
+SHFLAGS="-dynamiclib -Wl"
extralibs=""
darwin="yes"
strip="strip -x"
@@ -983,7 +983,7 @@ int main( void ) { return (lrintf(3.999f
EOF
have_lrintf="no"
-if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
+if $cc $CFLAGS $LDFLAGS $extralibs -o $TMPE $TMPC 2> /dev/null ; then
    have_lrintf="yes"
    # allanc at chickenandporn.com: cannot execute cross-compiled
    # code on the host.  Only execute if not cross-compiling.
Index: vhook/Makefile
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/vhook/Makefile,v
retrieving revision 1.24
diff -u -p -r1.24 Makefile
--- vhook/Makefile      1 Oct 2005 14:21:34 -0000       1.24
+++ vhook/Makefile      18 Oct 2005 22:25:42 -0000
@@ -5,7 +5,7 @@ VPATH=$(SRC_PATH)/vhook
CFLAGS=-fPIC $(SHCFLAGS) -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavformat  
-I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavutil -DHAVE_AV_CONFIG_H
ifeq ($(CONFIG_DARWIN),yes)
-       SHFLAGS += -flat_namespace
+       SHFLAGS += -flat_namespace -undefined suppress
endif
HOOKS=null$(SLIBSUF) fish$(SLIBSUF) ppm$(SLIBSUF) watermark$(SLIBSUF)



Begin forwarded message:

> From: Patrice Bensoussan <patrice.bensoussan at gmail.com>
> Date: 7 October 2005 23:28:05 BDT
> To: ffmpeg-devel at mplayerhq.hu
> Subject: ffmpeg doesn't compile on Mac OS X anymore...
>
>
> >On Thu, Oct 06, 2005 at 09:15:09PM +0100, Patrice Bensoussan wrote:
> >>
> >> It looks like there are two issues when trying to compile on Mac  
> OS X
> >> Tiger :
> >>
> >> 1/ When using gcc 3.3, I reach the linking stage but get :
> >>
> >> cc -Wl,-dynamic,-search_paths_first -dynamiclib -Wl,- 
> single_module,-
> >> undefined,dynamic_lookup -flat_namespace -Wl,-install_name,/usr/ 
> local/
> >> lib/vhook/null.dylib -g -o null.dylib null.o
> >> ld: flag: -undefined dynamic_lookup can't be used with
> >> MACOSX_DEPLOYMENT_TARGET environment variable set to: 10.1
> >> /usr/bin/libtool: internal link edit command failed
> >> make[1]: *** [null.dylib] Error 1
> >
> >Yes, that's an issue.  You can work around it with
> >
> >export MACOSX_DEPLOYMENT_TARGET=10.3
> >
> >Does anybody know how to fix this properly
> >
>
> Good question... I've had a quick look at the man page for ld, and
> i'm wondering why we are using -undefined,dynamic_lookup - 
> flat_namespace.
> It looks like this is what is causing this new error to appear.
> Also, wondering if the created binary would actually run on 10.2 if
> we set this variable to 10.3 :/
>
> From the man page : (it seems that two-level is the default, why is  
> this changed?)
>
> TWO-LEVEL AND FLAT NAMESPACES
>        Two-level  and  flat  namespaces  refer to how references to  
> symbols in
>        dynamic libraries are resolved to  a  definition  in   
> specific  dynamic
>        library.   For  two-level  namespace  that resolution is  
> done at static
>        link time when each image  (program,  bundle  and  shared   
> library)  is
>        built.   When  a program is using images built with two- 
> level namespace
>        there may be different global symbols with the same name  
> being used  by
>        different images in the program (this is now the default).   
> When a pro-
>        gram is using all flat namespace images then only one global  
> symbol for
>        each  global symbol name is used by all images of the  
> program (this was
>        the default in MacOS X 10.0).
>
> >> 2/ When using gcc 4.0, compilation aborts with the error (this is
> >> only a warning with gcc 3)
> >> make[1]: *** [mathematics.o] Error 1
> >>
> >That's strange, does the lrintf check in configure fail for you then?
> >
> >Diego
>
> Well not sure how to see this in configure, here is the output :
> (btw i'm using --enable-small which explains why I dont't have -O3)
>
> ./configure --enable-mp3lame --enable-faac --enable-small
> install prefix   /usr/local
> source path      /Users/patriceb/tmp/WMA/cvs-HEAD/ffmpeg
> C compiler       cc
> make             make
> CPU              powerpc (generic)
> big-endian       yes
> inttypes.h       yes
> broken inttypes.h no
> AltiVec enabled  yes
> gprof enabled    no
> zlib enabled     yes
> libgsm enabled   no
> mp3lame enabled  yes
> libogg enabled   no
> Vorbis enabled   no
> Theora enabled   no
> FAAD enabled     no
> faadbin enabled  no
> FAAC enabled     yes
> XviD enabled     no
> x264 enabled     no
> a52 support      no
> a52 dlopened     no
> DTS support      no
> pp support       no
> debug symbols    yes
> strip symbols    yes
> optimize         small
> shared pp        no
> video hooking    yes
> SDL support      no
> Imlib2 support   no
> FreeType support no
> Sun medialib support no
> pthreads support no
> AMR-NB float support no
> AMR-NB fixed support no
> AMR-WB float support no
> AMR-WB IF2 support no
> network support      yes
> IPv6 support         no
> License: LGPL
> Creating config.mak and config.h...
>
> My version of gcc 3.3/4.0 (latest dev tools) :
>
> gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1809)
> Copyright (C) 2002 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.   
> There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR  
> PURPOSE.
>
> powerpc-apple-darwin8-gcc-4.0.0 (GCC) 4.0.0 (Apple Computer, Inc.  
> build 5026)
> Copyright (C) 2005 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.   
> There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR  
> PURPOSE.
>
>





More information about the ffmpeg-devel mailing list