[vlc-commits] contrib: openjpeg: import pthreads library where necessary

Sean McGovern git at videolan.org
Thu Dec 7 23:26:00 CET 2017


vlc/vlc-3.0 | branch: master | Sean McGovern <gseanmcg at gmail.com> | Thu Dec  7 06:31:01 2017 -0500| [387002347f003cf821253eea4c1482ae0e57bf72] | committer: Jean-Baptiste Kempf

contrib: openjpeg: import pthreads library where necessary

(cherry picked from commit 81d9ee001960d515904072d3af7e2673da9417ae)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 contrib/src/openjpeg/openjp2_pthread.patch | 39 ++++++++++++++++++++++++++++++
 contrib/src/openjpeg/rules.mak             |  1 +
 2 files changed, 40 insertions(+)

diff --git a/contrib/src/openjpeg/openjp2_pthread.patch b/contrib/src/openjpeg/openjp2_pthread.patch
new file mode 100644
index 0000000000..2065f58dae
--- /dev/null
+++ b/contrib/src/openjpeg/openjp2_pthread.patch
@@ -0,0 +1,39 @@
+--- openjpeg/src/lib/openjp2/libopenjp2.pc.cmake.in.ORIG	2017-10-04 18:23:14.000000000 -0400
++++ openjpeg/src/lib/openjp2/libopenjp2.pc.cmake.in	2017-12-05 19:05:07.578239280 -0500
+@@ -10,5 +10,5 @@
+ URL: http://www.openjpeg.org/
+ Version: @OPENJPEG_VERSION@
+ Libs: -L${libdir} -lopenjp2
+-Libs.private: -lm
++Libs.private: -lm @PTHREAD_LIBS@
+ Cflags: -I${includedir}
+--- openjpeg/src/lib/openjp2/CMakeLists.txt.ORIG	2017-12-05 19:24:42.152312033 -0500
++++ openjpeg/src/lib/openjp2/CMakeLists.txt	2017-12-05 19:25:35.097306981 -0500
+@@ -188,6 +188,7 @@
+ endif(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_WIN32_THREADS_INIT )
+ 
+ if(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT )
++   set(PTHREAD_LIBS ${CMAKE_THREAD_LIBS_INIT})
+    add_definitions( -DMUTEX_pthread)
+ endif(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT )
+ 
+@@ -216,3 +216,8 @@
+         target_link_libraries(test_sparse_array ${CMAKE_THREAD_LIBS_INIT})
+     endif(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
+ endif(BUILD_UNIT_TESTS)
++
++if(UNIX)
++    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libopenjp2.pc.cmake.in
++                   ${PROJECT_BINARY_DIR}/libopenjp2.pc @ONLY)
++endif(UNIX)
+--- openjpeg/CMakeLists.txt.ORIG	2017-10-04 18:23:14.000000000 -0400
++++ openjpeg/CMakeLists.txt	2017-12-05 19:43:35.573788173 -0500
+@@ -359,8 +359,6 @@
+ endif()
+ if(BUILD_PKGCONFIG_FILES)
+   # install in lib and not share (see multi-arch note above)
+-  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp2/libopenjp2.pc.cmake.in
+-    ${CMAKE_CURRENT_BINARY_DIR}/libopenjp2.pc @ONLY)
+   install( FILES  ${CMAKE_CURRENT_BINARY_DIR}/libopenjp2.pc DESTINATION
+     ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
+ #
diff --git a/contrib/src/openjpeg/rules.mak b/contrib/src/openjpeg/rules.mak
index a966c0a21a..e41056c10d 100644
--- a/contrib/src/openjpeg/rules.mak
+++ b/contrib/src/openjpeg/rules.mak
@@ -17,6 +17,7 @@ endif
 #	$(APPLY) $(SRC)/openjpeg/restrict.patch
 	$(APPLY) $(SRC)/openjpeg/install.patch
 	$(APPLY) $(SRC)/openjpeg/pic.patch
+	$(APPLY) $(SRC)/openjpeg/openjp2_pthread.patch
 	$(call pkg_static,"./src/lib/openjp2/libopenjp2.pc.cmake.in")
 	$(MOVE)
 



More information about the vlc-commits mailing list