about summary refs log tree commit diff
path: root/configure.ac
diff options
context:
space:
mode:
authorPaul Ackersviller <packersv@users.sourceforge.net>2007-11-11 19:47:17 +0000
committerPaul Ackersviller <packersv@users.sourceforge.net>2007-11-11 19:47:17 +0000
commiteda88926ced13dedac0cbee5b5a190cae00583c2 (patch)
treeb79a71b57d2f2da64f0341f7814f345e9b09bca0 /configure.ac
parent41ac21c9c9a496e1e1345cd212cda37ead59de5e (diff)
downloadzsh-eda88926ced13dedac0cbee5b5a190cae00583c2.tar.gz
zsh-eda88926ced13dedac0cbee5b5a190cae00583c2.tar.xz
zsh-eda88926ced13dedac0cbee5b5a190cae00583c2.zip
Merge of 23090: make ncurses preferred over curses and try not to link to multiple display libraries if not necessary.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 15 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index cff334093..7180b5e88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -612,20 +612,24 @@ AC_CHECK_LIB(c, printf, [LIBS="$LIBS -lc"])
 AC_CHECK_LIB(m, pow)
 
 dnl Prefer BSD termcap library to SysV curses library, except on certain
-dnl SYSV-derived systems.
+dnl SYSV-derived systems.  However, if we find terminfo and termcap
+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_ARG_WITH(curses-terminfo,
 [  --with-curses-terminfo     use terminfo support from curses library],
 [if test x$withval = xyes; then
-  termcap_curses_order="tinfo curses ncurses termcap"
+  termcap_curses_order="ncurses tinfo curses termcap"
   AC_SEARCH_LIBS(tigetstr, [$termcap_curses_order])
 else
-  termcap_curses_order="tinfo termcap curses ncurses"
+  termcap_curses_order="tinfo termcap ncurses curses"
 fi],
 [case "$host_os" in
   hpux10.*|hpux11.*|solaris*)
-      termcap_curses_order="Hcurses curses ncurses termcap" ;;
-  *)             termcap_curses_order="tinfo termcap curses ncurses" ;;
+      termcap_curses_order="Hcurses ncurses curses termcap" ;;
+  *)             termcap_curses_order="tinfo termcap ncurses curses" ;;
 esac])dnl
 
 AH_TEMPLATE([HAVE_BOOLCODES],
@@ -642,8 +646,13 @@ AH_TEMPLATE([HAVE_STRNAMES],
 [Define if you have the terminfo strnames symbol.])
 AH_TEMPLATE([TERM_H_NEEDS_CURSES_H],
 [Define if term.h chokes without curses.h.])
-AC_SEARCH_LIBS(tgetent, [$termcap_curses_order])
+dnl Check for tigetflag (terminfo) before tgetent (termcap).
+dnl That's so that on systems where termcap and [n]curses are
+dnl both available and both contain termcap functions, while
+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_CHECK_HEADERS(curses.h, [],
 [AC_CACHE_CHECK(for Solaris 8 curses.h mistake, ac_cv_header_curses_solaris,
 AC_TRY_COMPILE([#include <curses.h>], [],