6.7. sbase git snapshot

sbase provides a compact portable Unix utility set for the early target userspace.

Input assumption: sbase-c1341583c963.tar.gz is already present in LBI_SOURCES from the chapter 4 source staging step.

Source note: this archive is generated by scripts/fetch-sources.sh from upstream https://git.suckless.org/sbase at commit c1341583c96307cb0e6152c963ed23c4d56a4278.

Licenses:

Dependencies:

sbase is a compact portable Unix utility collection from suckless. we need it to provide the early target command set used by later build, install, and troubleshooting steps.

Extract and Enter the Source Tree

cd "$LBI_SOURCES"
tar -xf sbase-c1341583c963.tar.gz
cd sbase-c1341583c963

Build sbase

Build note: sbase builds one generated bc source with a yacc-compatible parser generator. Prefer yacc when present, and fall back to byacc.
YACC=${YACC:-yacc}
if ! command -v "$YACC" >/dev/null 2>&1 && command -v byacc >/dev/null 2>&1; then
    YACC=byacc
fi

make $LWI_MAKE_FLAGS \
    YACC="$YACC" \
    CC="$LBI_ROOT/system/tools/bin/$LBI_TARGET-clang" \
    AR="$LBI_ROOT/system/tools/bin/$LBI_TARGET-ar" \
    RANLIB="$LBI_ROOT/system/tools/bin/$LBI_TARGET-ranlib" \
    CFLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LWI_CFLAGS" \
    LDFLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LBI_CUSTOM_LDFLAGS"

Install sbase

make install \
    DESTDIR="$LBI_ROOT" \
    PREFIX=/system \
    MANPREFIX=/system/documentation/man-pages

install -d "$LBI_ROOT/system/binaries"

if [ -d "$LBI_ROOT/system/bin" ]; then
    mv -f "$LBI_ROOT/system/bin/"* "$LBI_ROOT/system/binaries/"
    rmdir "$LBI_ROOT/system/bin"
fi

ln -sf xinstall "$LBI_ROOT/system/binaries/install"

Command Explanations