configure.in: check for sys/stropts.h header instead of grantpt function
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 31 Dec 2009 17:10:53 +0000 (31 18:10 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 1 Jan 2010 15:34:12 +0000 (1 16:34 +0100)
Apparently, NetBSD has a grantpt function, but no sys/stropts.h header
and so we shouldn't use System V pty calls on NetBSD.

Problem reported by Peter Bex <Peter.Bex@xs4all.nl>

dist/configure.in

index f0f9e60..0033bb2 100644 (file)
@@ -791,13 +791,13 @@ fi
 AC_MSG_RESULT($vi_cv_gettimeofday)
 
 dnl Check for which version of openpty to use, System V or Berkeley.
-AC_MSG_CHECKING(for System V pty calls)
 AC_CACHE_VAL(vi_cv_sys5_pty, [dnl
-AC_TRY_LINK(, [grantpt(0);],
+AC_CHECK_HEADER(sys/stropts.h,
        [vi_cv_sys5_pty=yes], [vi_cv_sys5_pty=no])])
 if test "$vi_cv_sys5_pty" = yes; then
        AC_DEFINE(HAVE_SYS5_PTY)
 fi
+AC_MSG_CHECKING(for System V pty calls)
 AC_MSG_RESULT($vi_cv_sys5_pty)
 
 dnl Check for the revoke system call.