$OpenBSD: patch-configure_ac,v 1.7 2012/07/13 15:23:59 ajacoutot Exp $

From 2fec402d6523e4cf416d754f69d012dc67a58a2e Mon Sep 17 00:00:00 2001
From: Martin Pieuchot <mpi@openbsd.org>
Date: Fri, 13 Jul 2012 14:51:39 +0000
Subject: daemon: Support allocating PTYs through openpty on BSD

--- configure.ac.orig	Mon Apr  9 16:58:43 2012
+++ configure.ac	Mon Apr  9 16:58:49 2012
@@ -108,8 +108,12 @@ AC_CHECK_FUNCS(getpt posix_openpt grantpt unlockpt pts
 # Pull in the right libraries for various functions which might not be
 # bundled into an exploded libc.
 AC_CHECK_FUNC(socketpair,[have_socketpair=1],AC_CHECK_LIB(socket,socketpair,[have_socketpair=1; LIBS="$LIBS -lsocket"]))
+AC_CHECK_FUNC(openpty,[have_openpty=1],AC_CHECK_LIB(util,openpty,[have_openpty=1; LIBS="$LIBS -lutil"]))
 if test x$have_socketpair = x1 ; then
 	AC_DEFINE(HAVE_SOCKETPAIR,1,[Define if you have the socketpair function.])
+fi
+if test x$have_openpty = x1 ; then
+	AC_DEFINE(HAVE_OPENPTY,1,[Define if you have the openpty function.])
 fi
 
 AC_SEARCH_LIBS(login_tty, util, [AC_DEFINE([HAVE_LOGIN_TTY],[],[Whether login_tty is available])])
