autoconf: update curses.m4
[openafs.git] / src / cf / curses.m4
index dc01469..24c6535 100644 (file)
@@ -16,7 +16,10 @@ AC_DEFUN([OPENAFS_CURSES_LIB],
 [AC_CACHE_VAL([openafs_cv_curses_lib],
    [save_LIBS="$LIBS"
     openafs_cv_curses_lib=
-    AC_CHECK_LIB([ncurses], [initscr], [openafs_cv_curses_lib=-lncurses])
+    AC_CHECK_LIB([ncurses], [initscr],
+                [AC_CHECK_LIB([ncurses], [LINES], [openafs_cv_curses_lib=-lncurses],
+                              [AC_CHECK_LIB([tinfo], [LINES],
+                                            [openafs_cv_curses_lib="-lncurses -ltinfo"])])])
     AS_IF([test "x$openafs_cv_curses_lib" = x],
          [AC_CHECK_LIB([Hcurses], [initscr], [openafs_cv_curses_lib=-lHcurses])])
     AS_IF([test "x$openafs_cv_curses_lib" = x],
@@ -34,8 +37,10 @@ AC_DEFUN([_OPENAFS_CURSES_GETMAXYX_XTI],
  AC_CACHE_CHECK([getmaxyx macro], [openafs_cv_curses_getmaxyx],
    [save_LIBS="$LIBS"
     LIBS="$LIBS $LIB_curses"
-    AC_TRY_LINK(_OPENAFS_CURSES_HEADERS,
-               [int mx, my; initscr(); getmaxyx(stdscr, my, mx); endwin();],
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM(
+               _OPENAFS_CURSES_HEADERS,
+               [int mx, my; initscr(); getmaxyx(stdscr, my, mx); endwin();])],
                [openafs_cv_curses_getmaxyx=yes],
                [openafs_cv_curses_getmaxyx=no])
     LIBS="$save_LIBS"])