From 61af9d7cc27f9999e4f6e3dab9f786a074a97dee Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 19 Jan 2017 15:31:22 +0000 Subject: [PATCH] Look for ncursesw as well as ncurses, based on a change from Bert van Hall. --- configure.ac | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 9289bdaa..d17b6722 100644 --- a/configure.ac +++ b/configure.ac @@ -164,15 +164,21 @@ fi PKG_CHECK_MODULES( LIBNCURSES, ncurses, - [ - AM_CFLAGS="$LIBNCURSES_CFLAGS $AM_CFLAGS" - CFLAGS="$AM_CFLAGS $SAVED_CFLAGS" - LIBS="$LIBNCURSES_LIBS $LIBS" - found_ncurses=yes - ], + found_ncurses=yes, found_ncurses=no ) if test "x$found_ncurses" = xno; then + PKG_CHECK_MODULES( + LIBNCURSES, + ncursesw, + found_ncurses=yes, + found_ncurses=no + ) +fi +if test "x$found_ncurses" = xyes; then + CPPFLAGS="$LIBNCURSES_CFLAGS $CPPFLAGS" + LIBS="$LIBNCURSES_LIBS $LIBS" +else # pkg-config didn't work, try ncurses. AC_CHECK_LIB( ncurses, @@ -180,13 +186,14 @@ if test "x$found_ncurses" = xno; then found_ncurses=yes, found_ncurses=no ) - AC_CHECK_HEADER( - ncurses.h, - , - found_ncurses=no) + if test "x$found_ncurses" = xyes; then + AC_CHECK_HEADER( + ncurses.h, + LIBS="$LIBS -lncurses", + found_ncurses=no) + fi fi if test "x$found_ncurses" = xyes; then - LIBS="$LIBS -lncurses" AC_DEFINE(HAVE_NCURSES_H) else # No ncurses, try curses.