From cc85acd7729af217a8f4820ecb36a9be816dba75 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 10 Sep 2010 12:02:44 +0200 Subject: [PATCH] pty, readutmp: Fix for FreeBSD 8.0 and OpenBSD 4.6. * doc/glibc-functions/login_tty.texi: Mention the include file problem on FreeBSD 8.0 and OpenBSD 4.6. * lib/pty.in.h: Include before . * m4/pty_h.m4 (gl_PTY_H): Likewise. * m4/pty.m4 (gl_FUNC_FORKPTY, gl_FUNC_OPENPTY): Likewise. * m4/readutmp.m4 (gl_READUTMP): Include before . Invoke AC_INCLUDES_DEFAULT instead of using the undocumented variable ac_includes_default. Reported by Mats Erik Andersson . --- ChangeLog | 13 +++++++++++++ doc/glibc-functions/login_tty.texi | 4 +++- lib/pty.in.h | 2 ++ m4/pty.m4 | 10 +++++++++- m4/pty_h.m4 | 4 +++- m4/readutmp.m4 | 6 ++++-- 6 files changed, 34 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f3313fe79..47613441e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2010-09-10 Bruno Haible + + pty, readutmp: Fix for FreeBSD 8.0 and OpenBSD 4.6. + * doc/glibc-functions/login_tty.texi: Mention the include file problem + on FreeBSD 8.0 and OpenBSD 4.6. + * lib/pty.in.h: Include before . + * m4/pty_h.m4 (gl_PTY_H): Likewise. + * m4/pty.m4 (gl_FUNC_FORKPTY, gl_FUNC_OPENPTY): Likewise. + * m4/readutmp.m4 (gl_READUTMP): Include before . + Invoke AC_INCLUDES_DEFAULT instead of using the undocumented variable + ac_includes_default. + Reported by Mats Erik Andersson . + 2010-09-09 Eric Blake strsignal: work around NetBSD bug diff --git a/doc/glibc-functions/login_tty.texi b/doc/glibc-functions/login_tty.texi index 5312313d4..52b7c731a 100644 --- a/doc/glibc-functions/login_tty.texi +++ b/doc/glibc-functions/login_tty.texi @@ -25,5 +25,7 @@ mingw. This function is declared in @code{} on glibc, Cygwin, in @code{} on MacOS X 10.3, NetBSD 3.0, OpenBSD 3.8, in @code{} on FreeBSD 6.0, Haiku, and not declared at all -on OSF/1 5.1, Interix 3.5. +on OSF/1 5.1, Interix 3.5. Also note that @code{} is +a prerequisite of @code{} on FreeBSD 8.0, OpenBSD 4.6 and +of @code{} on FreeBSD 8.0. @end itemize diff --git a/lib/pty.in.h b/lib/pty.in.h index af98dfe2a..8d32d7142 100644 --- a/lib/pty.in.h +++ b/lib/pty.in.h @@ -34,6 +34,8 @@ # include #endif #if @HAVE_LIBUTIL_H@ +/* is a prerequisite of on FreeBSD 8.0. */ +# include # include #endif diff --git a/m4/pty.m4 b/m4/pty.m4 index 617b1b90f..7fc91caae 100644 --- a/m4/pty.m4 +++ b/m4/pty.m4 @@ -1,4 +1,4 @@ -# pty.m4 serial 7 +# pty.m4 serial 8 dnl Copyright (C) 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -28,6 +28,8 @@ AC_DEFUN([gl_FUNC_FORKPTY], dnl We assume that forkpty exists (possibly in libc, possibly in libutil) dnl if and only if it is declared. AC_CHECK_DECLS([forkpty],,, [[ +/* is a prerequisite of on FreeBSD 8.0. */ +#include #if HAVE_PTY_H # include #endif @@ -45,6 +47,8 @@ AC_DEFUN([gl_FUNC_FORKPTY], [gl_cv_func_forkpty_const], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ +/* is a prerequisite of on FreeBSD 8.0. */ +#include #if HAVE_PTY_H # include #endif @@ -83,6 +87,8 @@ AC_DEFUN([gl_FUNC_OPENPTY], dnl We assume that openpty exists (possibly in libc, possibly in libutil) dnl if and only if it is declared. AC_CHECK_DECLS([openpty],,, [[ +/* is a prerequisite of on FreeBSD 8.0. */ +#include #if HAVE_PTY_H # include #endif @@ -100,6 +106,8 @@ AC_DEFUN([gl_FUNC_OPENPTY], [gl_cv_func_openpty_const], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ +/* is a prerequisite of on FreeBSD 8.0. */ +#include #if HAVE_PTY_H # include #endif diff --git a/m4/pty_h.m4 b/m4/pty_h.m4 index 4b196f786..138c89249 100644 --- a/m4/pty_h.m4 +++ b/m4/pty_h.m4 @@ -1,4 +1,4 @@ -# pty_h.m4 serial 9 +# pty_h.m4 serial 10 dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -32,6 +32,8 @@ AC_DEFUN_ONCE([gl_PTY_H], dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ +/* is a prerequisite of on FreeBSD 8.0. */ +#include #if HAVE_PTY_H # include #endif diff --git a/m4/readutmp.m4 b/m4/readutmp.m4 index d4c900878..16b495b32 100644 --- a/m4/readutmp.m4 +++ b/m4/readutmp.m4 @@ -1,4 +1,4 @@ -# readutmp.m4 serial 16 +# readutmp.m4 serial 17 dnl Copyright (C) 2002-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -17,12 +17,14 @@ AC_DEFUN([gl_READUTMP], AC_REQUIRE([AC_C_INLINE]) AC_CHECK_FUNCS_ONCE([utmpname utmpxname]) AC_CHECK_DECLS([getutent],,,[ +/* is a prerequisite of on FreeBSD 8.0, OpenBSD 4.6. */ +#include #ifdef HAVE_UTMP_H # include #endif ]) utmp_includes="\ -$ac_includes_default +AC_INCLUDES_DEFAULT #ifdef HAVE_UTMPX_H # include #endif -- 2.11.0