[Ffmpeg-devel] [PATCH] darwin/osx dylib support
Michael Niedermayer
michaelni
Sun Aug 21 18:20:08 CEST 2005
Hi
On Fri, Aug 19, 2005 at 12:13:05PM +0200, Luca Barbato wrote:
> The patch adds the right LDFLAGS and symlink logic to support osx/darwin
> (dylib in particular).
>
> The main problem is that you need a defined format for the output lib
> and some convoluted link statement.
[...]
> --- ffmpeg-orig/libavcodec/Makefile 2005-08-19 00:10:57.000000000 -0400
> +++ ffmpeg/libavcodec/Makefile 2005-08-19 01:06:29.000000000 -0400
> @@ -19,6 +19,11 @@
> dpcm.o adx.o faandct.o parser.o g726.o \
> vp3dsp.o h264idct.o rangecoder.o pnm.o h263.o msmpeg4.o h263dec.o dvdsub.o dvbsub.o dvbsubdec.o
>
> +ifeq ($(SHARED_PP),yes)
> +SPPMAJOR = 0
> +SPPVERSION = $(SPPMAJOR).0.1
> +endif
IMHO version info does not belong in a makefile
[...]
> +ifeq ($(CONFIG_DARWIN),yes)
> + $(CC) -dynamiclib -Wl,-undefined,dynamic_lookup,-install_name,$(SLIBPREF)avcodec$(SLIBSUF),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS)
> +else
> $(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS)
> endif
> +endif
[...]
> +ifeq ($(CONFIG_DARWIN),yes)
> + install -m 755 $(SLIB) $(libdir)/libavcodec.$(VERSION)$(SLIBSUF)
> + ln -sf libavcodec.$(VERSION)$(SLIBSUF) $(libdir)/libavcodec$(SLIBSUF)
> +else
> install $(INSTALLSTRIP) -m 755 $(SLIB) $(libdir)/libavcodec-$(VERSION).so
> - ln -sf libavcodec-$(VERSION).so $(libdir)/libavcodec.so
> + ln -sf libavcodec-$(VERSION).so $(libdir)/libavcodec.so
> $(LDCONFIG) || true
> endif
> +endif
[...]
> +ifeq ($(CONFIG_DARWIN),yes)
> + $(CC) -dynamiclib -Wl,-undefined,dynamic_lookup,-install_name,$(SLIBPREF)postproc$(SLIBSUF),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION) -o $(SPPLIB) $(SPPOBJS)
> +else
> $(CC) -shared -Wl,-soname,$(SPPLIB).$(SPPMAJOR) \
> -o $(SPPLIB) $(SPPOBJS)
[...]
> +ifeq ($(CONFIG_DARWIN),yes)
> + install -m 755 $(SPPLIB) $(libdir)/$(SLIBPREF)postproc.$(SPPVERSION)$(SLIBSUF)
> + ln -sf $(SLIBPREF)postproc.$(SPPVERSION)$(SLIBSUF) $(libdir)/$(SPPLIB)
> + ln -sf $(SLIBPREF)postproc.$(SPPVERSION)$(SLIBSUF) $(libdir)/$(SLIBPREF)postproc.$(SPPMAJOR)$(SLIBSUF)
> +else
> install $(INSTALLSTRIP) -m 755 $(SPPLIB) $(libdir)/$(SPPLIB).$(SPPVERSION)
> ln -sf $(SPPLIB).$(SPPVERSION) $(libdir)/$(SPPLIB)
> ln -sf $(SPPLIB).$(SPPVERSION) $(libdir)/$(SPPLIB).$(SPPMAJOR)
rejected, change the various variables or add a new one if needed but
adding a ifeq to every line of every makefile for every system is
not acceptable
[...]
> -#include "common.h"
> +#include "../../libavutil/common.h"
fix the include paths instead
[...]
--
Michael
More information about the ffmpeg-devel
mailing list