$NetBSD$

--- libavcodec/Makefile.orig	2005-11-21 20:00:39.000000000 +1030
+++ libavcodec/Makefile	2006-04-23 20:52:11.000000000 +0930
@@ -384,6 +384,9 @@
 endif
 TESTS= imgresample-test dct-test motion-test fft-test
 
+install: all
+	$(LIBTOOL) --mode=install $(BSD_INSTALL_DATA) $(LIB:.a=.la) $(prefix)/lib
+
 all: $(LIB) $(SLIBNAME)
 
 amrlibs:
@@ -393,8 +396,8 @@
 
 $(LIB): $(OBJS) $(AMRLIBS)
 	rm -f $@
-	$(AR) rc $@ $(OBJS) $(AMREXTRALIBS)
-	$(RANLIB) $@
+	$(LIBTOOL) --mode=link $(CC) -o $(LIB:.a=.la) $(OBJS:.o=.lo) -rpath $(prefix)/lib $(EXTRALIBS) $(AMREXTRALIBS)
+
 
 $(SLIBNAME): $(OBJS)
 ifeq ($(CONFIG_PP),yes)
@@ -413,13 +416,10 @@
 	$(MAKE) -C libpostproc
 
 %.o: %.c
-	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< 
+	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $<
 
 %.o: %.S
-	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
-
-depend: $(SRCS)
-	$(CC) -MM $(CFLAGS) $^ 1>.depend
+	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $<
 
 dep:	depend
 
