--- librtmp/Makefile.orig 2016-02-29 01:15:13 UTC +++ librtmp/Makefile @@ -1,19 +1,21 @@ VERSION=v2.4 -prefix=/usr/local +prefix=$(PREFIX) incdir=$(prefix)/include/librtmp bindir=$(prefix)/bin libdir=$(prefix)/lib +libdatadir=$(prefix)/libdata mandir=$(prefix)/man BINDIR=$(DESTDIR)$(bindir) INCDIR=$(DESTDIR)$(incdir) LIBDIR=$(DESTDIR)$(libdir) +LIBDATADIR=$(DESTDIR)$(libdatadir) MANDIR=$(DESTDIR)$(mandir) -CC=$(CROSS_COMPILE)gcc -LD=$(CROSS_COMPILE)ld -AR=$(CROSS_COMPILE)ar +CC?=$(CROSS_COMPILE)gcc +LD?=$(CROSS_COMPILE)ld +AR?=$(CROSS_COMPILE)ar SYS=posix CRYPTO=OPENSSL @@ -23,14 +25,14 @@ DEF_OPENSSL=-DUSE_OPENSSL DEF_GNUTLS=-DUSE_GNUTLS DEF_=-DNO_CRYPTO REQ_GNUTLS=gnutls,hogweed,nettle -REQ_OPENSSL=libssl,libcrypto +#REQ_OPENSSL=libssl,libcrypto PUB_GNUTLS=-lgmp LIBZ=-lz LIBS_posix= LIBS_darwin= LIBS_mingw=-lws2_32 -lwinmm -lgdi32 LIB_GNUTLS=-lgnutls -lhogweed -lnettle -lgmp $(LIBZ) -LIB_OPENSSL=-lssl -lcrypto $(LIBZ) +LIB_OPENSSL=-L$(OPENSSLLIB) -lssl -lcrypto $(LIBZ) LIB_POLARSSL=-lpolarssl $(LIBZ) PRIVATE_LIBS=$(LIBS_$(SYS)) CRYPTO_LIB=$(LIB_$(CRYPTO)) $(PRIVATE_LIBS) @@ -74,8 +76,9 @@ SO_INST=$(SOINST_$(SHARED)) DEF=-DRTMPDUMP_VERSION=\"$(VERSION)\" $(CRYPTO_DEF) $(XDEF) OPT=-O2 -CFLAGS=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT) $(SO_DEF) -LDFLAGS=$(XLDFLAGS) +#CFLAGS=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT) $(SO_DEF) +CFLAGS+=$(DEF) $(SO_DEF) +#LDFLAGS=$(XLDFLAGS) OBJS=rtmp.o log.o amf.o hashswf.o parseurl.o @@ -102,20 +105,22 @@ librtmp.pc: librtmp.pc.in Makefile sed -e "s;@prefix@;$(prefix);" -e "s;@libdir@;$(libdir);" \ -e "s;@VERSION@;$(VERSION);" \ -e "s;@CRYPTO_REQ@;$(CRYPTO_REQ);" \ + -e "s;@OPENSSLLIB@;$(OPENSSLLIB);" \ + -e "s;@OPENSSLINC@;$(OPENSSLINC);" \ -e "s;@PUBLIC_LIBS@;$(PUBLIC_LIBS);" \ -e "s;@PRIVATE_LIBS@;$(PRIVATE_LIBS);" librtmp.pc.in > $@ install: install_base $(SO_INST) install_base: librtmp.a librtmp.pc - -mkdir -p $(INCDIR) $(LIBDIR)/pkgconfig $(MANDIR)/man3 $(SODIR) + -mkdir -p $(INCDIR) $(LIBDATADIR)/pkgconfig $(MANDIR)/man3 $(SODIR) cp amf.h http.h log.h rtmp.h $(INCDIR) cp librtmp.a $(LIBDIR) - cp librtmp.pc $(LIBDIR)/pkgconfig + cp librtmp.pc $(LIBDATADIR)/pkgconfig cp librtmp.3 $(MANDIR)/man3 install_so: librtmp$(SO_EXT) - cp librtmp$(SO_EXT) $(SODIR) + ${BSD_INSTALL_LIB} librtmp$(SO_EXT) $(SODIR) $(INSTALL_IMPLIB) cd $(SODIR); ln -sf librtmp$(SO_EXT) librtmp.$(SOX)