diff --git a/configure.ac b/configure.ac index 6cd859f0..824b4ab2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,5 @@ # configure.ac -# Miscellaneous bits. AC_INIT(tmux, 2.2) AC_CONFIG_AUX_DIR(etc) @@ -143,12 +142,23 @@ if test "x$found_libevent" = xno; then AC_MSG_ERROR("libevent not found") fi -# Look for curses. -AC_SEARCH_LIBS( - setupterm, - [terminfo curses ncurses tinfo], - found_curses=yes, - found_curses=no +# Look for ncurses +PKG_CHECK_MODULES( + LIBNCURSES, + ncurses, + [ + CPPFLAGS="$LIBNCURSES_CFLAGS $CPPFLAGS" + LIBS="$LIBNCURSES_LIBS $LIBS" + found_curses=yes + ], + [ + AC_SEARCH_LIBS( + setupterm, + [ncurses curses terminfo], + found_curses=yes, + found_curses=no + ) + ] ) if test "x$found_curses" = xno; then AC_MSG_ERROR("curses not found") diff --git a/tty-term.c b/tty-term.c index f536859e..21756e51 100644 --- a/tty-term.c +++ b/tty-term.c @@ -18,9 +18,9 @@ #include -#ifdef HAVE_CURSES_H +#if defined(HAVE_CURSES_H) #include -#else +#elif defined(HAVE_NCURSES_H) #include #endif #include