2 dnl Copyright (C) 2009 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 AC_CHECK_DECL([forkpty],,, [[#include <libutil.h>]])
21 if test $ac_cv_have_decl_forkpty = no; then
22 AC_MSG_WARN([[Cannot find forkpty, build will likely fail]])
25 PTY_HEADER='libutil.h'
32 # Second check for the library required for forkpty.
34 AC_SEARCH_LIBS([forkpty], [util],
35 [if test "$ac_cv_search_forkpty" != "none required"; then
36 PTY_LIB="$ac_cv_search_forkpty"
41 AC_SUBST([PTY_HEADER])