6.9. file 5.47
file identifies file types by checking filesystem metadata and magic signatures.
Input assumption:
file-5.47.tar.gz is already present in LBI_SOURCES from the chapter 4 source staging step.
Licenses:
- BSD-2-Clause
Dependencies:
- musl (libc)
file is a file type identification utility and library. we need it to detect file formats and binaries reliably in later build, packaging, and troubleshooting steps.
Extract and Enter the Source Tree
cd "$LBI_SOURCES"
tar -xf file-5.47.tar.gz
cd file-5.47
Configure file
CC="$LBI_ROOT/system/tools/bin/$LBI_TARGET-clang" \
lbi_configure \
--host="$LBI_TARGET"
Build file
make $LWI_MAKE_FLAGS
Install file
make install DESTDIR="$LBI_ROOT"
Command Explanations
CC="$LBI_ROOT/system/tools/bin/$LBI_TARGET-clang": Uses the target-prefixed Clang compiler for the cross build.lbi_configure --host="$LBI_TARGET": Applies the book's/systeminstall layout and tells configure to build for the target triple.make $LWI_MAKE_FLAGS: Builds with the shared make parallelism policy from the environment.make install DESTDIR="$LBI_ROOT": Stages the install into the target root instead of touching the host system.