configure.in | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/configure.in b/configure.in index f4a4a2d..1333234 100644 --- a/configure.in +++ b/configure.in @@ -36,19 +36,22 @@ AC_ARG_WITH([ncursesw], AC_HELP_STRING([--with-ncursesw], [compile/link with wide-char ncurses library @<:@default@:>@]), [ncurses=ncursesw]) if test "$ncurses" = "auto" -o "$ncurses" = "ncursesw"; then - AC_CHECK_LIB([ncursesw], - [initscr], - [LIBS="$LIBS -lncursesw"; ncurses=ncursesw], - [ncurses=ncurses]) + PKG_CHECK_MODULES([NCURSES], [ncursesw], [LIBS="$LIBS $NCURSES_LIBS"; ncurses=ncursesw], + [AC_CHECK_LIB([ncursesw], + [initscr], + [LIBS="$LIBS -lncursesw"; ncurses=ncursesw], + [ncurses=ncurses]) + ]) fi if test "$ncurses" = "ncurses"; then - AC_CHECK_LIB([ncurses], - [initscr], - [LIBS="$LIBS -lncurses"], - [AC_MSG_ERROR(ncurses library is required)]) + PKG_CHECK_MODULES([NCURSES], [ncurses], [LIBS="$LIBS $NCURSES_LIBS"], + [AC_CHECK_LIB([ncurses], + [initscr], + [LIBS="$LIBS -lncurses"], + [AC_MSG_ERROR(ncurses library is required)]) + ]) fi AC_OUTPUT([Makefile]) -