Mercurial > gnulib
comparison 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 |
comparison
equal
deleted
inserted
replaced
17303:0e38241a3d05 | 17304:d2ccaec7b18c |
---|---|
120 struct winsize const *); | 120 struct winsize const *); |
121 ]]) | 121 ]]) |
122 ], | 122 ], |
123 [gl_cv_func_openpty_const=yes], [gl_cv_func_openpty_const=no]) | 123 [gl_cv_func_openpty_const=yes], [gl_cv_func_openpty_const=no]) |
124 ]) | 124 ]) |
125 if test $gl_cv_func_openpty_const != yes; then | 125 fi |
126 REPLACE_OPENPTY=1 | 126 if test $gl_cv_func_openpty_const = yes; then |
127 AC_DEFINE([HAVE_OPENPTY], [1], | 127 HAVE_OPENPTY=1 |
128 [Define to 1 if the system has the 'openpty' function.]) | |
129 fi | |
130 else | 128 else |
131 dnl The system does not have openpty. | 129 dnl We need gnulib's openpty. |
132 HAVE_OPENPTY=0 | |
133 dnl Prerequisites of lib/openpty.c in this case. | 130 dnl Prerequisites of lib/openpty.c in this case. |
134 AC_CHECK_FUNCS([_getpty posix_openpt]) | 131 AC_CHECK_FUNCS([_getpty posix_openpt], [HAVE_OPENPTY=1], [HAVE_OPENPTY=0]) |
132 REPLACE_OPENPTY=$HAVE_OPENPTY | |
133 fi | |
134 if test $HAVE_OPENPTY = 1; then | |
135 AC_DEFINE([HAVE_OPENPTY], [1], | |
136 [Define to 1 if the system has the 'openpty' function.]) | |
135 fi | 137 fi |
136 ]) | 138 ]) |
137 | 139 |
138 AC_DEFUN([gl_FUNC_LOGIN_TTY], | 140 AC_DEFUN([gl_FUNC_LOGIN_TTY], |
139 [ | 141 [ |