6.13. dash 0.5.13.3
dash provides a small POSIX shell for script execution in the target userspace.
Input assumption: dash-0.5.13.3.tar.gz is already present in LBI_SOURCES from the chapter 4 source staging step.
Source URL: http://gondor.apana.org.au/~herbert/dash/files/dash-0.5.13.3.tar.gz
Upstream build note: the release tarball includes a generated configure script and Makefile.in files, so no autotools bootstrap is needed.

Licenses:
- BSD-3-Clause
- GPL-2.0-or-later for the
mksignames.cgenerator input noted by upstream
Dependencies:
- musl (libc)
- make
dash is a small POSIX-compliant Bourne shell implementation. we need it to provide a fast sh for scripts and interactive recovery tasks in the minimal target userspace.
Extract and Enter the Source Tree
cd "$LBI_SOURCES"
tar -xf dash-0.5.13.3.tar.gz
cd dash-0.5.13.3
Configure dash
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" \
lbi_configure \
--host="$LBI_TARGET"
Build dash
make $LWI_MAKE_FLAGS
Install dash
make install DESTDIR="$LBI_ROOT"
Post-install Shell Symlink
ln -sf dash "$LBI_ROOT/system/binaries/sh"
Command Explanations
CC="$LBI_ROOT/system/tools/bin/$LBI_TARGET-clang": Uses the target-prefixed Clang compiler for the shell binary.CFLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LWI_CFLAGS": Targets the selected triple and sysroot while preserving local C flag tuning.LDFLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LBI_CUSTOM_LDFLAGS": Keeps link steps in the target sysroot and preserves local linker tuning.lbi_configure --host="$LBI_TARGET": Uses the book's configure helper for/systempaths and marks the build as a cross build.make $LWI_MAKE_FLAGS: Builds dash with the shared make parallelism setting.make install DESTDIR="$LBI_ROOT": Installs into the target root rather than the host filesystem.ln -sf dash "$LBI_ROOT/system/binaries/sh": Provides the requiredshcommand name through the dash binary.