diff options
author | Diego Biurrun <diego@biurrun.de> | 2005-09-26 10:05:13 +0000 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2005-09-26 10:05:13 +0000 |
commit | 4e159595b51af5edcf87aeb91359cb97485ef3df (patch) | |
tree | 61482ac1fdce94f505e4330510c57591047036f1 /libavformat | |
parent | 399d84012fec13529e191b6f9d659b977ebfd035 (diff) | |
download | ffmpeg-4e159595b51af5edcf87aeb91359cb97485ef3df.tar.gz |
support for building dynamic libraries on Mac OS X
based on a patch by Lina Pezzella <J4rg0n -- at -- gentoo -- dot -- org>
Originally committed as revision 4616 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/Makefile | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libavformat/Makefile b/libavformat/Makefile index ea486a77db..5be994b30a 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -81,9 +81,11 @@ endif LIB= $(LIBPREF)avformat$(LIBSUF) ifeq ($(BUILD_SHARED),yes) -SLIB= $(SLIBPREF)avformat$(SLIBSUF) - -AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec +SLIBNAME= $(SLIBPREF)avformat$(SLIBSUF) +AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil +ifeq ($(CONFIG_DARWIN),yes) +SHFLAGS += -Wl,-install_name,$(libdir)/$(SLIBNAME),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION) +endif ifeq ($(CONFIG_MP3LAME),yes) AVCLIBS+=-lmp3lame endif @@ -91,14 +93,14 @@ endif SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp) -all: $(LIB) $(SLIB) +all: $(LIB) $(SLIBNAME) $(LIB): $(OBJS) $(PPOBJS) rm -f $@ $(AR) rc $@ $(OBJS) $(PPOBJS) $(RANLIB) $@ -$(SLIB): $(OBJS) +$(SLIBNAME): $(OBJS) ifeq ($(CONFIG_WIN32),yes) $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS) -lib /machine:i386 /def:$(@:.dll=.def) @@ -112,11 +114,11 @@ depend: $(SRCS) ifeq ($(BUILD_SHARED),yes) install: all install-headers ifeq ($(CONFIG_WIN32),yes) - install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)" + install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)" else install -d $(libdir) - install $(INSTALLSTRIP) -m 755 $(SLIB) $(libdir)/libavformat-$(VERSION).so - ln -sf libavformat-$(VERSION).so $(libdir)/libavformat.so + install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/$(SLIBPREF)avformat-$(VERSION)$(SLIBSUF) + ln -sf $(SLIBPREF)avformat-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME) $(LDCONFIG) || true endif else @@ -143,7 +145,7 @@ install-headers: g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $< distclean clean: - rm -f *.o *.d .depend *~ *.a *.so $(LIB) + rm -f *.o *.d .depend *~ *.a *$(SLIBSUF) $(LIB) # # include dependency files if they exist |