| 1 |
# login_tty.m4 |
| 2 |
# serial 3 |
| 3 |
dnl Copyright (C) 2010-2026 Free Software Foundation, Inc. |
| 4 |
dnl This file is free software; the Free Software Foundation |
| 5 |
dnl gives unlimited permission to copy and/or distribute it, |
| 6 |
dnl with or without modifications, as long as this notice is preserved. |
| 7 |
dnl This file is offered as-is, without any warranty. |
| 8 |
|
| 9 |
AC_DEFUN([gl_FUNC_LOGIN_TTY], |
| 10 |
[ |
| 11 |
AC_REQUIRE([gl_PTY_LIB]) |
| 12 |
|
| 13 |
AC_CHECK_HEADERS_ONCE([utmp.h util.h libutil.h termios.h]) |
| 14 |
gl_saved_libs="$LIBS" |
| 15 |
LIBS="$LIBS $PTY_LIB" |
| 16 |
gl_CHECK_FUNCS_ANDROID([login_tty], [[ |
| 17 |
#include <sys/types.h> |
| 18 |
#if HAVE_UTMP_H |
| 19 |
# include <utmp.h> |
| 20 |
#endif |
| 21 |
#if HAVE_UTIL_H |
| 22 |
# include <util.h> |
| 23 |
#elif HAVE_LIBUTIL_H |
| 24 |
# include <libutil.h> |
| 25 |
#elif HAVE_TERMIOS_H |
| 26 |
# include <termios.h> |
| 27 |
#endif |
| 28 |
]]) |
| 29 |
LIBS="$gl_saved_LIBS" |
| 30 |
|
| 31 |
if test $ac_cv_func_login_tty = no; then |
| 32 |
HAVE_LOGIN_TTY=0 |
| 33 |
case "$gl_cv_onwards_func_login_tty" in |
| 34 |
future*) REPLACE_LOGIN_TTY=1 ;; |
| 35 |
esac |
| 36 |
fi |
| 37 |
]) |