--- a/configure.ac
+++ b/configure.ac
@@ -1,13 +1,23 @@
-AC_INIT([tig], [0],
- [Jonas Fonseca <fonseca@diku.dk>],
- [tig])
+AC_INIT([tig], [0], [Jonas Fonseca <fonseca@diku.dk>], [tig])
AC_LANG([C])
AC_CONFIG_HEADER(config.h)
AC_CONFIG_SRCDIR(tig.c)
-AC_SEARCH_LIBS([wclear], [ncursesw ncurses curses], [],
- [AC_ERROR([curses not found])])
+cursed=no
+AC_CHECK_HEADERS([ncursesw/ncurses.h],
+ [AC_SEARCH_LIBS([initscr], [ncursesw], [cursed=yes])])
+case "$cursed" in "no")
+ AC_CHECK_HEADERS([ncurses/ncurses.h ncurses.h],
+ [AC_SEARCH_LIBS([wclear], [ncurses], [cursed=yes])])
+
+ case "$cursed" in "no")
+ AC_ERROR([ncurses not found])
+ esac
+
+ AC_MSG_WARN([The found ncurses library does not support wide-char.])
+ AC_MSG_WARN([This means that tig will not correctly render UTF-8.])
+esac
AM_ICONV
@@ -26,9 +36,3 @@ AC_CHECK_PROGS(DOCBOOK2PDF, [docbook2pdf false])
AC_CONFIG_FILES([config.make])
AC_OUTPUT
-
-case "$LIBS" in
-*-lncursesw*) ;;
-*) AC_MSG_RESULT([NOTE: The found ncurses library does not support wide-char.])
- AC_MSG_RESULT([NOTE: This means that tig will not correctly render UTF-8])
-esac |