1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-17 12:41:05 +03:00

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 <sys/types.h> before <libutil.h>.
* m4/pty_h.m4 (gl_PTY_H): Likewise.
* m4/pty.m4 (gl_FUNC_FORKPTY, gl_FUNC_OPENPTY): Likewise.
* m4/readutmp.m4 (gl_READUTMP): Include <sys/types.h> before <utmp.h>.
Invoke AC_INCLUDES_DEFAULT instead of using the undocumented variable
ac_includes_default.
Reported by Mats Erik Andersson <mats.andersson@gisladisker.se>.
This commit is contained in:
Bruno Haible
2010-09-10 12:02:44 +02:00
parent c753b7cad5
commit cc85acd772
6 changed files with 34 additions and 5 deletions

View File

@@ -1,3 +1,16 @@
2010-09-10 Bruno Haible <bruno@clisp.org>
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 <sys/types.h> before <libutil.h>.
* m4/pty_h.m4 (gl_PTY_H): Likewise.
* m4/pty.m4 (gl_FUNC_FORKPTY, gl_FUNC_OPENPTY): Likewise.
* m4/readutmp.m4 (gl_READUTMP): Include <sys/types.h> before <utmp.h>.
Invoke AC_INCLUDES_DEFAULT instead of using the undocumented variable
ac_includes_default.
Reported by Mats Erik Andersson <mats.andersson@gisladisker.se>.
2010-09-09 Eric Blake <eblake@redhat.com> 2010-09-09 Eric Blake <eblake@redhat.com>
strsignal: work around NetBSD bug strsignal: work around NetBSD bug

View File

@@ -25,5 +25,7 @@ mingw.
This function is declared in @code{<utmp.h>} on glibc, Cygwin, This function is declared in @code{<utmp.h>} on glibc, Cygwin,
in @code{<util.h>} on MacOS X 10.3, NetBSD 3.0, OpenBSD 3.8, in @code{<util.h>} on MacOS X 10.3, NetBSD 3.0, OpenBSD 3.8,
in @code{<libutil.h>} on FreeBSD 6.0, Haiku, and not declared at all in @code{<libutil.h>} 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{<sys/types.h>} is
a prerequisite of @code{<utmp.h>} on FreeBSD 8.0, OpenBSD 4.6 and
of @code{<libutil.h>} on FreeBSD 8.0.
@end itemize @end itemize

View File

@@ -34,6 +34,8 @@
# include <util.h> # include <util.h>
#endif #endif
#if @HAVE_LIBUTIL_H@ #if @HAVE_LIBUTIL_H@
/* <sys/types.h> is a prerequisite of <libutil.h> on FreeBSD 8.0. */
# include <sys/types.h>
# include <libutil.h> # include <libutil.h>
#endif #endif

View File

@@ -1,4 +1,4 @@
# pty.m4 serial 7 # pty.m4 serial 8
dnl Copyright (C) 2010 Free Software Foundation, Inc. dnl Copyright (C) 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, 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 We assume that forkpty exists (possibly in libc, possibly in libutil)
dnl if and only if it is declared. dnl if and only if it is declared.
AC_CHECK_DECLS([forkpty],,, [[ AC_CHECK_DECLS([forkpty],,, [[
/* <sys/types.h> is a prerequisite of <libutil.h> on FreeBSD 8.0. */
#include <sys/types.h>
#if HAVE_PTY_H #if HAVE_PTY_H
# include <pty.h> # include <pty.h>
#endif #endif
@@ -45,6 +47,8 @@ AC_DEFUN([gl_FUNC_FORKPTY],
[gl_cv_func_forkpty_const], [gl_cv_func_forkpty_const],
[AC_COMPILE_IFELSE( [AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[ [AC_LANG_PROGRAM([[
/* <sys/types.h> is a prerequisite of <libutil.h> on FreeBSD 8.0. */
#include <sys/types.h>
#if HAVE_PTY_H #if HAVE_PTY_H
# include <pty.h> # include <pty.h>
#endif #endif
@@ -83,6 +87,8 @@ AC_DEFUN([gl_FUNC_OPENPTY],
dnl We assume that openpty exists (possibly in libc, possibly in libutil) dnl We assume that openpty exists (possibly in libc, possibly in libutil)
dnl if and only if it is declared. dnl if and only if it is declared.
AC_CHECK_DECLS([openpty],,, [[ AC_CHECK_DECLS([openpty],,, [[
/* <sys/types.h> is a prerequisite of <libutil.h> on FreeBSD 8.0. */
#include <sys/types.h>
#if HAVE_PTY_H #if HAVE_PTY_H
# include <pty.h> # include <pty.h>
#endif #endif
@@ -100,6 +106,8 @@ AC_DEFUN([gl_FUNC_OPENPTY],
[gl_cv_func_openpty_const], [gl_cv_func_openpty_const],
[AC_COMPILE_IFELSE( [AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[ [AC_LANG_PROGRAM([[
/* <sys/types.h> is a prerequisite of <libutil.h> on FreeBSD 8.0. */
#include <sys/types.h>
#if HAVE_PTY_H #if HAVE_PTY_H
# include <pty.h> # include <pty.h>
#endif #endif

View File

@@ -1,4 +1,4 @@
# pty_h.m4 serial 9 # pty_h.m4 serial 10
dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc. dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, 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 Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use. dnl corresponding gnulib module is not in use.
gl_WARN_ON_USE_PREPARE([[ gl_WARN_ON_USE_PREPARE([[
/* <sys/types.h> is a prerequisite of <libutil.h> on FreeBSD 8.0. */
#include <sys/types.h>
#if HAVE_PTY_H #if HAVE_PTY_H
# include <pty.h> # include <pty.h>
#endif #endif

View File

@@ -1,4 +1,4 @@
# readutmp.m4 serial 16 # readutmp.m4 serial 17
dnl Copyright (C) 2002-2010 Free Software Foundation, Inc. dnl Copyright (C) 2002-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@@ -17,12 +17,14 @@ AC_DEFUN([gl_READUTMP],
AC_REQUIRE([AC_C_INLINE]) AC_REQUIRE([AC_C_INLINE])
AC_CHECK_FUNCS_ONCE([utmpname utmpxname]) AC_CHECK_FUNCS_ONCE([utmpname utmpxname])
AC_CHECK_DECLS([getutent],,,[ AC_CHECK_DECLS([getutent],,,[
/* <sys/types.h> is a prerequisite of <utmp.h> on FreeBSD 8.0, OpenBSD 4.6. */
#include <sys/types.h>
#ifdef HAVE_UTMP_H #ifdef HAVE_UTMP_H
# include <utmp.h> # include <utmp.h>
#endif #endif
]) ])
utmp_includes="\ utmp_includes="\
$ac_includes_default AC_INCLUDES_DEFAULT
#ifdef HAVE_UTMPX_H #ifdef HAVE_UTMPX_H
# include <utmpx.h> # include <utmpx.h>
#endif #endif