Installation of Ncurses
Prepare Ncurses for compilation:
./configure --prefix=/usr \
--mandir=/usr/share/man \
--with-shared \
--without-debug \
--without-normal \
--with-cxx-shared \
--enable-pc-files \
--with-pkg-config-libdir=/usr/lib/pkgconfigThe meaning of the new configure options:
--with-sharedThis makes Ncurses build and install shared C libraries.
--without-normalThis prevents Ncurses building and installing static C
libraries.
--without-debugThis prevents Ncurses building and installing debug
libraries.
--with-cxx-sharedThis makes Ncurses build and install shared C++ bindings. It
also prevents it building and installing static C++ bindings.
--enable-pc-filesThis switch generates and installs .pc files for pkg-config.
Compile the package:
make
This package has a test suite, but it can only be run after the
package has been installed. The tests reside in the
test/ directory. See the
README file in that directory for further details.
The installation of this package will overwrite
libncursesw.so.6.5
in-place. It may crash the shell process which is using code and data
from the library file. Install the package with
DESTDIR, and replace the library file correctly using
the --remove-destination option of
cp (the header
curses.h is also edited to ensure the
wide-character ABI to be used as what we've done in
the section called “Ncurses-6.5-20250809”):
make DESTDIR=$PWD/dest install
sed -e 's/^#if.*XOPEN.*$/#if 1/' \
-i dest/usr/include/curses.h
cp --remove-destination -av dest/* /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
(note that the .so links are
only safe with curses.h edited to always use the
wide-character ABI):
for lib in ncurses form panel menu ; do
ln -sfv lib${lib}w.so /usr/lib/lib${lib}.so
ln -sfv ${lib}w.pc /usr/lib/pkgconfig/${lib}.pc
doneFinally, make sure that old applications that look for
-lcurses at build time are still
buildable:
ln -sfv libncursesw.so /usr/lib/libcurses.so
If desired, install the Ncurses documentation:
cp -v -R doc -T /usr/share/doc/ncurses-6.5-20250809
![[Note]](../images/note.png)
Note
The instructions above don't create non-wide-character Ncurses
libraries since no package installed by compiling from sources would link
against them at runtime. However, the only known binary-only
applications that link against non-wide-character Ncurses libraries
require version 5. If you must have such libraries because of some binary-only
application or to be compliant with LSB, build the package again with the
following commands:
make distclean
./configure --prefix=/usr \
--with-shared \
--without-normal \
--without-debug \
--without-cxx-binding \
--with-abi-version=5
make sources libs
cp -av lib/lib*.so.5* /usr/lib