+2022-09-03 Bruno Haible <bruno@clisp.org>
+
+ termcap: Fix link error on AIX 7.
+ * m4/termcap.m4 (gl_TERMCAP_BODY): Search also for libxcurses and for
+ libcurses, like gl_TERMINFO_BODY does.
+ * m4/terminfo.m4 (gl_TERMINFO_BODY): Update platform list in comment.
+
2022-09-02 Bruno Haible <bruno@clisp.org>
getrandom: Fix compilation error in C++ mode on FreeBSD 12.
-# termcap.m4 serial 9
+# termcap.m4 serial 10
dnl Copyright (C) 2000-2022 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl accordingly.
AC_LIB_LINKFLAGS_BODY([termcap])
+ dnl Search for libxcurses and define LIBXCURSES, LTLIBXCURSES and INCXCURSES
+ dnl accordingly.
+ AC_LIB_LINKFLAGS_BODY([xcurses])
+
+ dnl Search for libcurses and define LIBCURSES, LTLIBCURSES and INCCURSES
+ dnl accordingly.
+ AC_LIB_LINKFLAGS_BODY([curses])
+
else
LIBNCURSES=
LTLIBTERMCAP=
INCTERMCAP=
+ LIBXCURSES=
+ LTLIBXCURSES=
+ INCXCURSES=
+
+ LIBCURSES=
+ LTLIBCURSES=
+ INCCURSES=
+
fi
AC_CACHE_CHECK([where termcap library functions come from], [gl_cv_termcap], [
[[return tgetent ((char *) 0, "xterm");]])],
[gl_cv_termcap=libtermcap])
LIBS="$gl_save_LIBS"
+ if test "$gl_cv_termcap" != libtermcap; then
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBXCURSES"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ int tgetent (char *, const char *);
+ ]],
+ [[return tgetent ((char *) 0, "xterm");]])],
+ [gl_cv_termcap=libxcurses])
+ LIBS="$gl_save_LIBS"
+ if test "$gl_cv_termcap" != libxcurses; then
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBCURSES"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ int tgetent (char *, const char *);
+ ]],
+ [[return tgetent ((char *) 0, "xterm");]])],
+ [gl_cv_termcap=libcurses])
+ LIBS="$gl_save_LIBS"
+ fi
+ fi
fi
fi
])
;;
libtermcap)
;;
+ libxcurses)
+ LIBTERMCAP="$LIBXCURSES"
+ LTLIBTERMCAP="$LTLIBXCURSES"
+ INCTERMCAP="$INCXCURSES"
+ ;;
+ libcurses)
+ LIBTERMCAP="$LIBCURSES"
+ LTLIBTERMCAP="$LTLIBCURSES"
+ INCTERMCAP="$INCCURSES"
+ ;;
"not found"*)
LIBTERMCAP=
LTLIBTERMCAP=
;;
esac
case "$gl_cv_termcap" in
- libc | libncurses | libtermcap)
+ libc | libncurses | libtermcap | libxcurses | libcurses)
AC_DEFINE([HAVE_TERMCAP], 1,
[Define if tgetent(), tgetnum(), tgetstr(), tgetflag()
are among the termcap library functions.])
dnl tgetflag(), e.g. Linux (in libncurses) or Solaris (in libtermcap =
dnl libncurses).
dnl Some systems have them in a different library, e.g. OSF/1 (in libcurses,
- dnl not in libtermcap) or HP-UX (in libxcurses, not in libtermcap).
+ dnl not in libtermcap) or AIX, HP-UX (in libxcurses, not in libtermcap).
dnl Some systems, like NetBSD or BeOS, don't have these functions at all;
dnl they have only a libtermcap.
dnl Some systems, like BeOS, use GNU termcap, which has tparam() instead of