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

Comparing libptytty/ptytty.m4 (file contents):
Revision 1.1 by ayin, Sat Jan 21 23:11:04 2006 UTC vs.
Revision 1.6 by root, Wed Jan 25 21:17:46 2006 UTC

1dnl this file is part of libptytty, do not make local modifications
2dnl http://software.schmorp.de/pkg/libptytty
3
1AC_DEFUN([PTY_CHECK], 4AC_DEFUN([PTY_CHECK],
2[ 5[
3AC_CHECK_HEADERS( \ 6AC_CHECK_HEADERS( \
4 pty.h \ 7 pty.h \
5 util.h \ 8 util.h \
71fi 74fi
72]) 75])
73 76
74AC_DEFUN([UTMP_CHECK], 77AC_DEFUN([UTMP_CHECK],
75[ 78[
79support_utmp=yes
80support_wtmp=yes
81support_lastlog=yes
82
83AC_ARG_ENABLE(utmp,
84 [ --enable-utmp enable utmp (utmpx) support],
85 [if test x$enableval = xyes -o x$enableval = xno; then
86 support_utmp=$enableval
87 fi])
88
89AC_ARG_ENABLE(wtmp,
90 [ --enable-wtmp enable wtmp (wtmpx) support (requires --enable-utmp)],
91 [if test x$enableval = xyes -o x$enableval = xno; then
92 support_wtmp=$enableval
93 fi])
94
95AC_ARG_ENABLE(lastlog,
96 [ --enable-lastlog enable lastlog support (requires --enable-utmp)],
97 [if test x$enableval = xyes -o x$enableval = xno; then
98 support_lastlog=$enableval
99 fi])
100
101if test x$support_utmp = xyes; then
102 AC_DEFINE(UTMP_SUPPORT, 1, Define if you want to have utmp/utmpx support)
103fi
104if test x$support_wtmp = xyes; then
105 AC_DEFINE(WTMP_SUPPORT, 1, Define if you want to have wtmp support when utmp/utmpx is enabled)
106fi
107if test x$support_lastlog = xyes; then
108 AC_DEFINE(LASTLOG_SUPPORT, 1, Define if you want to have lastlog support when utmp/utmpx is enabled)
109fi
110
76AC_CHECK_FUNCS( \ 111AC_CHECK_FUNCS( \
77 ttyslot \ 112 ttyslot \
78 updwtmp \ 113 updwtmp \
79 updwtmpx \ 114 updwtmpx \
80) 115)
397}]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl 432}]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl
398 AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])]) 433 AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])])
399if test x$path_lastlogx != x; then 434if test x$path_lastlogx != x; then
400 AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$path_lastlogx", Define location of lastlogx) 435 AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$path_lastlogx", Define location of lastlogx)
401fi 436fi
437
438if test x$support_utmp != xyes; then
439 echo " utmp support: disabled"
440 echo
441else
442 echo " utmp support: enabled
443 utmp file: $path_utmp
444 utmpx file: $path_utmpx
445 wtmp file: $path_wtmp
446 wtmpx file: $path_wtmpx
447 lastlog file: $path_lastlog
448 lastlogx file: $path_lastlogx"
449fi
402]) 450])
403 451
404AC_DEFUN([SCM_RIGHTS_CHECK], 452AC_DEFUN([SCM_RIGHTS_CHECK],
405[ 453[
406AC_CACHE_CHECK(for unix-compliant filehandle passing ability, can_pass_fds, 454AC_CACHE_CHECK(for unix-compliant filehandle passing ability, can_pass_fds,
407[AC_TRY_LINK([ 455[AC_TRY_LINK([
408#include <cstddef> // broken bsds (is that redundant) need this 456#include <cstddef> // broken bsds (is that redundant?) need this
409#include <sys/types.h> 457#include <sys/types.h>
410#include <sys/socket.h> 458#include <sys/socket.h>
411#include <sys/uio.h> 459#include <sys/uio.h>
412],[ 460],[
413{ 461{
438 AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) 486 AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing)
439else 487else
440 AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) 488 AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability])
441fi 489fi
442]) 490])
491
492AC_DEFUN([TTY_GROUP_CHECK],
493[
494AC_CACHE_CHECK([for tty group], tty_group,
495[AC_TRY_RUN([
496#include <sys/types.h>
497#include <sys/stat.h>
498#include <unistd.h>
499#include <grp.h>
500
501main()
502{
503 struct stat st;
504 struct group *gr;
505 char *tty;
506 gr = getgrnam("tty");
507 tty = ttyname(0);
508 if (gr != 0
509 && tty != 0
510 && (stat(tty, &st)) == 0
511 && st.st_gid == gr->gr_gid)
512 return 0;
513 else
514 return 1;
515}],
516[tty_group=yes],[tty_group=no],[tty_group=no])])
517if test x$tty_group = xyes; then
518 AC_DEFINE(TTY_GID_SUPPORT, 1, "")
519fi])
520

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines