Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: curses linking improvements

On Tue, 2 Oct 2007 10:01:54 +0100
Peter Stephenson <pws@xxxxxxx> wrote:
> configure checks for libraries and will see where the termcap/curses stuff
> can be found, but won't actually exit if it can't find it.
> I would actually like to see this part of configure improved:  there are
> various hard-wired search orders for libraries controlled partly by
> --with-curses-terminfo and partly by system-specific tests.  However,
> --with-curses-terminfo is now basically useless and it would be better to
> turn it into a more general argument that gives a library search list.

This replaces --with-curses-terminfo with --with-term-lib="LIBS" and
documents the position, apparently for the first time.

RCS file: /cvsroot/zsh/zsh/INSTALL,v
retrieving revision 1.30
diff -u -r1.30 INSTALL
--- INSTALL	21 May 2007 11:32:02 -0000	1.30
+++ INSTALL	2 Oct 2007 10:05:32 -0000
@@ -304,6 +304,34 @@
 See chapter 5 in the FAQ for some notes on multibyte input.
+Terminal Handling
+Historically, several different libraries have provided the features the
+shell needs to provide output to the terminal.  The most common have been
+termcap, which is now largely outmoded, and curses, which supersedes
+termcap and typically contains the same features as well as others.
+configure will search for an appropriate library; the default search order
+is "tinfo termcap ncurses curses" except on HP-UX and Solaris where it is
+"Hcurses ncurses curses termcap".  Note that even though termcap is usually
+searched first, zsh tries to make features from curses available and if the
+curses library contains both curses and termcap features, as is normal,
+the curses variant is used.  ncurses is a newer version of curses
+and tinfo is related to it.
+On some systems a suitable development package with a name such as
+curses-devel or ncurses-devel needs to be installed before zsh can
+be compiled.  This is likely to be contained on any installation media,
+or available for download.  It is highly unlikely that you will need to
+compile this from scratch.
+You can tell configure which libraries to search by passing an
+argument via --with-term-lib.  This can take a space-separated list
+of libraries to try, so the default is equivalent to
+--with-term-lib="tinfo termcap ncurses curses".  This replaces the
+old option --with-curses-terminfo, which altered the search order but
+didn't allow an explicit search list to be passed.
 Memory Routines
Index: configure.ac
RCS file: /cvsroot/zsh/zsh/configure.ac,v
retrieving revision 1.68
diff -u -r1.68 configure.ac
--- configure.ac	16 Aug 2007 10:54:40 -0000	1.68
+++ configure.ac	2 Oct 2007 10:05:33 -0000
@@ -641,12 +641,11 @@
 dnl stuff in the same library we will use that; typically this
 dnl is ncurses or curses.
 dnl On HPUX, Hcurses is reported to work better than curses.
-dnl Prefer ncurses to curses on all systems; prefer it to tinfo
-dnl if we were told to use curses.  tinfo isn't very common now.
-AC_HELP_STRING([--with-curses-terminfo], [use terminfo support from curses library]),
-[if test x$withval = xyes; then
-  termcap_curses_order="ncurses tinfo curses termcap"
+dnl Prefer ncurses to curses on all systems.  tinfo isn't very common now.
+AC_HELP_STRING([--with-term-lib=LIBS], [search space-separated LIBS for terminal handling]),
+[if test x$withval != xno && test x$withval != x ; then
+  termcap_curses_order="$withval"
   AC_SEARCH_LIBS(tigetstr, [$termcap_curses_order])
   termcap_curses_order="tinfo termcap ncurses curses"
@@ -677,7 +676,12 @@
 dnl only [n]curses contains terminfo functions, we only link against
 dnl [n]curses.
 AC_SEARCH_LIBS(tigetflag, [$termcap_curses_order])
-AC_SEARCH_LIBS(tgetent, [$termcap_curses_order])
+AC_SEARCH_LIBS(tgetent, [$termcap_curses_order],
+  true,
+  AC_MSG_FAILURE(["No terminal handling library was found on your system.
+This is probably a library called 'curses' or 'ncurses'.  You may
+need to install a package called 'curses-devel' or 'ncurses-devel' on your
+system."], 255))
 AC_CHECK_HEADERS(curses.h, [],
 [AC_CACHE_CHECK(for Solaris 8 curses.h mistake, ac_cv_header_curses_solaris,
 AC_TRY_COMPILE([#include <curses.h>], [],

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070

Messages sorted by: Reverse Date, Date, Thread, Author