6.19. Ncurses-5.6

The Ncurses package contains libraries for terminal-independent handling of character screens.

User Notes: http://wiki.linuxfromscratch.org/hlfs/wiki/ncurses

6.19.1. Installation of Ncurses

Apply the following patch to fix a number of issues uncovered by the static code analysis tool, Coverity:

patch -Np1 -i ../ncurses-5.6-coverity_fixes-1.patch

Ncurses comes with a lot of debuging features, such as --with-trace, and --enable-assertions. See the output of ./configure --help and the INSTALL file for more information.

Prepare Ncurses for compilation:

./configure --prefix=/usr --with-shared --without-normal \
    --enable-widec --without-cxx-binding --enable-symlinks \
    --without-debug --disable-root-environ

The meaning of the configure option:

--without-normal

This switch tells Ncurses not to build static libraries.

--enable-widec

This switch causes wide-character libraries (e.g., libncursesw.so.5.6) to be built instead of normal ones (e.g., libncurses.so.5.6). These wide-character libraries are usable in both multibyte and traditional 8-bit locales, while normal libraries work properly only in 8-bit locales. Wide-character and normal libraries are source-compatible, but not binary-compatible.

--without-cxx-binding

This option causes the libncurses++w.a library not to be built. Nothing in LFS and BLFS uses this library.

--enable-symlinks

This option makes Ncurses install the tic program as a symbolic link, rather than a hard link.

--disable-root-environ

This option restricts environment variables, such as TERMINFO, when running as root so the search path for the terminfo or termcap entry can not be customized.

Compile the package:

make

Install the package:

make install

This package has a non-typical test suite, which also needs Ncurses installed first to function. Read test/README for descriptions of the tests. They can be executed with a command like:

./test/tclock

The “tclock” test can be exited by entering the 'q' key. Other tests will need a ctrl-c, and may will display an interactive menu.

Move the libraries to the /lib directory, where they are expected to reside:

mv -v /usr/lib/libncursesw.so.5* /lib

Because the libraries have been moved, one symlink points to a non-existent file. Recreate it:

ln -vsf ../../lib/libncursesw.so.5 /usr/lib/libncursesw.so

Many applications still expect the linker to be able to find non-wide-character Ncurses libraries. Trick such applications into linking with wide-character libraries by means of symlinks and linker scripts:

for lib in curses ncurses form panel menu ; do \
    rm -vf /usr/lib/lib${lib}.so ; \
    echo "INPUT(-l${lib}w)" >/usr/lib/lib${lib}.so ; \
done

Finally, make sure that old applications that look for -lcurses at build time are still buildable:

echo "INPUT(-lncursesw)" >/usr/lib/libcursesw.so
ln -vsf libncurses.so /usr/lib/libcurses.so

6.19.2. Contents of Ncurses

Installed programs: captoinfo (link to tic), clear, infocmp, infotocap (link to tic), reset (link to tset), tack, tic, toe, tput, and tset
Installed libraries: libcursesw.{a,so} (symlink and linker script to libncursesw.{a,so}), libformw.{a,so}, libmenuw.{a,so}, libncurses++w.a, libncursesw.{a,so}, libpanelw.{a,so} and their non-wide-character counterparts without "w" in the library names.

Short Descriptions

captoinfo

Converts a termcap description into a terminfo description

clear

Clears the screen, if possible

infocmp

Compares or prints out terminfo descriptions

infotocap

Converts a terminfo description into a termcap description

reset

Reinitializes a terminal to its default values

tack

The terminfo action checker; it is mainly used to test the accuracy of an entry in the terminfo database

tic

The terminfo entry-description compiler that translates a terminfo file from source format into the binary format needed for the ncurses library routines. A terminfo file contains information on the capabilities of a certain terminal

toe

Lists all available terminal types, giving the primary name and description for each

tput

Makes the values of terminal-dependent capabilities available to the shell; it can also be used to reset or initialize a terminal or report its long name

tset

Can be used to initialize terminals

libcurses

A link to libncurses

libncurses

Contains functions to display text in many complex ways on a terminal screen; a good example of the use of these functions is the menu displayed during the kernel's make menuconfig

libform

Contains functions to implement forms

libmenu

Contains functions to implement menus

libpanel

Contains functions to implement panels