All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] Openjpeg: Fix autobuild issues - static compilation
@ 2016-09-18 20:56 Olivier Schonken
  2016-09-18 20:56 ` [Buildroot] [PATCH 1/2] Openjpeg: Add patch to enable finding pthreads library by default Olivier Schonken
  2016-09-18 20:56 ` [Buildroot] [PATCH 2/2] Openjpeg: Build third party dependencies for static library Olivier Schonken
  0 siblings, 2 replies; 5+ messages in thread
From: Olivier Schonken @ 2016-09-18 20:56 UTC (permalink / raw)
  To: buildroot

For Static libraries, let openjpeg build third party libraries lzma,tiff,etc.
Add Cmake directives to find pthreads and link against pthread libs by default

m68k | openjpeg-2.1 | http://autobuild.buildroot.net/results/2ca3e1b0eaadaf0cf5bf2fde756163ac5786a21c
arm  | openjpeg-2.1 | http://autobuild.buildroot.net/results/5d1184052e1cc7e9da1244d23c5932de4ad0c435
sh4  | openjpeg-2.1 | http://autobuild.buildroot.net/results/6e36f1ab549bd130ebbc6178576a7cfb2e5fe5ad

Olivier Schonken (2):
  Openjpeg: Add patch to enable finding pthreads library by default
  Openjpeg: Build third party dependencies for static library

 ...eLists-to-include-finding-of-pthreads-by-.patch | 49 ++++++++++++++++++++++
 package/openjpeg/openjpeg.mk                       |  3 ++
 2 files changed, 52 insertions(+)
 create mode 100644 package/openjpeg/0001-Modify-CmakeLists-to-include-finding-of-pthreads-by-.patch

-- 
2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] Openjpeg: Add patch to enable finding pthreads library by default
  2016-09-18 20:56 [Buildroot] [PATCH 0/2] Openjpeg: Fix autobuild issues - static compilation Olivier Schonken
@ 2016-09-18 20:56 ` Olivier Schonken
  2016-09-19  5:23   ` Thomas Petazzoni
  2016-09-18 20:56 ` [Buildroot] [PATCH 2/2] Openjpeg: Build third party dependencies for static library Olivier Schonken
  1 sibling, 1 reply; 5+ messages in thread
From: Olivier Schonken @ 2016-09-18 20:56 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com>
---
 ...eLists-to-include-finding-of-pthreads-by-.patch | 49 ++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 package/openjpeg/0001-Modify-CmakeLists-to-include-finding-of-pthreads-by-.patch

diff --git a/package/openjpeg/0001-Modify-CmakeLists-to-include-finding-of-pthreads-by-.patch b/package/openjpeg/0001-Modify-CmakeLists-to-include-finding-of-pthreads-by-.patch
new file mode 100644
index 0000000..c31ad06
--- /dev/null
+++ b/package/openjpeg/0001-Modify-CmakeLists-to-include-finding-of-pthreads-by-.patch
@@ -0,0 +1,49 @@
+From 0465bc4be814f01073cd31bbd6ad1f3a87a599c1 Mon Sep 17 00:00:00 2001
+From: Olivier Schonken <olivier.schonken@gmail.com>
+Date: Sun, 18 Sep 2016 22:23:06 +0200
+Subject: [PATCH] Modify CmakeLists to include finding of pthreads by default
+
+Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com>
+---
+ CMakeLists.txt             | 8 ++++----
+ src/bin/jp2/CMakeLists.txt | 2 +-
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 229da1e..66cf631 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -219,13 +219,13 @@ OPJ_TEST_LARGE_FILES(OPJ_HAVE_LARGEFILES)
+ 
+ #-----------------------------------------------------------------------------
+ # Build Library
++find_package(Threads REQUIRED)
++if(NOT CMAKE_USE_PTHREADS_INIT)
++  message(FATAL_ERROR "Only pthread are supported")
++endif()
+ if(BUILD_JPIP_SERVER)
+   find_package(CURL REQUIRED)
+   find_package(FCGI REQUIRED)
+-  find_package(Threads REQUIRED)
+-  if(NOT CMAKE_USE_PTHREADS_INIT)
+-    message(FATAL_ERROR "Only pthread are supported")
+-  endif()
+ endif()
+ add_subdirectory(src/lib)
+ 
+diff --git a/src/bin/jp2/CMakeLists.txt b/src/bin/jp2/CMakeLists.txt
+index 1c2ef39..ae35f0c 100644
+--- a/src/bin/jp2/CMakeLists.txt
++++ b/src/bin/jp2/CMakeLists.txt
+@@ -32,7 +32,7 @@ endif()
+ foreach(exe opj_decompress opj_compress opj_dump)
+   add_executable(${exe} ${exe}.c ${common_SRCS})
+   target_link_libraries(${exe} ${OPENJPEG_LIBRARY_NAME}
+-    ${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME}
++    ${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME} ${CMAKE_THREAD_LIBS_INIT}
+     )
+   # To support universal exe:
+   if(ZLIB_FOUND AND APPLE)
+-- 
+2.7.4
+
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] Openjpeg: Build third party dependencies for static library
  2016-09-18 20:56 [Buildroot] [PATCH 0/2] Openjpeg: Fix autobuild issues - static compilation Olivier Schonken
  2016-09-18 20:56 ` [Buildroot] [PATCH 1/2] Openjpeg: Add patch to enable finding pthreads library by default Olivier Schonken
@ 2016-09-18 20:56 ` Olivier Schonken
  2016-09-19  3:41   ` Thomas Petazzoni
  1 sibling, 1 reply; 5+ messages in thread
From: Olivier Schonken @ 2016-09-18 20:56 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com>
---
 package/openjpeg/openjpeg.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/openjpeg/openjpeg.mk b/package/openjpeg/openjpeg.mk
index bf12526..08192a7 100644
--- a/package/openjpeg/openjpeg.mk
+++ b/package/openjpeg/openjpeg.mk
@@ -9,6 +9,9 @@ OPENJPEG_SITE = $(call github,uclouvain,openjpeg,version.$(OPENJPEG_VERSION))
 OPENJPEG_LICENSE = BSD-2c
 OPENJPEG_LICENSE_FILES = LICENSE
 OPENJPEG_INSTALL_STAGING = YES
+ifeq ($(BR2_STATIC_LIBS),y)
+OPENJPEG_CONF_OPTS = -DBUILD_THIRDPARTY=ON
+endif
 
 OPENJPEG_DEPENDENCIES += $(if $(BR2_PACKAGE_ZLIB),zlib)
 OPENJPEG_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBPNG),libpng)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] Openjpeg: Build third party dependencies for static library
  2016-09-18 20:56 ` [Buildroot] [PATCH 2/2] Openjpeg: Build third party dependencies for static library Olivier Schonken
@ 2016-09-19  3:41   ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2016-09-19  3:41 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 18 Sep 2016 22:56:19 +0200, Olivier Schonken wrote:

> +ifeq ($(BR2_STATIC_LIBS),y)
> +OPENJPEG_CONF_OPTS = -DBUILD_THIRDPARTY=ON
> +endif

If I understand correctly, this tells OpenJPEG to build its internal
copy of lzma, tiff and other libraries. Is this correct?

If it is, then it is not the proper solution to the problem. Regardless
of whether we're static linking or dynamic linking, we want to use the
external libraries (i.e provided by the corresponding Buildroot
packages).

Also, your commit log lacks a reference to the autobuilder failure
being fixed (I know they are in the cover letter, but the cover letter
doesn't get committed, which is why we want the explanation and the
autobuilder reference to be in the commit lot itself).

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] Openjpeg: Add patch to enable finding pthreads library by default
  2016-09-18 20:56 ` [Buildroot] [PATCH 1/2] Openjpeg: Add patch to enable finding pthreads library by default Olivier Schonken
@ 2016-09-19  5:23   ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2016-09-19  5:23 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 18 Sep 2016 22:56:18 +0200, Olivier Schonken wrote:
> Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com>

Missing commit log and autobuilder reference.

> diff --git a/package/openjpeg/0001-Modify-CmakeLists-to-include-finding-of-pthreads-by-.patch b/package/openjpeg/0001-Modify-CmakeLists-to-include-finding-of-pthreads-by-.patch
> new file mode 100644
> index 0000000..c31ad06
> --- /dev/null
> +++ b/package/openjpeg/0001-Modify-CmakeLists-to-include-finding-of-pthreads-by-.patch
> @@ -0,0 +1,49 @@
> +From 0465bc4be814f01073cd31bbd6ad1f3a87a599c1 Mon Sep 17 00:00:00 2001
> +From: Olivier Schonken <olivier.schonken@gmail.com>
> +Date: Sun, 18 Sep 2016 22:23:06 +0200
> +Subject: [PATCH] Modify CmakeLists to include finding of pthreads by default
> +
> +Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com>
> +---
> + CMakeLists.txt             | 8 ++++----
> + src/bin/jp2/CMakeLists.txt | 2 +-
> + 2 files changed, 5 insertions(+), 5 deletions(-)
> +
> +diff --git a/CMakeLists.txt b/CMakeLists.txt
> +index 229da1e..66cf631 100644
> +--- a/CMakeLists.txt
> ++++ b/CMakeLists.txt
> +@@ -219,13 +219,13 @@ OPJ_TEST_LARGE_FILES(OPJ_HAVE_LARGEFILES)
> + 
> + #-----------------------------------------------------------------------------
> + # Build Library
> ++find_package(Threads REQUIRED)
> ++if(NOT CMAKE_USE_PTHREADS_INIT)
> ++  message(FATAL_ERROR "Only pthread are supported")
> ++endif()
> + if(BUILD_JPIP_SERVER)
> +   find_package(CURL REQUIRED)
> +   find_package(FCGI REQUIRED)
> +-  find_package(Threads REQUIRED)
> +-  if(NOT CMAKE_USE_PTHREADS_INIT)
> +-    message(FATAL_ERROR "Only pthread are supported")
> +-  endif()
> + endif()
> + add_subdirectory(src/lib)

While I agree that this will work around the build issue
http://autobuild.buildroot.net/results/2ca/2ca3e1b0eaadaf0cf5bf2fde756163ac5786a21c/build-end.log,
it is not really the proper solution.

The problem here is that lcms2 uses pthread, but the pkg-config file
installed by lcms2 doesn't take this into account.

So the proper fix is to change the lcms2.pc file so that it includes
-lpthread in Libs.private. Could you have a look at doing this?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-19  5:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-18 20:56 [Buildroot] [PATCH 0/2] Openjpeg: Fix autobuild issues - static compilation Olivier Schonken
2016-09-18 20:56 ` [Buildroot] [PATCH 1/2] Openjpeg: Add patch to enable finding pthreads library by default Olivier Schonken
2016-09-19  5:23   ` Thomas Petazzoni
2016-09-18 20:56 ` [Buildroot] [PATCH 2/2] Openjpeg: Build third party dependencies for static library Olivier Schonken
2016-09-19  3:41   ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.