2cff19e54a
This is the latest git version of the program (from 2015 though). Switch the build to use gnutls for the command line program, since openssl 1.1 is not supported. Various changes since the last released version, but only git log available. Mostly bugfixes. Update bl3.mk file: neither zlib nor openssl nor gnutls headers/libraries are used by the library, so remove all bl3.mk includes.
100 lines
2.8 KiB
Text
100 lines
2.8 KiB
Text
$NetBSD: patch-librtmp_Makefile,v 1.6 2018/09/23 21:09:33 wiz Exp $
|
|
|
|
Use PREFIX and PKGMANDIR.
|
|
Remove OPT.
|
|
Libtoolize
|
|
Choose gnutls.
|
|
|
|
--- librtmp/Makefile.orig 2018-09-23 10:40:58.000000000 +0000
|
|
+++ librtmp/Makefile
|
|
@@ -1,11 +1,11 @@
|
|
VERSION=v2.4
|
|
|
|
-prefix=/usr/local
|
|
+prefix=${PREFIX}
|
|
|
|
incdir=$(prefix)/include/librtmp
|
|
bindir=$(prefix)/bin
|
|
libdir=$(prefix)/lib
|
|
-mandir=$(prefix)/man
|
|
+mandir=$(prefix)/${PKGMANDIR}
|
|
BINDIR=$(DESTDIR)$(bindir)
|
|
INCDIR=$(DESTDIR)$(incdir)
|
|
LIBDIR=$(DESTDIR)$(libdir)
|
|
@@ -16,8 +16,8 @@ LD=$(CROSS_COMPILE)ld
|
|
AR=$(CROSS_COMPILE)ar
|
|
|
|
SYS=posix
|
|
-CRYPTO=OPENSSL
|
|
-#CRYPTO=GNUTLS
|
|
+#CRYPTO=OPENSSL
|
|
+CRYPTO=GNUTLS
|
|
DEF_POLARSSL=-DUSE_POLARSSL
|
|
DEF_OPENSSL=-DUSE_OPENSSL
|
|
DEF_GNUTLS=-DUSE_GNUTLS
|
|
@@ -73,30 +73,42 @@ SO_LIB=$(SOLIB_$(SHARED))
|
|
SO_INST=$(SOINST_$(SHARED))
|
|
|
|
DEF=-DRTMPDUMP_VERSION=\"$(VERSION)\" $(CRYPTO_DEF) $(XDEF)
|
|
-OPT=-O2
|
|
CFLAGS=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT) $(SO_DEF)
|
|
LDFLAGS=$(XLDFLAGS)
|
|
|
|
|
|
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.pc
|
|
|
|
-librtmp.a: $(OBJS)
|
|
- $(AR) rs $@ $?
|
|
-
|
|
-librtmp$(SO_EXT): $(OBJS)
|
|
- $(CC) $(SO_LDFLAGS) $(LDFLAGS) -o $@ $^ $> $(CRYPTO_LIB)
|
|
+librtmp.la: $(OBJS)
|
|
+ ${LIBTOOL} --mode=link --tag=CC \
|
|
+ ${CC} ${LDFLAGS} -o ${.TARGET:.a=.la} \
|
|
+ ${OBJS:.o=.lo} \
|
|
+ -rpath ${PREFIX}/lib
|
|
+
|
|
+librtmp.$(SO_EXT): $(OBJS)
|
|
+ ${LIBTOOL} --mode=link --tag=CC \
|
|
+ ${CC} ${LDFLAGS} -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);" \
|
|
@@ -105,12 +117,12 @@ librtmp.pc: librtmp.pc.in Makefile
|
|
-e "s;@PUBLIC_LIBS@;$(PUBLIC_LIBS);" \
|
|
-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 $(SODIR)
|
|
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
|
|
|