6.14. oksh 7.8

oksh provides the interactive login shell used when entering the target chroot.

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

Source URL: https://github.com/ibara/oksh/releases/download/oksh-7.8/oksh-7.8.tar.gz

Upstream build note: upstream ships a custom configure script and documents ./configure, make, and make install. for cross builds, upstream documents --no-thanks to skip host execution checks.

Licenses:

Dependencies:

oksh is a portable OpenBSD ksh implementation. we need it to provide the interactive login shell used for chapter 7 chroot work.

Extract and Enter the Source Tree

cd "$LBI_SOURCES"
tar -xf oksh-7.8.tar.gz
cd oksh-7.8

Configure oksh

oksh does not use GNU autotools configure defaults, so lbi_configure is not supported here. this section calls upstream's script directly and uses --no-thanks for cross-compiling.
./configure \
    --no-thanks \
    --disable-curses \
    --prefix=/system \
    --bindir=/system/binaries \
    --mandir=/system/documentation/man-pages \
    --cc="$LBI_ROOT/system/tools/bin/$LBI_TARGET-clang" \
    --cflags="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LWI_CFLAGS"

Build oksh

make $LWI_MAKE_FLAGS \
    LDFLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LBI_CUSTOM_LDFLAGS"

Install oksh

make install DESTDIR="$LBI_ROOT"
ln -sf oksh "$LBI_ROOT/system/binaries/ksh"

Command Explanations