8.5. xz stage 2 5.8.3
Rebuild xz in the final target environment using the autotools configure path via `lbi_configure`.
Input assumption: xz-5.8.3.tar.xz is already present in /sources from the chapter 4 source staging step.
Source URL: https://github.com/tukaani-project/xz/releases/download/v5.8.3/xz-5.8.3.tar.xz
Upstream build note: the upstream INSTALL document describes both configure and CMake options for this release. This section uses the autotools configure flow through lbi_configure.
Licenses:
- 0BSD
Dependencies:
- musl (libc)
- make
xz is a compression toolkit that provides liblzma and .xz/.lzma command-line tools. we need it to provide final stage xz and liblzma tooling in chapter 8.
Extract and Enter the Source Tree
cd /sources
tar -xf xz-5.8.3.tar.xz
cd xz-5.8.3
Configure xz
If configure fails with a
CFLAGS contains something that makes -Werror complain error, use the upstream-documented override below.
SKIP_WERROR_CHECK=yes \
lbi_configure \
--disable-static \
--enable-shared \
--disable-nls \
--docdir=/system/documentation/xz
Build xz
make $LWI_MAKE_FLAGS
Install xz
make install
After this step is complete, you can remove the extracted source directory and source tarball from
/sources if you do not plan to rebuild xz again.
Command Explanations
cd /sources,tar -xf, andcd xz-...: Enter the staged xz source tree.SKIP_WERROR_CHECK=yes: Prevents configure from rejecting builds where warnings are not treated as fatal.lbi_configure: Applies the book's/systeminstall layout.--disable-staticand--enable-shared: Install shared libraries without static archives.--disable-nls: Avoids gettext/native language support for this pass.--docdir=/system/documentation/xz: Places xz documentation in the book's documentation tree.make $LWI_MAKE_FLAGSandmake install: Build and install xz in the target environment.