* [Buildroot] [PATCH] cmake: use system libzma when the xz package is enabled
@ 2015-03-04 11:07 Fabio Porcedda
2015-03-04 11:13 ` Thomas Petazzoni
0 siblings, 1 reply; 4+ messages in thread
From: Fabio Porcedda @ 2015-03-04 11:07 UTC (permalink / raw)
To: buildroot
Fix build failure:
.../output/build/host-cmake-3.1.3/Utilities/cmliblzma/liblzma/common/block_buffer_decoder.c:17:1: error: conflicting types for ?lzma_block_buffer_decode?
lzma_block_buffer_decode(lzma_block *block, lzma_allocator *allocator,
^
In file included from /home/tetsuya/buildroot/br2/output/host/usr/include/lzma.h:296:0,
from /home/tetsuya/buildroot/br2/output/build/host-cmake-3.1.3/Utilities/cmliblzma/liblzma/common/common.h:34,
from /home/tetsuya/buildroot/br2/output/build/host-cmake-3.1.3/Utilities/cmliblzma/liblzma/common/block_decoder.h:16,
from /home/tetsuya/buildroot/br2/output/build/host-cmake-3.1.3/Utilities/cmliblzma/liblzma/common/block_buffer_decoder.c:13:
/home/tetsuya/buildroot/br2/output/host/usr/include/lzma/block.h:577:27: note: previous declaration of ?lzma_block_buffer_decode? was here
extern LZMA_API(lzma_ret) lzma_block_buffer_decode(
^
Utilities/cmliblzma/CMakeFiles/cmliblzma.dir/build.make:261: recipe for target 'Utilities/cmliblzma/CMakeFiles/cmliblzma.dir/liblzma/common/block_buffer_decoder.c.o' failed
make[3]: *** [Utilities/cmliblzma/CMakeFiles/cmliblzma.dir/liblzma/common/block_buffer_decoder.c.o] Error 1
Fixes:
http://autobuild.buildroot.org/results/4edf6e169dc4a00d8a8bd16a86eba2316cbbd9e5
http://autobuild.buildroot.org/results/a9ff38b22a36a2f8427d33085d3263a8cbfbd746
http://autobuild.buildroot.org/results/ecaa0227249207b5450519832a193c1585ac8177
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
---
package/cmake/cmake.mk | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/package/cmake/cmake.mk b/package/cmake/cmake.mk
index 8c64b58..4b53559 100644
--- a/package/cmake/cmake.mk
+++ b/package/cmake/cmake.mk
@@ -12,6 +12,11 @@ CMAKE_LICENSE_FILES = Copyright.txt
HOST_CMAKE_DEPENDENCIES = host-pkgconf
+ifeq ($(BR2_PACKAGE_XZ),y)
+ HOST_CMAKE_DEPENDENCIES += host-xz
+ HOST_CMAKE_CONF_OPTS += -DCMAKE_USE_SYSTEM_LIBLZMA=ON
+endif
+
define HOST_CMAKE_CONFIGURE_CMDS
(cd $(@D); \
LDFLAGS="$(HOST_LDFLAGS)" \
@@ -22,6 +27,7 @@ define HOST_CMAKE_CONFIGURE_CMDS
-DCMAKE_CXX_FLAGS="$(HOST_CXXFLAGS)" \
-DCMAKE_EXE_LINKER_FLAGS="$(HOST_LDFLAGS)" \
-DBUILD_CursesDialog=OFF \
+ $(HOST_CMAKE_CONF_OPTS) \
)
endef
--
2.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] cmake: use system libzma when the xz package is enabled
2015-03-04 11:07 [Buildroot] [PATCH] cmake: use system libzma when the xz package is enabled Fabio Porcedda
@ 2015-03-04 11:13 ` Thomas Petazzoni
2015-03-05 0:03 ` Fabio Porcedda
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2015-03-04 11:13 UTC (permalink / raw)
To: buildroot
Dear Fabio Porcedda,
On Wed, 4 Mar 2015 12:07:16 +0100, Fabio Porcedda wrote:
> +ifeq ($(BR2_PACKAGE_XZ),y)
> + HOST_CMAKE_DEPENDENCIES += host-xz
> + HOST_CMAKE_CONF_OPTS += -DCMAKE_USE_SYSTEM_LIBLZMA=ON
> +endif
This doesn't make any sense. Why would a dependency on host-xz be tied
to the activation of the target xz package ?
You have two choices here:
* Ask host-cmake to *always* use its internal copy of the xz library,
and to never look for a host-installed one.
* Depend on host-xz unconditionally, and ask host-cmake to always use
this system-provided host-xz.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] cmake: use system libzma when the xz package is enabled
2015-03-04 11:13 ` Thomas Petazzoni
@ 2015-03-05 0:03 ` Fabio Porcedda
2015-03-05 0:47 ` Fabio Porcedda
0 siblings, 1 reply; 4+ messages in thread
From: Fabio Porcedda @ 2015-03-05 0:03 UTC (permalink / raw)
To: buildroot
On Wed, Mar 4, 2015 at 12:13 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Fabio Porcedda,
>
> On Wed, 4 Mar 2015 12:07:16 +0100, Fabio Porcedda wrote:
>
>> +ifeq ($(BR2_PACKAGE_XZ),y)
>> + HOST_CMAKE_DEPENDENCIES += host-xz
>> + HOST_CMAKE_CONF_OPTS += -DCMAKE_USE_SYSTEM_LIBLZMA=ON
>> +endif
>
> This doesn't make any sense. Why would a dependency on host-xz be tied
> to the activation of the target xz package ?
Well.. you are damn right!
> You have two choices here:
>
> * Ask host-cmake to *always* use its internal copy of the xz library,
> and to never look for a host-installed one.
I have found the problem, the problem is that we add in the
HOST_CFLAGS the -I$(HOST_DIR)/usr/include, but CMAKE_F_FLAGS are
before the internal -I<dir> in the gcc command line, so the xz headers
was found before the cmake ones.
I will get rid of the -I$(HOST_DIR)/usr/include in the HOST_CFLAGS
before passing it to cmake because we don't want that it uses anything
from it.
> * Depend on host-xz unconditionally, and ask host-cmake to always use
> this system-provided host-xz.
Maybe it's not the preferred one?
BR
--
Fabio Porcedda
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] cmake: use system libzma when the xz package is enabled
2015-03-05 0:03 ` Fabio Porcedda
@ 2015-03-05 0:47 ` Fabio Porcedda
0 siblings, 0 replies; 4+ messages in thread
From: Fabio Porcedda @ 2015-03-05 0:47 UTC (permalink / raw)
To: buildroot
I've sent a updated version:
http://patchwork.ozlabs.org/patch/446525/
BR
--
Fabio Porcedda
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-03-05 0:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-04 11:07 [Buildroot] [PATCH] cmake: use system libzma when the xz package is enabled Fabio Porcedda
2015-03-04 11:13 ` Thomas Petazzoni
2015-03-05 0:03 ` Fabio Porcedda
2015-03-05 0:47 ` Fabio Porcedda
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.