From 6470d1e832f629e9366a168382be66328968a706 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 21 Jan 2023 21:00:19 +0100 Subject: [PATCH] login_tty: Fix detection of declaration (regression 2023-01-19). * m4/pty.m4 (gl_FUNC_LOGIN_TTY): Check for the three possible header files. --- ChangeLog | 6 ++++++ m4/pty.m4 | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1de0058d5e..cc88b5cdef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2023-01-21 Bruno Haible + + login_tty: Fix detection of declaration (regression 2023-01-19). + * m4/pty.m4 (gl_FUNC_LOGIN_TTY): Check for the three possible header + files. + 2023-01-21 Bruno Haible alignasof tests: Rename test file. diff --git a/m4/pty.m4 b/m4/pty.m4 index 54523fdac0..f6b5bb3115 100644 --- a/m4/pty.m4 +++ b/m4/pty.m4 @@ -1,4 +1,4 @@ -# pty.m4 serial 16 +# pty.m4 serial 17 dnl Copyright (C) 2010-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -154,8 +154,19 @@ AC_DEFUN([gl_FUNC_LOGIN_TTY], [ AC_REQUIRE([gl_PTY_LIB]) + AC_CHECK_HEADERS_ONCE([utmp.h util.h libutil.h]) gl_saved_libs="$LIBS" LIBS="$LIBS $PTY_LIB" - gl_CHECK_FUNCS_ANDROID([login_tty], [[#include ]]) + gl_CHECK_FUNCS_ANDROID([login_tty], [[ + #include + #if HAVE_UTMP_H + # include + #endif + #if HAVE_UTIL_H + # include + #elif HAVE_LIBUTIL_H + # include + #endif + ]]) LIBS="$gl_saved_LIBS" ]) -- 2.39.5