diff --git a/configure.ac b/configure.ac index 2d79f35..b82dd49 100644 --- a/configure.ac +++ b/configure.ac @@ -17,11 +17,8 @@ AC_CONFIG_MACRO_DIR([m4]) dnl Check for programs AC_PROG_CC_C99 AC_PROG_INSTALL -AX_WITH_CURSES +PKG_PROG_PKG_CONFIG -AS_IF([ test "x$ax_cv_curses" = xno ], - [AC_MSG_ERROR([No curses support detected.]) - ]) dnl ======================================================= dnl initialize variables @@ -83,6 +80,19 @@ mingw32* | windows*) esac AM_CONDITIONAL([HAVE_WINDOWS], [test $HAVE_WINDOWS -eq 1]) +dnl ncursesw + +PKG_CHECK_MODULES([ncursesw], [ncursesw],[ + LIBS="$LIBS $ncursesw_LIBS" + ax_cv_curses_color=yes + ax_cv_curses_mouse=yes + ax_cv_curses_enhanced=yes + AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if the Ncurses library is present]) + AC_SUBST([CURSES_LIB],[$ncursesw_LIBS]) + ], + [AC_MSG_ERROR([No curses support detected.])]) + + dnl multi-byte character support AC_ARG_ENABLE([multibyte], @@ -207,12 +217,6 @@ AM_CONDITIONAL(ENABLE_HELP_SCREEN, test x$enable_help_screen = xyes) dnl Optional - curses getmouse support -dnl AC_CHECK_LIB depends on being able to prepend a '-l', remove the '-l' from CURSES_LIB first -AC_CHECK_LIB([$(expr substr $CURSES_LIB 3 99)], - [getmouse], - [ax_cv_curses_mouse=yes], - [ax_cv_curses_mouse=no]) - AC_ARG_ENABLE([mouse], AS_HELP_STRING([--enable-mouse], [Enable curses getmouse support @<:@default=yes@:>@]),