Mercurial > gnulib
annotate m4/pty.m4 @ 17322:9d7698fd5b5f
openpty: fix bug where HAVE_OPENPTY is mistakenly 1
Problem reported by Mats Erik Andersson in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-02/msg00051.html>.
* m4/pty.m4 (gl_FUNC_OPENPTY): Define HAVE_OPENPTY when the
openpty function exists, not merely when we intend to replace it.
This corrects the 2013-01-31 patch, which mistakenly defined
HAVE_OPENPTY even on hosts that lacked it.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Fri, 08 Feb 2013 08:03:23 -0800 |
parents | d2ccaec7b18c |
children | fcc679804d75 |
rev | line source |
---|---|
15067
9ef4a2568d37
login_tty: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents:
15066
diff
changeset
|
1 # pty.m4 serial 12 |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16201
diff
changeset
|
2 dnl Copyright (C) 2010-2013 Free Software Foundation, Inc. |
13005
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
3 dnl This file is free software; the Free Software Foundation |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
4 dnl gives unlimited permission to copy and/or distribute it, |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
5 dnl with or without modifications, as long as this notice is preserved. |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
6 |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
7 # gl_PTY_LIB |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
8 # ---------- |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
9 # Define automake variable PTY_LIB to the library needed (if any). |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
10 AC_DEFUN([gl_PTY_LIB], |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
11 [ |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
12 # Check for the library required for forkpty. |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
13 PTY_LIB= |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
14 save_LIBS="$LIBS" |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
15 AC_SEARCH_LIBS([forkpty], [util], |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
16 [if test "$ac_cv_search_forkpty" != "none required"; then |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
17 PTY_LIB="$ac_cv_search_forkpty" |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
18 fi]) |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
19 LIBS="$save_LIBS" |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
20 AC_SUBST([PTY_LIB]) |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
21 ]) |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
22 |
13059
64b57ae70f5e
Rename gl_FORKPTY and gl_OPENPTY.
Bruno Haible <bruno@clisp.org>
parents:
13040
diff
changeset
|
23 AC_DEFUN([gl_FUNC_FORKPTY], |
13005
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
24 [ |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
25 AC_REQUIRE([gl_PTY_LIB]) |
13034
083838281860
pty: Consistent macro naming.
Bruno Haible <bruno@clisp.org>
parents:
13032
diff
changeset
|
26 AC_REQUIRE([gl_PTY_H]) |
13006
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
27 |
13040
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
28 dnl We assume that forkpty exists (possibly in libc, possibly in libutil) |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
29 dnl if and only if it is declared. |
13006
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
30 AC_CHECK_DECLS([forkpty],,, [[ |
13662
4cbe1ae13867
pty, readutmp: Fix for FreeBSD 8.0 and OpenBSD 4.6.
Bruno Haible <bruno@clisp.org>
parents:
13235
diff
changeset
|
31 /* <sys/types.h> is a prerequisite of <libutil.h> on FreeBSD 8.0. */ |
4cbe1ae13867
pty, readutmp: Fix for FreeBSD 8.0 and OpenBSD 4.6.
Bruno Haible <bruno@clisp.org>
parents:
13235
diff
changeset
|
32 #include <sys/types.h> |
13006
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
33 #if HAVE_PTY_H |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
34 # include <pty.h> |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
35 #endif |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
36 #if HAVE_UTIL_H |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
37 # include <util.h> |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
38 #endif |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
39 #if HAVE_LIBUTIL_H |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
40 # include <libutil.h> |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
41 #endif |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
42 ]]) |
13040
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
43 if test $ac_cv_have_decl_forkpty = yes; then |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
44 dnl The system has forkpty. |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
45 dnl Prefer glibc's const-safe prototype, if available. |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
46 AC_CACHE_CHECK([for const-safe forkpty signature], |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
47 [gl_cv_func_forkpty_const], |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
48 [AC_COMPILE_IFELSE( |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
49 [AC_LANG_PROGRAM([[ |
13662
4cbe1ae13867
pty, readutmp: Fix for FreeBSD 8.0 and OpenBSD 4.6.
Bruno Haible <bruno@clisp.org>
parents:
13235
diff
changeset
|
50 /* <sys/types.h> is a prerequisite of <libutil.h> on FreeBSD 8.0. */ |
4cbe1ae13867
pty, readutmp: Fix for FreeBSD 8.0 and OpenBSD 4.6.
Bruno Haible <bruno@clisp.org>
parents:
13235
diff
changeset
|
51 #include <sys/types.h> |
13006
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
52 #if HAVE_PTY_H |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
53 # include <pty.h> |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
54 #endif |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
55 #if HAVE_UTIL_H |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
56 # include <util.h> |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
57 #endif |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
58 #if HAVE_LIBUTIL_H |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
59 # include <libutil.h> |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
60 #endif |
13040
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
61 ]], [[ |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
62 int forkpty (int *, char *, struct termios const *, |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
63 struct winsize const *); |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
64 ]]) |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
65 ], |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
66 [gl_cv_func_forkpty_const=yes], [gl_cv_func_forkpty_const=no]) |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
67 ]) |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
68 if test $gl_cv_func_forkpty_const != yes; then |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
69 REPLACE_FORKPTY=1 |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
70 fi |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
71 else |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
72 dnl The system does not have forkpty. |
320f40c27bf5
forkpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13036
diff
changeset
|
73 HAVE_FORKPTY=0 |
13006
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
74 fi |
13005
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
75 ]) |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
76 |
13059
64b57ae70f5e
Rename gl_FORKPTY and gl_OPENPTY.
Bruno Haible <bruno@clisp.org>
parents:
13040
diff
changeset
|
77 AC_DEFUN([gl_FUNC_OPENPTY], |
13005
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
78 [ |
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
79 AC_REQUIRE([gl_PTY_LIB]) |
13034
083838281860
pty: Consistent macro naming.
Bruno Haible <bruno@clisp.org>
parents:
13032
diff
changeset
|
80 AC_REQUIRE([gl_PTY_H]) |
13006
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
81 |
13032
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
82 dnl Persuade Solaris <stdlib.h> to declare posix_openpt(). |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
83 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
84 |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
85 dnl We assume that openpty exists (possibly in libc, possibly in libutil) |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
86 dnl if and only if it is declared. |
13006
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
87 AC_CHECK_DECLS([openpty],,, [[ |
13662
4cbe1ae13867
pty, readutmp: Fix for FreeBSD 8.0 and OpenBSD 4.6.
Bruno Haible <bruno@clisp.org>
parents:
13235
diff
changeset
|
88 /* <sys/types.h> is a prerequisite of <libutil.h> on FreeBSD 8.0. */ |
4cbe1ae13867
pty, readutmp: Fix for FreeBSD 8.0 and OpenBSD 4.6.
Bruno Haible <bruno@clisp.org>
parents:
13235
diff
changeset
|
89 #include <sys/types.h> |
13006
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
90 #if HAVE_PTY_H |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
91 # include <pty.h> |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
92 #endif |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
93 #if HAVE_UTIL_H |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
94 # include <util.h> |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
95 #endif |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
96 #if HAVE_LIBUTIL_H |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
97 # include <libutil.h> |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
98 #endif |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
99 ]]) |
13032
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
100 if test $ac_cv_have_decl_openpty = yes; then |
17322
9d7698fd5b5f
openpty: fix bug where HAVE_OPENPTY is mistakenly 1
Paul Eggert <eggert@cs.ucla.edu>
parents:
17304
diff
changeset
|
101 AC_DEFINE([HAVE_OPENPTY], [1], |
9d7698fd5b5f
openpty: fix bug where HAVE_OPENPTY is mistakenly 1
Paul Eggert <eggert@cs.ucla.edu>
parents:
17304
diff
changeset
|
102 [Define to 1 if the system has the 'openpty' function.]) |
13032
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
103 dnl The system has openpty. |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
104 dnl Prefer glibc's const-safe prototype, if available. |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
105 AC_CACHE_CHECK([for const-safe openpty signature], |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
106 [gl_cv_func_openpty_const], |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
107 [AC_COMPILE_IFELSE( |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
108 [AC_LANG_PROGRAM([[ |
13662
4cbe1ae13867
pty, readutmp: Fix for FreeBSD 8.0 and OpenBSD 4.6.
Bruno Haible <bruno@clisp.org>
parents:
13235
diff
changeset
|
109 /* <sys/types.h> is a prerequisite of <libutil.h> on FreeBSD 8.0. */ |
4cbe1ae13867
pty, readutmp: Fix for FreeBSD 8.0 and OpenBSD 4.6.
Bruno Haible <bruno@clisp.org>
parents:
13235
diff
changeset
|
110 #include <sys/types.h> |
13006
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
111 #if HAVE_PTY_H |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
112 # include <pty.h> |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
113 #endif |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
114 #if HAVE_UTIL_H |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
115 # include <util.h> |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
116 #endif |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
117 #if HAVE_LIBUTIL_H |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
118 # include <libutil.h> |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
119 #endif |
13032
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
120 ]], [[ |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
121 int openpty (int *, int *, char *, struct termios const *, |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
122 struct winsize const *); |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
123 ]]) |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
124 ], |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
125 [gl_cv_func_openpty_const=yes], [gl_cv_func_openpty_const=no]) |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
126 ]) |
17322
9d7698fd5b5f
openpty: fix bug where HAVE_OPENPTY is mistakenly 1
Paul Eggert <eggert@cs.ucla.edu>
parents:
17304
diff
changeset
|
127 if test $gl_cv_func_openpty_const != yes; then |
9d7698fd5b5f
openpty: fix bug where HAVE_OPENPTY is mistakenly 1
Paul Eggert <eggert@cs.ucla.edu>
parents:
17304
diff
changeset
|
128 REPLACE_OPENPTY=1 |
9d7698fd5b5f
openpty: fix bug where HAVE_OPENPTY is mistakenly 1
Paul Eggert <eggert@cs.ucla.edu>
parents:
17304
diff
changeset
|
129 fi |
13032
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
130 else |
17322
9d7698fd5b5f
openpty: fix bug where HAVE_OPENPTY is mistakenly 1
Paul Eggert <eggert@cs.ucla.edu>
parents:
17304
diff
changeset
|
131 dnl The system does not have openpty. |
9d7698fd5b5f
openpty: fix bug where HAVE_OPENPTY is mistakenly 1
Paul Eggert <eggert@cs.ucla.edu>
parents:
17304
diff
changeset
|
132 HAVE_OPENPTY=0 |
15066
554c82adb9b9
openpty: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents:
15065
diff
changeset
|
133 dnl Prerequisites of lib/openpty.c in this case. |
17322
9d7698fd5b5f
openpty: fix bug where HAVE_OPENPTY is mistakenly 1
Paul Eggert <eggert@cs.ucla.edu>
parents:
17304
diff
changeset
|
134 AC_CHECK_FUNCS([_getpty posix_openpt]) |
13006
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
135 fi |
13005
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
136 ]) |
13036 | 137 |
138 AC_DEFUN([gl_FUNC_LOGIN_TTY], | |
139 [ | |
140 AC_REQUIRE([gl_PTY_LIB]) | |
141 | |
13692
4ca8fd7377b9
login_tty: Fix detection of function on FreeBSD, OpenBSD, NetBSD.
Bruno Haible <bruno@clisp.org>
parents:
13662
diff
changeset
|
142 gl_saved_libs="$LIBS" |
4ca8fd7377b9
login_tty: Fix detection of function on FreeBSD, OpenBSD, NetBSD.
Bruno Haible <bruno@clisp.org>
parents:
13662
diff
changeset
|
143 LIBS="$LIBS $PTY_LIB" |
4ca8fd7377b9
login_tty: Fix detection of function on FreeBSD, OpenBSD, NetBSD.
Bruno Haible <bruno@clisp.org>
parents:
13662
diff
changeset
|
144 AC_CHECK_FUNCS([login_tty]) |
4ca8fd7377b9
login_tty: Fix detection of function on FreeBSD, OpenBSD, NetBSD.
Bruno Haible <bruno@clisp.org>
parents:
13662
diff
changeset
|
145 LIBS="$gl_saved_LIBS" |
13036 | 146 ]) |