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-muslcompiler 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:
- depends on
aclandattrand passes--enable-acland--enable-xattr, sosed -icarries both over to the file it writes; - passes
--without-libsmackand--without-selinux, so the result does not depend on whether either library happens to be installed when it is built; - installs with
--bindir=/bin, which on KDOS’s merged layout is the same directory as/usr/bin.
See also
- Patch, the step before this one, and Readline, the step after it
- The sed port: its version, source and contents
- The base userland: the GNU command line every KDOS system carries