$NetBSD: patch-ad,v 1.3 2004/08/29 22:43:50 wiz Exp $

--- libavformat/Makefile.orig	2003-09-28 17:26:40.000000000 +0200
+++ libavformat/Makefile	2004-08-14 14:50:54.000000000 +0200
@@ -60,6 +60,11 @@
 
 ifeq ($(CONFIG_VORBIS),yes)
 OBJS+= ogg.o
+EXTRALIBS+= -lvorbis -lvorbisenc
+endif
+
+ifeq ($(CONFIG_MP3LAME),yes)
+EXTRALIBS += -lmp3lame
 endif
 
 LIB= $(LIBPREF)avformat$(LIBSUF)
@@ -69,12 +74,14 @@
 
 SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
 
+install: all
+	$(LIBTOOL) --mode=install $(BSD_INSTALL_DATA) $(LIB:.a=.la) $(prefix)/lib
+
 all: $(LIB) $(SLIB)
 
 $(LIB): $(OBJS) $(PPOBJS)
 	rm -f $@
-	$(AR) rc $@ $(OBJS) $(PPOBJS)
-	$(RANLIB) $@
+	$(LIBTOOL) --mode=link $(CC) -o $(LIB:.a=.la) $(OBJS:.o=.lo)  $(PPOBJS:.o=.lo) -rpath $(prefix)/lib $(LIBOSSAUDIO) $(EXTRALIBS)
 
 $(SLIB): $(OBJS)
 ifeq ($(CONFIG_WIN32),yes)
@@ -84,9 +91,6 @@
 	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS)
 endif
 
-depend: $(SRCS)
-	$(CC) -MM $(CFLAGS) $^ 1>.depend
-
 ifeq ($(BUILD_SHARED),yes)
 install: all install-headers
 ifeq ($(CONFIG_WIN32),yes)
@@ -112,11 +116,11 @@
                 "$(prefix)/include/ffmpeg"
 
 %.o: %.c
-	$(CC) $(CFLAGS) -c -o $@ $< 
+	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $< 
 
 # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
 %.o: %.cpp
-	g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $< 
+	$(LIBTOOL) --mode=compile $(CXX) $(subst -Wall,,$(CFLAGS)) -c -o $@ $< 
 
 clean: 
 	rm -f *.o *.d .depend *~ *.a $(LIB)
