6.19. bsdsed 0.99.2
bsdsed provides the FreeBSD-derived sed utility for stream editing in the target userspace.
Input assumption:
bsdsed-v0.99.2.tar.gz is already present in LBI_SOURCES from the chapter 4 source staging step.
Licenses:
- BSD-2-Clause-FreeBSD
Dependencies:
- musl (libc)
- make
bsdsed is a FreeBSD-derived sed utility made portable by the Chimera Linux bsdsed project. we need it to provide sed for stream editing steps used throughout package preparation and build scripts in this book.
Extract and Enter the Source Tree
cd "$LBI_SOURCES"
tar -xf bsdsed-v0.99.2.tar.gz
cd bsdsed-0.99.2
Build bsdsed
Configure note: this package does not ship a
configure script, so lbi_configure is not supported here. Build settings are passed directly to make.
make $LWI_MAKE_FLAGS \
CC="$LBI_ROOT/system/tools/bin/$LBI_TARGET-clang" \
CFLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LWI_CFLAGS" \
LDFLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LBI_CUSTOM_LDFLAGS"
Install bsdsed
make install \
DESTDIR="$LBI_ROOT" \
PREFIX=/system \
BINDIR=/system/binaries \
DATADIR=/system/documentation \
MANDIR=/system/documentation/man-pages/man1 \
INSTALL_NAME=sed
Command Explanations
make $LWI_MAKE_FLAGS: Builds bsdsed with the shared make parallelism setting.CC="$LBI_ROOT/system/tools/bin/$LBI_TARGET-clang": Uses the target-prefixed Clang compiler.CFLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LWI_CFLAGS": Targets the selected triple/sysroot and preserves local C flag tuning.LDFLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LBI_CUSTOM_LDFLAGS": Keeps link steps inside the target sysroot while preserving local linker tuning.make install DESTDIR="$LBI_ROOT": Installs into the target root instead of the host system.PREFIX=/systemandBINDIR=/system/binaries: Place the installed command in the book's binary layout.DATADIR=/system/documentationandMANDIR=/system/documentation/man-pages/man1: Place support documentation and the manual page in the book's documentation tree.INSTALL_NAME=sed: Installs the program under the standardsedcommand name.