From 3444fe87fbe89ac43aeb3586524b8561d319f258 Mon Sep 17 00:00:00 2001 From: David Adam Date: Sun, 5 Mar 2017 15:06:20 +0800 Subject: [PATCH] configure: check for definition of setupterm, not just linkability Some platforms ship the headers and libraries for ncurses in different packages, which can produce false positives when checking for their presence. Closes #3866. --- configure.ac | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/configure.ac b/configure.ac index 0d4514bbc..84a02fcb1 100644 --- a/configure.ac +++ b/configure.ac @@ -327,6 +327,25 @@ AC_CHECK_FUNCS( dirfd ) AC_CHECK_DECL( [mkostemp], [ AC_CHECK_FUNCS([mkostemp]) ] ) +# +# Although setupterm is linkable thanks to SEARCH_LIBS above, some +# builds of ncurses include the actual headers in a different package +# +AC_CHECK_DECL( [setupterm], , [AC_MSG_ERROR([Could not find a curses implementation, needed to build fish. If this is Linux, try running 'sudo apt-get install libncurses5-dev' or 'sudo yum install ncurses-devel'])], [ +#if HAVE_NCURSES_H +#include +#elif HAVE_NCURSES_CURSES_H +#include +#else +#include +#endif +#if HAVE_TERM_H +#include +#elif HAVE_NCURSES_TERM_H +#include +#endif +] ) + dnl AC_CHECK_FUNCS uses C linkage, but sometimes (Solaris!) the behaviour is dnl different with C++. AC_MSG_CHECKING([for wcsdup])