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.16 by ayin, Mon Dec 24 01:04:37 2007 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines