Commit 4fe6cfeb authored by Kevin J. McCarthy's avatar Kevin J. McCarthy

configure: check for tinfo matching ncurses

When we selected ncursesw, look for tinfow as well.  Since ncurses-6.1
the binary compatibility between tinfo and tinfow disappeared, resulting
in crashes and other odd behaviour.

This change checks for tinfo or tinfow based on which ncurses we found
to continue with.

https://bugs.gentoo.org/651552

[Thanks to Fabian Groffen for the patch.  I made a minor modification
to fall back to tinfo because pre-6.1 systems may not have a tinfow
but still need tinfo to compile.]
parent eeba9a9b
......@@ -299,12 +299,15 @@ main ()
AC_CHECK_LIB($cf_ncurses, initscr,
[MUTTLIBS="$MUTTLIBS -l$cf_ncurses"
AC_CHECK_LIB(tinfo, tgetent, [MUTTLIBS="$MUTTLIBS -ltinfo"])
if test "$cf_ncurses" = ncursesw; then
AC_CHECK_LIB(tinfow, tgetent, [MUTTLIBS="$MUTTLIBS -ltinfow"],
AC_CHECK_LIB(tinfo, tgetent, [MUTTLIBS="$MUTTLIBS -ltinfo"]))
AC_CHECK_HEADERS(ncursesw/ncurses.h,[cf_cv_ncurses_header="ncursesw/ncurses.h"],
[AC_CHECK_HEADERS(ncurses.h,[cf_cv_ncurses_header="ncurses.h"])])
else
AC_CHECK_LIB(tinfo, tgetent, [MUTTLIBS="$MUTTLIBS -ltinfo"])
AC_CHECK_HEADERS(ncurses/ncurses.h,[cf_cv_ncurses_header="ncurses/ncurses.h"],
[AC_CHECK_HEADERS(ncurses.h,[cf_cv_ncurses_header="ncurses.h"])])
fi],
......
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