ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libptytty/ptytty.m4
(Generate patch)

Comparing libptytty/ptytty.m4 (file contents):
Revision 1.15 by ayin, Mon Nov 5 22:06:56 2007 UTC vs.
Revision 1.17 by root, Mon May 5 16:51:28 2008 UTC

7 pty.h \ 7 pty.h \
8 util.h \ 8 util.h \
9 libutil.h \ 9 libutil.h \
10 sys/ioctl.h \ 10 sys/ioctl.h \
11 sys/stropts.h \ 11 sys/stropts.h \
12 stropts.h \
12) 13)
13 14
14AC_CHECK_FUNCS( \ 15AC_CHECK_FUNCS( \
15 revoke \ 16 revoke \
16 _getpty \ 17 _getpty \
63 ;; 64 ;;
64esac 65esac
65 66
66if test x$ac_cv_func_getpt = xyes -o x$ac_cv_func_posix_openpt = xyes -o x$have_clone = xyes; then 67if test x$ac_cv_func_getpt = xyes -o x$ac_cv_func_posix_openpt = xyes -o x$have_clone = xyes; then
67 AC_MSG_CHECKING(for UNIX98 ptys) 68 AC_MSG_CHECKING(for UNIX98 ptys)
68 AC_TRY_LINK([#include <stdlib.h>], 69 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>]],
69 [grantpt(0);unlockpt(0);ptsname(0);], 70 [[grantpt(0);unlockpt(0);ptsname(0);]])],
70 [unix98_pty=yes 71 [unix98_pty=yes
71 AC_DEFINE(UNIX98_PTY, 1, "") 72 AC_DEFINE(UNIX98_PTY, 1, "")
72 AC_MSG_RESULT(yes)], 73 AC_MSG_RESULT(yes)],
73 [AC_MSG_RESULT(no)]) 74 [AC_MSG_RESULT(no)])
74fi 75fi
167if test x$struct_utmpx_host = xyes; then 168if test x$struct_utmpx_host = xyes; then
168 AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host) 169 AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host)
169fi 170fi
170 171
171AC_CACHE_CHECK(for session in utmpx struct, struct_utmpx_session, 172AC_CACHE_CHECK(for session in utmpx struct, struct_utmpx_session,
172[AC_TRY_COMPILE([#include <sys/types.h> 173[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
173#include <utmpx.h>], 174#include <utmpx.h>]], [[struct utmpx utx; utx.ut_session;]])],[struct_utmpx_session=yes],[struct_utmpx_session=no])])
174[struct utmpx utx; utx.ut_session;],
175struct_utmpx_session=yes, struct_utmpx_session=no)])
176if test x$struct_utmpx_session = xyes; then 175if test x$struct_utmpx_session = xyes; then
177 AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session) 176 AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session)
178fi 177fi
179) dnl# AC_CHECK_HEADERS(utmpx.h 178) dnl# AC_CHECK_HEADERS(utmpx.h
180 179
440]) 439])
441 440
442AC_DEFUN([SCM_RIGHTS_CHECK], 441AC_DEFUN([SCM_RIGHTS_CHECK],
443[ 442[
444AC_CACHE_CHECK(for unix-compliant filehandle passing ability, can_pass_fds, 443AC_CACHE_CHECK(for unix-compliant filehandle passing ability, can_pass_fds,
445[AC_TRY_LINK([ 444[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
446#include <cstddef> // broken bsds (is that redundant?) need this 445#include <cstddef> // broken bsds (is that redundant?) need this
447#include <sys/types.h> 446#include <sys/types.h>
448#include <sys/socket.h> 447#include <sys/socket.h>
449#include <sys/uio.h> 448#include <sys/uio.h>
450],[ 449]], [[
451{ 450{
452 msghdr msg; 451 msghdr msg;
453 iovec iov; 452 iovec iov;
454 char buf [100]; 453 char buf [100];
455 char data = 0; 454 char data = 0;
469 468
470 *(int *)CMSG_DATA (cmsg) = 5; 469 *(int *)CMSG_DATA (cmsg) = 5;
471 470
472 return sendmsg (3, &msg, 0); 471 return sendmsg (3, &msg, 0);
473} 472}
474],[can_pass_fds=yes],[can_pass_fds=no])]) 473]])],[can_pass_fds=yes],[can_pass_fds=no])])
475if test x$can_pass_fds = xyes; then 474if test x$can_pass_fds = xyes; then
476 AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) 475 AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing)
477else 476else
478 AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) 477 AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability])
479fi 478fi
480]) 479])
481 480
482AC_DEFUN([TTY_GROUP_CHECK], 481AC_DEFUN([TTY_GROUP_CHECK],
483[ 482[
484AC_CACHE_CHECK([for tty group], tty_group, 483AC_CACHE_CHECK([for tty group], tty_group,
485[AC_TRY_RUN([ 484[AC_RUN_IFELSE([AC_LANG_SOURCE([[
486#include <sys/types.h> 485#include <sys/types.h>
487#include <sys/stat.h> 486#include <sys/stat.h>
488#include <unistd.h> 487#include <unistd.h>
489#include <grp.h> 488#include <grp.h>
490 489
500 && (stat(tty, &st)) == 0 499 && (stat(tty, &st)) == 0
501 && st.st_gid == gr->gr_gid) 500 && st.st_gid == gr->gr_gid)
502 return 0; 501 return 0;
503 else 502 else
504 return 1; 503 return 1;
505}],
506[tty_group=yes],[tty_group=no],[tty_group=no])]) 504}]])],[tty_group=yes],[tty_group=no],[tty_group=no])])
507if test x$tty_group = xyes; then 505if test x$tty_group = xyes; then
508 AC_DEFINE(TTY_GID_SUPPORT, 1, "") 506 AC_DEFINE(TTY_GID_SUPPORT, 1, "")
509fi]) 507fi])
510 508

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines