]> Savannah Git Hosting - gnulib.git/commitdiff
openpty, forkpty: Fix build error on Solaris 11.4.
authorBruno Haible <bruno@clisp.org>
Wed, 27 Nov 2019 23:34:34 +0000 (00:34 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 27 Nov 2019 23:34:34 +0000 (00:34 +0100)
* m4/pty_h.m4 (gl_PTY_H): Test for termios.h. Look for the declarations
also in <termios.h>.
* m4/pty.m4 (gl_FUNC_FORKPTY, gl_FUNC_OPENPTY): Look for the declaration
of the function also in <termios.h>.
* doc/glibc-functions/openpty.texi: Mention the Solaris 11.4 problems.
* doc/glibc-functions/forkpty.texi: Likewise.

ChangeLog
doc/glibc-functions/forkpty.texi
doc/glibc-functions/openpty.texi
m4/pty.m4
m4/pty_h.m4

index bd2330e95ec03a15b93e28d7433a57a79604791b..c0940d63fd80c010891a47dceeb40b4ba860545b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2019-11-27  Bruno Haible  <bruno@clisp.org>
+
+       openpty, forkpty: Fix build error on Solaris 11.4.
+       * m4/pty_h.m4 (gl_PTY_H): Test for termios.h. Look for the declarations
+       also in <termios.h>.
+       * m4/pty.m4 (gl_FUNC_FORKPTY, gl_FUNC_OPENPTY): Look for the declaration
+       of the function also in <termios.h>.
+       * doc/glibc-functions/openpty.texi: Mention the Solaris 11.4 problems.
+       * doc/glibc-functions/forkpty.texi: Likewise.
+
 2019-11-27  Bruno Haible  <bruno@clisp.org>
 
        New options --enable-threads=isoc and --enable-threads=isoc+posix.
index 937005f1ef4e788c4e89b0e68249cf9a588a0e11..c4cf82c16518f2ed686ff3874128214d9f32d4be 100644 (file)
@@ -29,13 +29,14 @@ and Mac OS X) linking with @code{-lutil} is not required.
 On glibc, OpenBSD, NetBSD and FreeBSD linking with @code{-lutil} is
 required.
 @item
-The function is declared in pty.h on Cygwin
-and glibc.  It is declared in util.h on Mac OS X, OpenBSD and NetBSD.
+The function is declared in pty.h on glibc and Cygwin.
+It is declared in util.h on Mac OS X, OpenBSD, and NetBSD.
 It is declared in libutil.h on FreeBSD.
+It is declared in termios.h on Solaris.
 @item
 Some platforms declare the function without marking the last two
 parameters @code{const}.
-FreeBSD, Cygwin 1.7.1.
+FreeBSD, Solaris 11.4, Cygwin 1.7.1.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index d5f4cf98e54bda74ba0f1135947f735de84b676f..33f6b74968e70773bcb9bf2322a69bae3e339a82 100644 (file)
@@ -29,13 +29,14 @@ and Mac OS X) linking with @code{-lutil} is not required.
 On glibc, OpenBSD, NetBSD and FreeBSD linking with @code{-lutil} is
 required.
 @item
-The function is declared in pty.h on Cygwin
-and glibc.  It is declared in util.h on Mac OS X, OpenBSD and NetBSD.
+The function is declared in pty.h on glibc and Cygwin.
+It is declared in util.h on Mac OS X, OpenBSD, and NetBSD.
 It is declared in libutil.h on FreeBSD.
+It is declared in termios.h on Solaris.
 @item
 Some platforms declare the function without marking the last two
 parameters @code{const}.
-FreeBSD, Cygwin 1.7.1.
+FreeBSD, Solaris 11.4, Cygwin 1.7.1.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 9e6087380442732eb88294cecdc34f1a69166684..51ad6479d4855c17c3039738b73e67c6fef22ff7 100644 (file)
--- a/m4/pty.m4
+++ b/m4/pty.m4
@@ -1,4 +1,4 @@
-# pty.m4 serial 13
+# pty.m4 serial 14
 dnl Copyright (C) 2010-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -39,6 +39,9 @@ AC_DEFUN([gl_FUNC_FORKPTY],
 #if HAVE_LIBUTIL_H
 # include <libutil.h>
 #endif
+#if HAVE_TERMIOS_H
+# include <termios.h>
+#endif
 ]])
   if test $ac_cv_have_decl_forkpty = yes; then
     dnl The system has forkpty.
@@ -57,6 +60,9 @@ AC_DEFUN([gl_FUNC_FORKPTY],
 #endif
 #if HAVE_LIBUTIL_H
 # include <libutil.h>
+#endif
+#if HAVE_TERMIOS_H
+# include <termios.h>
 #endif
           ]], [[
             int forkpty (int *, char *, struct termios const *,
@@ -98,6 +104,9 @@ AC_DEFUN([gl_FUNC_OPENPTY],
 #if HAVE_LIBUTIL_H
 # include <libutil.h>
 #endif
+#if HAVE_TERMIOS_H
+# include <termios.h>
+#endif
 ]])
   if test $ac_cv_have_decl_openpty = yes; then
     AC_DEFINE([HAVE_OPENPTY], [1],
@@ -118,6 +127,9 @@ AC_DEFUN([gl_FUNC_OPENPTY],
 #endif
 #if HAVE_LIBUTIL_H
 # include <libutil.h>
+#endif
+#if HAVE_TERMIOS_H
+# include <termios.h>
 #endif
           ]], [[
             int openpty (int *, int *, char *, struct termios const *,
index d797f230563492bda3221bde6c5cf27c4ce9226f..5fb4ddb5a2936d7bd5f5b6a3c38b1736de7e94b9 100644 (file)
@@ -1,4 +1,4 @@
-# pty_h.m4 serial 10
+# pty_h.m4 serial 11
 dnl Copyright (C) 2009-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -22,6 +22,7 @@ AC_DEFUN_ONCE([gl_PTY_H],
     if test $ac_cv_header_libutil_h = yes; then
       HAVE_LIBUTIL_H=1
     fi
+    AC_CHECK_HEADERS_ONCE([termios.h])
   else # Have <pty.h>, assume forkpty is declared there.
     HAVE_PTY_H=1
   fi
@@ -42,6 +43,9 @@ AC_DEFUN_ONCE([gl_PTY_H],
 #endif
 #if HAVE_LIBUTIL_H
 # include <libutil.h>
+#endif
+#if HAVE_TERMIOS_H
+# include <termios.h>
 #endif
     ]], [forkpty openpty])
 ])