2 dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
9 # Make sure that pty.h provides forkpty, or sets up a replacement header.
10 # Also define automake variable PTY_LIB to the library needed (if any).
15 # First make sure that pty.h provides forkpty, or setup the replacement.
16 AC_CHECK_HEADERS_ONCE([pty.h])
17 if test $ac_cv_header_pty_h != yes; then
18 AC_CHECK_DECL([forkpty],,, [[#include <util.h>]])
19 if test $ac_cv_have_decl_forkpty = no; then
20 unset ac_cv_have_decl_forkpty
21 AC_CHECK_DECL([forkpty],,, [[#include <libutil.h>]])
22 if test $ac_cv_have_decl_forkpty = no; then
23 AC_MSG_WARN([[Cannot find forkpty, build will likely fail]])
26 PTY_HEADER='libutil.h'
33 # Second check for the library required for forkpty.
35 AC_SEARCH_LIBS([forkpty], [util],
36 [if test "$ac_cv_search_forkpty" != "none required"; then
37 PTY_LIB="$ac_cv_search_forkpty"
42 AC_SUBST([PTY_HEADER])