Once more with feeling. This time, slightly simplified code with the bogus
"end" removed, and I've tested it, although only on GNU/Linux:
if test $ac_cv_have_decl_openpty = yes; then
...
[gl_cv_func_openpty_const=yes], [gl_cv_func_openpty_const=no])
])
fi
if test $gl_cv_func_openpty_const = yes; then
HAVE_OPENPTY=1
else
dnl We need gnulib's openpty.
dnl Prerequisites of lib/openpty.c in this case.
AC_CHECK_FUNCS([_getpty posix_openpt], [HAVE_OPENPTY=1;
REPLACE_OPENPTY=1],
[HAVE_OPENPTY=0; REPLACE_OPENPTY=0])
fi
if test $HAVE_OPENPTY = 1; then
AC_DEFINE([HAVE_OPENPTY], [1],
[Define to 1 if the system has the 'openpty' function.])
fi