[vlc-commits] Contribs: rewrite most of live555 rules
Jean-Baptiste Kempf
git at videolan.org
Thu Jan 19 19:00:53 CET 2017
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Jan 19 18:57:47 2017 +0100| [7641f2bb8c9c5b10cdf2af7427721fecccf5c839] | committer: Jean-Baptiste Kempf
Contribs: rewrite most of live555 rules
It now calls make && make install in the subfolders
It has a .pc file taken from Debian package
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7641f2bb8c9c5b10cdf2af7427721fecccf5c839
---
contrib/src/live555/add-pkgconfig-file.patch | 37 ++++++++++++++++++
contrib/src/live555/rules.mak | 57 +++++++++++++++-------------
2 files changed, 67 insertions(+), 27 deletions(-)
diff --git a/contrib/src/live555/add-pkgconfig-file.patch b/contrib/src/live555/add-pkgconfig-file.patch
new file mode 100644
index 0000000..6f477dc
--- /dev/null
+++ b/contrib/src/live555/add-pkgconfig-file.patch
@@ -0,0 +1,37 @@
+Description: Add a pkg-config file for the shared libraries.
+Author: Benjamin Drung <bdrung at debian.org>
+
+diff --git a/Makefile.tail b/Makefile.tail
+--- a/Makefile.tail
++++ b/Makefile.tail
+@@ -22,7 +22,12 @@
+ @echo
+ @echo "For more information about this source code (including your obligations under the LGPL), please see our FAQ at http://live555.com/liveMedia/faq.html"
+
+-install:
++install_shared_libraries:
++ install -d $(DESTDIR)$(LIBDIR)/pkgconfig
++ sed "s#@PREFIX@#$(PREFIX)#;s#@LIBDIR@#$(LIBDIR)#;s#@VERSION@#$(VERSION)#" live555.pc.in > $(DESTDIR)$(LIBDIR)/pkgconfig/live555.pc
++ chmod 644 $(DESTDIR)$(LIBDIR)/pkgconfig/live555.pc
++
++install: $(INSTALL2)
+ cd $(LIVEMEDIA_DIR) ; $(MAKE) install
+ cd $(GROUPSOCK_DIR) ; $(MAKE) install
+ cd $(USAGE_ENVIRONMENT_DIR) ; $(MAKE) install
+--- /dev/null 2017-01-19 15:35:15.538412775 +0100
++++ live.2016.07.19/live555.pc.in 2017-01-19 18:46:01.456059400 +0100
+@@ -0,0 +1,9 @@
++prefix=@PREFIX@
++libdir=@LIBDIR@
++includedir=${prefix}/include
++
++Name: live555
++Description: multimedia RTSP streaming library
++Version: @VERSION@
++Cflags: -I${includedir}/liveMedia -I${includedir}/groupsock -I${includedir}/BasicUsageEnvironment -I${includedir}/UsageEnvironment
++Libs: -L${libdir} -lliveMedia -lgroupsock -lBasicUsageEnvironment -lUsageEnvironment
+--- live.2016.07.19/Makefile.head.orig 2017-01-19 18:47:50.376062631 +0100
++++ live.2016.07.19/Makefile.head 2017-01-19 18:48:09.940063212 +0100
+@@ -1 +1,2 @@
++VERSION = $(shell grep LIVEMEDIA_LIBRARY_VERSION_STRING liveMedia/include/liveMedia_version.hh | sed 's/.*"\([^"]*\)".*/\1/')
+ ##### Change the following for your environment:
diff --git a/contrib/src/live555/rules.mak b/contrib/src/live555/rules.mak
index a1b4b9f..fae4be8 100644
--- a/contrib/src/live555/rules.mak
+++ b/contrib/src/live555/rules.mak
@@ -1,6 +1,7 @@
# live555
-LIVE555_FILE := live.2016.07.19.tar.gz
+LIVE555_VERSION := 2016.07.19
+LIVE555_FILE := live.$(LIVE555_VERSION).tar.gz
LIVEDOTCOM_URL := http://live555.com/liveMedia/public/$(LIVE555_FILE)
ifdef BUILD_NETWORK
@@ -37,43 +38,45 @@ endif
LIVE_EXTRA_CFLAGS := $(EXTRA_CFLAGS) -fexceptions $(CFLAGS)
live555: $(LIVE555_FILE) .sum-live555
- rm -Rf live
- $(UNPACK)
+ rm -Rf live && $(UNPACK)
+
+ # Change permissions to patch and sed the source
chmod -R u+w live
- (cd live && patch -fp1) < $(SRC)/live555/live555-nosignal.patch
+ # Remove hardcoded cc, c++, ar variables
cd live && sed -e 's%cc%$(CC)%' -e 's%c++%$(CXX)%' -e 's%LIBRARY_LINK =.*ar%LIBRARY_LINK = $(AR)%' -i.orig config.$(LIVE_TARGET)
+ # Replace libtool -s by ar cr for macOS only
cd live && sed -i.orig -e s/"libtool -s -o"/"ar cr"/g config.macosx*
- cd live && sed -i.orig \
- -e 's%$(CXX)%$(CXX)\ $(EXTRA_LDFLAGS)%' config.macosx
+ # Add Extra LDFLAGS for macOS
+ cd live && sed -i.orig -e 's%$(CXX)%$(CXX)\ $(EXTRA_LDFLAGS)%' config.macosx
+ # Add the Extra_CFLAGS to all config files
cd live && sed -i.orig \
-e 's%^\(COMPILE_OPTS.*\)$$%\1 '"$(LIVE_EXTRA_CFLAGS)%" config.*
+ # We want 64bits offsets and PIC on Linux
cd live && sed -e 's%-D_FILE_OFFSET_BITS=64%-D_FILE_OFFSET_BITS=64\ -fPIC\ -DPIC%' -i.orig config.linux
+ # Disable Locale for Solaris
cd live && sed -e 's%-DSOLARIS%-DSOLARIS -DXLOCALE_NOT_USED%' -i.orig config.solaris-*bit
ifdef HAVE_ANDROID
+ # Disable locale on Android too
cd live && sed -e 's%-DPIC%-DPIC -DNO_SSTREAM=1 -DLOCALE_NOT_USED -I$(ANDROID_NDK)/platforms/$(ANDROID_API)/arch-$(PLATFORM_SHORT_ARCH)/usr/include%' -i.orig config.linux
endif
- cd live && patch -lfp1 < ../../src/live555/winstore.patch
- mv live $@
- touch $@
+ mv live live.$(LIVE555_VERSION)
+ # Patch for MSG_NOSIGNAL
+ $(APPLY) $(SRC)/live555/live555-nosignal.patch
+ # Don't use FormatMessageA on WinRT
+ $(APPLY) $(SRC)/live555/winstore.patch
+ # Add a pkg-config file
+ $(APPLY) $(SRC)/live555/add-pkgconfig-file.patch
+
+ mv live.$(LIVE555_VERSION) $@ && touch $@
+
+SUBDIRS=groupsock liveMedia UsageEnvironment BasicUsageEnvironment
.live555: live555
+ cd $< && for subdir in $(SUBDIRS); do \
+ echo "PREFIX = $(PREFIX)" >> $$subdir/Makefile.head && \
+ echo "LIBDIR = $(PREFIX)/lib" >> $$subdir/Makefile.head ; done
+ cd $< && echo "LIBDIR = $(PREFIX)/lib" >> Makefile.head
cd $< && ./genMakefiles $(LIVE_TARGET)
- cd $< && $(MAKE) $(HOSTVARS) -C groupsock \
- && $(MAKE) $(HOSTVARS) -C liveMedia \
- && $(MAKE) $(HOSTVARS) -C UsageEnvironment \
- && $(MAKE) $(HOSTVARS) -C BasicUsageEnvironment
- mkdir -p -- "$(PREFIX)/lib" "$(PREFIX)/include/liveMedia"
- cp \
- $</groupsock/libgroupsock.a \
- $</liveMedia/libliveMedia.a \
- $</UsageEnvironment/libUsageEnvironment.a \
- $</BasicUsageEnvironment/libBasicUsageEnvironment.a \
- "$(PREFIX)/lib/"
- cp \
- $</groupsock/include/*.hh \
- $</groupsock/include/*.h \
- $</liveMedia/include/*.hh \
- $</UsageEnvironment/include/*.hh \
- $</BasicUsageEnvironment/include/*.hh \
- "$(PREFIX)/include/liveMedia"
+ cd $< && for subdir in $(SUBDIRS); do $(MAKE) $(HOSTVARS) -C $$subdir; done
+ cd $< && for subdir in $(SUBDIRS); do $(MAKE) $(HOSTVARS) -C $$subdir install; done
touch $@
More information about the vlc-commits
mailing list