Mercurial > gnulib
annotate m4/pty.m4 @ 17304:d2ccaec7b18c
openpty: fix bug where HAVE_OPENPTY wasn't defined
See the thread starting at:
http://lists.gnu.org/archive/html/bug-gnulib/2013-01/msg00185.html
* m4/pty.m4 (gl_FUNC_OPENPTY): Define HAVE_OPENPTY when the
openpty function exists, not merely when we intend to replace it.
author | Reuben Thomas <rrt@sc3d.org> |
---|---|
date | Thu, 31 Jan 2013 13:55:55 -0800 |
parents | e542fd46ad6f |
children | 9d7698fd5b5f |
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 |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
101 dnl The system has openpty. |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
102 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
|
103 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
|
104 [gl_cv_func_openpty_const], |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
105 [AC_COMPILE_IFELSE( |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
106 [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
|
107 /* <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
|
108 #include <sys/types.h> |
13006
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
109 #if HAVE_PTY_H |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
110 # include <pty.h> |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
111 #endif |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
112 #if HAVE_UTIL_H |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
113 # include <util.h> |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
114 #endif |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
115 #if HAVE_LIBUTIL_H |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
116 # include <libutil.h> |
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
117 #endif |
13032
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
118 ]], [[ |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
119 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
|
120 struct winsize const *); |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
121 ]]) |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
122 ], |
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
123 [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
|
124 ]) |
17304
d2ccaec7b18c
openpty: fix bug where HAVE_OPENPTY wasn't defined
Reuben Thomas <rrt@sc3d.org>
parents:
17249
diff
changeset
|
125 fi |
d2ccaec7b18c
openpty: fix bug where HAVE_OPENPTY wasn't defined
Reuben Thomas <rrt@sc3d.org>
parents:
17249
diff
changeset
|
126 if test $gl_cv_func_openpty_const = yes; then |
d2ccaec7b18c
openpty: fix bug where HAVE_OPENPTY wasn't defined
Reuben Thomas <rrt@sc3d.org>
parents:
17249
diff
changeset
|
127 HAVE_OPENPTY=1 |
13032
64faceabf217
openpty: Provide replacement on AIX, HP-UX, IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13006
diff
changeset
|
128 else |
17304
d2ccaec7b18c
openpty: fix bug where HAVE_OPENPTY wasn't defined
Reuben Thomas <rrt@sc3d.org>
parents:
17249
diff
changeset
|
129 dnl We need gnulib's openpty. |
15066
554c82adb9b9
openpty: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents:
15065
diff
changeset
|
130 dnl Prerequisites of lib/openpty.c in this case. |
17304
d2ccaec7b18c
openpty: fix bug where HAVE_OPENPTY wasn't defined
Reuben Thomas <rrt@sc3d.org>
parents:
17249
diff
changeset
|
131 AC_CHECK_FUNCS([_getpty posix_openpt], [HAVE_OPENPTY=1], [HAVE_OPENPTY=0]) |
d2ccaec7b18c
openpty: fix bug where HAVE_OPENPTY wasn't defined
Reuben Thomas <rrt@sc3d.org>
parents:
17249
diff
changeset
|
132 REPLACE_OPENPTY=$HAVE_OPENPTY |
d2ccaec7b18c
openpty: fix bug where HAVE_OPENPTY wasn't defined
Reuben Thomas <rrt@sc3d.org>
parents:
17249
diff
changeset
|
133 fi |
d2ccaec7b18c
openpty: fix bug where HAVE_OPENPTY wasn't defined
Reuben Thomas <rrt@sc3d.org>
parents:
17249
diff
changeset
|
134 if test $HAVE_OPENPTY = 1; then |
d2ccaec7b18c
openpty: fix bug where HAVE_OPENPTY wasn't defined
Reuben Thomas <rrt@sc3d.org>
parents:
17249
diff
changeset
|
135 AC_DEFINE([HAVE_OPENPTY], [1], |
d2ccaec7b18c
openpty: fix bug where HAVE_OPENPTY wasn't defined
Reuben Thomas <rrt@sc3d.org>
parents:
17249
diff
changeset
|
136 [Define to 1 if the system has the 'openpty' function.]) |
13006
b89998923de3
forkpty, openpty: prefer glibc's const-safe prototype
Eric Blake <eblake@redhat.com>
parents:
13005
diff
changeset
|
137 fi |
13005
9bc579132d24
forkpty, openpty: split functions into new modules
Eric Blake <eblake@redhat.com>
parents:
diff
changeset
|
138 ]) |
13036 | 139 |
140 AC_DEFUN([gl_FUNC_LOGIN_TTY], | |
141 [ | |
142 AC_REQUIRE([gl_PTY_LIB]) | |
143 | |
13692
4ca8fd7377b9
login_tty: Fix detection of function on FreeBSD, OpenBSD, NetBSD.
Bruno Haible <bruno@clisp.org>
parents:
13662
diff
changeset
|
144 gl_saved_libs="$LIBS" |
4ca8fd7377b9
login_tty: Fix detection of function on FreeBSD, OpenBSD, NetBSD.
Bruno Haible <bruno@clisp.org>
parents:
13662
diff
changeset
|
145 LIBS="$LIBS $PTY_LIB" |
4ca8fd7377b9
login_tty: Fix detection of function on FreeBSD, OpenBSD, NetBSD.
Bruno Haible <bruno@clisp.org>
parents:
13662
diff
changeset
|
146 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
|
147 LIBS="$gl_saved_LIBS" |
13036 | 148 ]) |