Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

22. Sed

GNU sed is the stream editor. Configure scripts and the makefiles they write call it constantly, so every build 20_selfhost runs inside build/fs depends on it. 068_sed.sh cross-compiles sed from the same source tarball as the sed port and installs it into build/fs.

Source: the archive of the sed port
Installs into: build/fs/usr
Approximate build time: 0.4 SBU

Installation of sed

The step unpacks the port’s tarball with extract_port_source and builds from inside the unpacked directory:

SED_SRC=$(extract_port_source sed)

cd "$SED_SRC"

./configure \
    --host=$KDOS_TARGET \
    --build=$(build-aux/config.guess) \
    --prefix=/usr \
    --disable-nls

make
make DESTDIR=$SYSROOT install

script/phases/10_bootstrap/068_sed.sh, lines 23–34

The meaning of the configure options

--host=$KDOS_TARGET, --build=$(build-aux/config.guess)
A cross build, made by the x86_64-kdos-linux-musl compiler for KDOS, with configure told from the start that it cannot run what it compiles. Patch explains the pair.
--prefix=/usr
The program goes to /usr/bin.
--disable-nls
Build no message catalogues: sed prints its messages in English only.

The root holds no libacl or libattr yet, so configure builds sed without ACL or extended-attribute support; sed -i writes its output file without copying either from the original.

The step then removes the source directory and touches build/mark/bootstrap/sed, which makes later runs skip it (see Guards in the early phases).

Built again later

30_foundation installs the sed port, which adopts /usr/bin/sed from this step. Besides being a native build with the chroot’s release flags, the port:

See also