[vlc-commits] contrib: srt: Patch to add implicit link libraries to pkgconfig file

David Fuhrmann git at videolan.org
Sat Dec 9 10:21:27 CET 2017


vlc/vlc-3.0 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Fri Dec  8 19:53:35 2017 +0100| [810fab000f46eb9c1192ed823742b20e1ab45531] | committer: Konstantin Pavlov

contrib: srt: Patch to add implicit link libraries to pkgconfig file

This library needs to add implicit link libraries like -lstdc++
to the private pkgconfig linking flags inside the pc file, to allow
linking with a non-C++ module (like we have in VLC).

(cherry picked from commit 0a57721d8811dd607b9f85556212b9702c979b6e)
Signed-off-by: Konstantin Pavlov <thresh at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=810fab000f46eb9c1192ed823742b20e1ab45531
---

 contrib/src/srt/add-implicit-link-libraries.patch | 25 +++++++++++++++++++++++
 contrib/src/srt/rules.mak                         |  1 +
 2 files changed, 26 insertions(+)

diff --git a/contrib/src/srt/add-implicit-link-libraries.patch b/contrib/src/srt/add-implicit-link-libraries.patch
new file mode 100644
index 0000000000..c007c1f394
--- /dev/null
+++ b/contrib/src/srt/add-implicit-link-libraries.patch
@@ -0,0 +1,25 @@
+--- srt.old/CMakeLists.txt	2017-12-09 09:10:02.000000000 +0100
++++ srt/CMakeLists.txt	2017-12-09 09:18:38.000000000 +0100
+@@ -425,13 +425,15 @@
+ # This may cause trouble when you want to compile your app with static libstdc++;
+ # if your build requires it, you'd probably remove -lstdc++ from the list
+ # obtained by `pkg-config --libs`.
+-#
+-# Some sensible solution for that is desired. Currently turned on only on demand.
+-if (ENABLE_C_DEPS)
+-if ( LINUX )
+-	set (IFNEEDED_SRT_LDFLAGS "${IFNEEDED_SRT_LDFLAGS} -lstdc++ -lm")
+-endif()
+-endif()
++
++message("Adding the following implicit link libraries: ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}")
++foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES})
++    if(IS_ABSOLUTE ${LIB} AND EXISTS ${LIB})
++	    set(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ${LIB})
++    else()
++        set(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} "-l${LIB}")
++    endif()
++endforeach()
+ 
+ join_arguments(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE})
+ 
diff --git a/contrib/src/srt/rules.mak b/contrib/src/srt/rules.mak
index b263bff61c..3ffdfb4d55 100644
--- a/contrib/src/srt/rules.mak
+++ b/contrib/src/srt/rules.mak
@@ -24,6 +24,7 @@ $(TARBALLS)/srt-$(SRT_VERSION).tar.gz:
 srt: srt-$(SRT_VERSION).tar.gz .sum-srt
 	$(UNPACK)
 	$(APPLY) $(SRC)/srt/fix-pc.patch
+	$(APPLY) $(SRC)/srt/add-implicit-link-libraries.patch
 	$(call pkg_static,"scripts/haisrt.pc.in")
 	mv srt-$(SRT_VERSION) $@ && touch $@
 



More information about the vlc-commits mailing list