Revert "Work around a GCC bug that causes inet_checksum() to give wrong results."
[tinc] / m4 / curses.m4
index 408ae28..031e1ee 100644 (file)
@@ -31,12 +31,14 @@ AC_DEFUN([tinc_CURSES],
       [AC_MSG_ERROR("curses header files not found."); break]
     )
 
-    AC_CHECK_LIB(curses, initscr,
-      [CURSES_LIBS="-lcurses"],
-      [AC_MSG_ERROR("curses libraries not found.")]
+    AC_CHECK_LIB(ncurses, initscr,
+      [CURSES_LIBS="-lncurses"; AC_CHECK_LIB(tinfo, wtimeout, [CURSES_LIBS+=" -ltinfo"], [])],
+      [AC_CHECK_LIB(curses, initscr,
+        [CURSES_LIBS="-lcurses"],
+        [AC_MSG_ERROR("curses libraries not found.")]
+      )]
     )
   ])
 
   AC_SUBST(CURSES_LIBS)
-  AM_CONDITIONAL(CURSES, test "$curses" = true)
 ])