Commit a4a18b8b authored by Glenn Morris's avatar Glenn Morris

Use libtinfo in preference to libncurses (bug#9741)

* configure.in: Try libtinfo for tputs.
(LIBS_TERMCAP) [gnu*]: Use libtinfo if it was found.  

* etc/NEWS: Mention this.
parent 3ba0a545
2012-05-01 Glenn Morris <rgm@gnu.org> 2012-05-01 Glenn Morris <rgm@gnu.org>
* configure.in: Try libtinfo for tputs.
(LIBS_TERMCAP) [gnu*]: Use libtinfo if it was found. (Bug#9741)
* configure.in: Combine adjacent $opsys case blocks. * configure.in: Combine adjacent $opsys case blocks.
* configure.in (LIBS_TERMCAP): Remove unreachable branch for sol2. * configure.in (LIBS_TERMCAP): Remove unreachable branch for sol2.
......
...@@ -2868,7 +2868,7 @@ AC_DEFUN([tputs_link_source], [ ...@@ -2868,7 +2868,7 @@ AC_DEFUN([tputs_link_source], [
]) ])
# Maybe curses should be tried earlier? # Maybe curses should be tried earlier?
# See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35 # See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35
for tputs_library in '' ncurses terminfo termcap curses; do for tputs_library in '' tinfo ncurses terminfo termcap curses; do
OLIBS=$LIBS OLIBS=$LIBS
if test -z "$tputs_library"; then if test -z "$tputs_library"; then
LIBS_TERMCAP= LIBS_TERMCAP=
...@@ -2888,7 +2888,8 @@ done ...@@ -2888,7 +2888,8 @@ done
AC_MSG_RESULT([$msg]) AC_MSG_RESULT([$msg])
if test "X$msg" = Xno; then if test "X$msg" = Xno; then
AC_MSG_ERROR([The required function `tputs' was not found in any library. AC_MSG_ERROR([The required function `tputs' was not found in any library.
These libraries were tried: libncurses, libterminfo, libtermcap, libcurses. The following libraries were tried (in order):
libtinfo, libncurses, libterminfo, libtermcap, libcurses
Please try installing whichever of these libraries is most appropriate Please try installing whichever of these libraries is most appropriate
for your system, together with its header files. for your system, together with its header files.
For example, a libncurses-dev(el) or similar package.]) For example, a libncurses-dev(el) or similar package.])
...@@ -2897,12 +2898,18 @@ fi ...@@ -2897,12 +2898,18 @@ fi
## Use termcap instead of terminfo? ## Use termcap instead of terminfo?
## Only true for: freebsd < 40000, ms-w32, msdos, netbsd < 599002500. ## Only true for: freebsd < 40000, ms-w32, msdos, netbsd < 599002500.
TERMINFO=yes TERMINFO=yes
## FIXME? In the cases below where we unconditionally set
## LIBS_TERMCAP="-lncurses", this overrides LIBS_TERMCAP = -ltinfo,
## if that was found above to have tputs.
## Should we use the gnu* logic everywhere?
case "$opsys" in case "$opsys" in
## darwin: Prevents crashes when running Emacs in Terminal.app under 10.2. ## darwin: Prevents crashes when running Emacs in Terminal.app under 10.2.
## The ncurses library has been moved out of the System framework in ## The ncurses library has been moved out of the System framework in
## Mac OS X 10.2. So if configure detects it, set the command-line ## Mac OS X 10.2. So if configure detects it, set the command-line
## option to use it. ## option to use it.
darwin|gnu*) LIBS_TERMCAP="-lncurses" ;; darwin) LIBS_TERMCAP="-lncurses" ;;
gnu*) [ "x$LIBS_TERMCAP" = x ] && LIBS_TERMCAP="-lncurses" ;;
freebsd) freebsd)
AC_MSG_CHECKING([whether FreeBSD is new enough to use terminfo]) AC_MSG_CHECKING([whether FreeBSD is new enough to use terminfo])
......
...@@ -29,6 +29,9 @@ possibly-questionable C code. On a recent GNU system there should be ...@@ -29,6 +29,9 @@ possibly-questionable C code. On a recent GNU system there should be
no warnings; on older and on non-GNU systems the generated warnings no warnings; on older and on non-GNU systems the generated warnings
may be useful. may be useful.
---
** Emacs uses libtinfo in preference to libncurses, if available.
* Startup Changes in Emacs 24.2 * Startup Changes in Emacs 24.2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment