--- configure.in.old	2007-10-21 01:55:08.000000000 +0300
+++ configure.in	2007-10-21 01:55:26.000000000 +0300
@@ -36,7 +36,7 @@
 AC_CHECK_HEADER([sasl/sasl.h],AC_DEFINE(HAVE_SASL),AC_MSG_WARN([SASL support disabled]))
 
 # terminfo
-AC_SEARCH_LIBS([tigetstr],[curses ncurses],,AC_MSG_ERROR([libcurses not found]))
+AC_SEARCH_LIBS([tigetstr],[ncurses curses],,AC_MSG_ERROR([libcurses not found]))
 AC_CHECK_HEADER([curses.h],,AC_MSG_ERROR([curses.h not found]))
 
 # popt