--- nano-2.9.2/configure.ac.orig	2018-01-11 15:07:04.197241900 +0100
+++ nano-2.9.2/configure.ac	2018-01-11 15:08:08.022892500 +0100
@@ -531,11 +531,11 @@
 fi
 
 if eval "test x$CURSES_LIB_NAME = x"; then
-	AC_CHECK_HEADERS(ncurses.h)
+	AC_CHECK_HEADERS(ncursesw/ncurses.h)
 
 	if test "x$enable_utf8" != xno; then
 		OLDLIBS="$LIBS"
-		AC_CHECK_TOOL(NCURSESW_CONFIG, ncursesw5-config, no)
+		AC_CHECK_TOOL(NCURSESW_CONFIG, ncursesw6-config, no)
 		if test "x$NCURSESW_CONFIG" != xno; then
 			CURSES_LIB=`$NCURSESW_CONFIG --libs`
 			LIBS="$CURSES_LIB $LIBS"
