$NetBSD: patch-librtmp_Makefile,v 1.1 2011/10/05 21:41:25 ryoon Exp $

Libtoolize

--- librtmp/Makefile	2011-07-12 12:24:33.000000000 +1200
+++ librtmp/Makefile	2011-10-08 17:59:54.713362187 +1300
@@ -73,23 +73,35 @@
 
 OBJS=rtmp.o log.o amf.o hashswf.o parseurl.o
 
-all:	librtmp.a $(SO_LIB)
+all:	librtmp.la
 
 clean:
 	rm -f *.o *.a *.$(SOX) *.$(SO_EXT)
 
-librtmp.a: $(OBJS)
-	$(AR) rs $@ $?
+librtmp.la: $(OBJS)
+	${LIBTOOL} --mode=link --tag=CC \
+		${CC} -o ${.TARGET:.a=.la} \
+			${OBJS:.o=.lo} \
+			-rpath ${PREFIX}/lib
 
 librtmp.$(SO_EXT): $(OBJS)
-	$(CC) $(SO_LDFLAGS) $(LDFLAGS) -o $@ $^ $> $(CRYPTO_LIB)
+	${LIBTOOL} --mode=link --tag=CC \
+		${CC} -o ${.TARGET:.a=.la} \
+		${OBJS:.o=.lo} \
+		-rpath ${PREFIX}/lib \
+		-version-info 0:0
 	ln -sf $@ librtmp.$(SOX)
 
 log.o: log.c log.h Makefile
+	${LIBTOOL} --mode=compile --tag=CC ${CC} ${CFLAGS} -c log.c
 rtmp.o: rtmp.c rtmp.h rtmp_sys.h handshake.h dh.h log.h amf.h Makefile
+	${LIBTOOL} --mode=compile --tag=CC ${CC} ${CFLAGS} -c rtmp.c
 amf.o: amf.c amf.h bytes.h log.h Makefile
+	${LIBTOOL} --mode=compile --tag=CC ${CC} ${CFLAGS} -c amf.c
 hashswf.o: hashswf.c http.h rtmp.h rtmp_sys.h Makefile
+	${LIBTOOL} --mode=compile --tag=CC ${CC} ${CFLAGS} -c hashswf.c
 parseurl.o: parseurl.c rtmp.h rtmp_sys.h log.h Makefile
+	${LIBTOOL} --mode=compile --tag=CC ${CC} ${CFLAGS} -c parseurl.c
 
 librtmp.pc: librtmp.pc.in Makefile
 	sed -e "s;@prefix@;$(prefix);" -e "s;@libdir@;$(libdir);" \
@@ -97,12 +109,12 @@
 		-e "s;@CRYPTO_REQ@;$(CRYPTO_REQ);" \
 		-e "s;@PRIVATE_LIBS@;$(PRIVATE_LIBS);" librtmp.pc.in > $@
 
-install:	install_base $(SO_INST)
+install:	install_base
 
-install_base:	librtmp.a librtmp.pc
+install_base:	librtmp.la librtmp.pc
 	-mkdir -p $(INCDIR) $(LIBDIR)/pkgconfig $(MANDIR)/man3
 	cp amf.h http.h log.h rtmp.h $(INCDIR)
-	cp librtmp.a $(LIBDIR)
+	${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} librtmp.la $(LIBDIR)
 	cp librtmp.pc $(LIBDIR)/pkgconfig
 	cp librtmp.3 $(MANDIR)/man3
 
