[cmake-developers] [CMake 0015916]: [Buildroot] [PATCH] cmake: use system libzma when the xz package is enabled

Mantis Bug Tracker mantis at public.kitware.com
Wed Jan 13 14:17:34 EST 2016


The following issue has been SUBMITTED. 
====================================================================== 
https://cmake.org/Bug/view.php?id=15916 
====================================================================== 
Reported By:                R Jones
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15916
Category:                   CMake
Reproducibility:            always
Severity:                   tweak
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2016-01-13 14:17 EST
Last Modified:              2016-01-13 14:17 EST
====================================================================== 
Summary:                    [Buildroot] [PATCH] cmake: use system libzma when
the xz package is enabled
Description: 
I have XZ installed already.
I was trying to compile cmake using gmake and GCC4.

The error is:
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

Steps to Reproduce: 
On a Solaris system with with GCC4, GMAKE, ZLIB, EXPAT, BZIP2, CURL, XZ and
without cmake installed:

CFLAGS=-I{INSTARGET}/include

bash ./configure \
            --prefix=${INSTARGET} \
            --system-zlib \
            --system-expat \
            --system-bzip2 \
            --system-curl

Causes the problem in the description.

After patching bootstrap (see below), I was able to clear the problem with:
bash ./configure \
            --prefix=${INSTARGET} \
            --system-zlib \
            --system-expat \
            --system-bzip2 \
            --system-liblzma \
            --system-curl

Additional Information: 
I found this thread when looking into how to disable cmake build from trying to
include it's own liblzma instead of the system liblzma.  It seems that the
engine is prepared for it, but bootstrap does not allow --system-liblzma as an
option.  All I needed to do to disable the internal copy was to add this to
bootstrap and re-run configure:

$ diff bootstrap bootstrap.orig
652c652
<  
--system-bzip2|--system-curl|--system-expat|--system-jsoncpp|--system-libarchive|--system-zlib|--system-liblzma)
---
>  
--system-bzip2|--system-curl|--system-expat|--system-jsoncpp|--system-libarchive|--system-zlib)

Also would need to update the "help"

Is there some reason this option could not be added to the package?
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2016-01-13 14:17 R Jones        New Issue                                    
======================================================================



More information about the cmake-developers mailing list