The first commit adds pkgconfig support to detect ncurses. This is the preferred way and configure falls back to AC_SEARCH_LIBS if pkgconfig isn't found or pkgconfig doesn't find ncursesw.
The second commit fixes issue #138 by adding a second AC_SEARCH_LIBS call for the keypad function.
AC_SEARCH_LIBS
if pkgconfig isn't found or pkgconfig doesn't findncursesw
.AC_SEARCH_LIBS
call for thekeypad
function.