6.3. ncurses 6.6-20260418
ncurses installs terminal handling libraries and terminfo tooling, with a host-built `tic` used during target installation.
Input assumption:
ncurses-6.6-20260418.tgz is already present in LBI_SOURCES from the chapter 4 source staging step.
Licenses:
- X11-style (ncurses)
Dependencies:
- musl (libc)
- libcxx (c++ library, for the C++ bindings)
ncurses is a terminal handling library and terminfo toolkit. we need it to provide curses interfaces and terminal capability data for later userspace packages in this book.
Extract and Enter the Source Tree
cd "$LBI_SOURCES"
tar -xf ncurses-6.6-20260418.tgz
cd ncurses-6.6-20260418
Build Host tic
mkdir -pv build
pushd build
../configure --prefix="$LBI_ROOT/system/tools" AWK=gawk
make -C include
make -C progs tic
install -vm755 progs/tic "$LBI_ROOT/system/tools/bin/tic"
popd
Configure, Build, and Install ncurses
Use lbi_configure for the target configure phase instead of a manual full-path ./configure invocation.
lbi_configure \
--host="$LBI_TARGET" \
--build="$(./config.guess)" \
--with-manpage-format=normal \
--with-shared \
--without-normal \
--with-cxx-shared \
--without-debug \
--without-ada \
--disable-stripping \
AWK=gawk
make $LWI_MAKE_FLAGS
make DESTDIR="$LBI_ROOT" TIC_PATH="$PWD/build/progs/tic" install
Post-install Compatibility Adjustments
ln -sv libncursesw.so "$LBI_ROOT/system/libraries/libncurses.so"
sed -e 's/^#if.*XOPEN.*$/#if 1/' \
-i "$LBI_ROOT/system/headers/curses.h"
Command Explanations
mkdir -pv build: Creates a separate host-build directory for theticprogram without mixing host objects into the target build tree.../configure --prefix="$LBI_ROOT/system/tools" AWK=gawk: Configures the temporary host-side ncurses tools under the tools prefix and selects the hostgawkfor generated source steps.make -C include: Builds the generated ncurses headers needed before compilingtic.make -C progs tic: Builds only the host-runnable terminfo compiler instead of building the full host ncurses package.install -vm755 progs/tic "$LBI_ROOT/system/tools/bin/tic": Places the hostticwhere the later target install step can reference it explicitly.lbi_configure: Uses the book's configure helper so ncurses installs into/systemlayout paths instead of upstream defaults.--host="$LBI_TARGET"and--build="$(./config.guess)": Tell configure this is a cross build from the current host into the target triple.--with-manpage-format=normal: Installs normal man pages instead of compressed or alternate-format pages.--with-sharedand--without-normal: Builds shared ncurses libraries and skips static normal libraries for this pass.--with-cxx-shared: Builds the C++ ncurses binding as a shared library.--without-debugand--without-ada: Skips debug libraries and Ada bindings that are not needed in the minimal target.--disable-stripping: Keeps binaries unstripped so symbol removal can remain a deliberate later policy choice.AWK=gawk: Uses GNU awk for ncurses' generated source rules.make DESTDIR="$LBI_ROOT" TIC_PATH="$PWD/build/progs/tic" install: Installs into the target tree while forcing the install rule to use the host-builttic.ln -sv libncursesw.so "$LBI_ROOT/system/libraries/libncurses.so": Provides the conventionallibncurses.soname as an alias for the wide-character ncurses library.sed -e 's/^#if.*XOPEN.*$/#if 1/' ... curses.h: Makes the installed header expose X/Open declarations expected by later packages.