You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-06 08:29:25 +02:00
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
This commit is contained in:
@@ -22,22 +22,25 @@ SRCS := $(OBJS:.o=.c)
|
||||
|
||||
LIB= $(LIBPREF)avutil$(LIBSUF)
|
||||
ifeq ($(BUILD_SHARED),yes)
|
||||
SLIB= $(SLIBPREF)avutil$(SLIBSUF)
|
||||
SLIBNAME= $(SLIBPREF)avutil$(SLIBSUF)
|
||||
ifeq ($(CONFIG_DARWIN),yes)
|
||||
SHFLAGS += -Wl,-install_name,$(libdir)/$(SLIBNAME),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION)
|
||||
endif
|
||||
endif
|
||||
|
||||
all: $(LIB) $(SLIB)
|
||||
all: $(LIB) $(SLIBNAME)
|
||||
|
||||
$(LIB): $(OBJS)
|
||||
rm -f $@
|
||||
$(AR) rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
$(SLIB): $(OBJS)
|
||||
$(SLIBNAME): $(OBJS)
|
||||
ifeq ($(CONFIG_WIN32),yes)
|
||||
$(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
|
||||
-lib /machine:i386 /def:$(@:.dll=.def)
|
||||
else
|
||||
$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS)
|
||||
$(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
|
||||
endif
|
||||
|
||||
%.o: %.c
|
||||
@@ -49,7 +52,7 @@ depend: $(SRCS)
|
||||
dep: depend
|
||||
|
||||
clean:
|
||||
rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so
|
||||
rm -f *.o *.d *~ .depend $(LIB) $(SLIBNAME) *$(SLIBSUF)
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile.bak .depend
|
||||
@@ -58,11 +61,11 @@ distclean: clean
|
||||
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)/libavutil-$(VERSION).so
|
||||
ln -sf libavutil-$(VERSION).so $(libdir)/libavutil.so
|
||||
install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/libavutil-$(VERSION)$(SLIBSUF)
|
||||
ln -sf libavutil-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME)
|
||||
$(LDCONFIG) || true
|
||||
endif
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user