… | |
… | |
74 | fi |
74 | fi |
75 | ]) |
75 | ]) |
76 | |
76 | |
77 | AC_DEFUN([UTMP_CHECK], |
77 | AC_DEFUN([UTMP_CHECK], |
78 | [ |
78 | [ |
|
|
79 | AC_ARG_ENABLE(utmp, |
|
|
80 | [ --enable-utmp enable utmp (utmpx) support], |
|
|
81 | [if test x$enableval = xyes -o x$enableval = xno; then |
|
|
82 | support_utmp=$enableval |
|
|
83 | fi]) |
|
|
84 | |
|
|
85 | AC_ARG_ENABLE(wtmp, |
|
|
86 | [ --enable-wtmp enable wtmp (wtmpx) support (requires --enable-utmp)], |
|
|
87 | [if test x$enableval = xyes -o x$enableval = xno; then |
|
|
88 | support_wtmp=$enableval |
|
|
89 | fi]) |
|
|
90 | |
|
|
91 | AC_ARG_ENABLE(lastlog, |
|
|
92 | [ --enable-lastlog enable lastlog support (requires --enable-utmp)], |
|
|
93 | [if test x$enableval = xyes -o x$enableval = xno; then |
|
|
94 | support_lastlog=$enableval |
|
|
95 | fi]) |
|
|
96 | |
|
|
97 | if test x$support_utmp = xyes; then |
|
|
98 | AC_DEFINE(UTMP_SUPPORT, 1, Define if you want to have utmp/utmpx support) |
|
|
99 | fi |
|
|
100 | if test x$support_wtmp = xyes; then |
|
|
101 | AC_DEFINE(WTMP_SUPPORT, 1, Define if you want to have wtmp support when utmp/utmpx is enabled) |
|
|
102 | fi |
|
|
103 | if test x$support_lastlog = xyes; then |
|
|
104 | AC_DEFINE(LASTLOG_SUPPORT, 1, Define if you want to have lastlog support when utmp/utmpx is enabled) |
|
|
105 | fi |
|
|
106 | |
79 | AC_CHECK_FUNCS( \ |
107 | AC_CHECK_FUNCS( \ |
80 | ttyslot \ |
108 | ttyslot \ |
81 | updwtmp \ |
109 | updwtmp \ |
82 | updwtmpx \ |
110 | updwtmpx \ |
83 | ) |
111 | ) |
… | |
… | |
400 | }]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl |
428 | }]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl |
401 | AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])]) |
429 | AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])]) |
402 | if test x$path_lastlogx != x; then |
430 | if test x$path_lastlogx != x; then |
403 | AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$path_lastlogx", Define location of lastlogx) |
431 | AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$path_lastlogx", Define location of lastlogx) |
404 | fi |
432 | fi |
|
|
433 | |
|
|
434 | if test x$support_utmp != xyes; then |
|
|
435 | echo " utmp support: disabled" |
|
|
436 | echo |
|
|
437 | else |
|
|
438 | echo " utmp support: enabled |
|
|
439 | utmp file: $path_utmp |
|
|
440 | utmpx file: $path_utmpx |
|
|
441 | wtmp file: $path_wtmp |
|
|
442 | wtmpx file: $path_wtmpx |
|
|
443 | lastlog file: $path_lastlog |
|
|
444 | lastlogx file: $path_lastlogx" |
|
|
445 | fi |
405 | ]) |
446 | ]) |
406 | |
447 | |
407 | AC_DEFUN([SCM_RIGHTS_CHECK], |
448 | AC_DEFUN([SCM_RIGHTS_CHECK], |
408 | [ |
449 | [ |
409 | AC_CACHE_CHECK(for unix-compliant filehandle passing ability, can_pass_fds, |
450 | AC_CACHE_CHECK(for unix-compliant filehandle passing ability, can_pass_fds, |
… | |
… | |
441 | AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) |
482 | AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) |
442 | else |
483 | else |
443 | AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) |
484 | AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) |
444 | fi |
485 | fi |
445 | ]) |
486 | ]) |
|
|
487 | |
|
|
488 | AC_DEFUN([TTY_GROUP_CHECK], |
|
|
489 | [ |
|
|
490 | AC_CACHE_CHECK([for tty group], tty_group, |
|
|
491 | [AC_TRY_RUN([ |
|
|
492 | #include <sys/types.h> |
|
|
493 | #include <sys/stat.h> |
|
|
494 | #include <unistd.h> |
|
|
495 | #include <grp.h> |
|
|
496 | |
|
|
497 | main() |
|
|
498 | { |
|
|
499 | struct stat st; |
|
|
500 | struct group *gr; |
|
|
501 | char *tty; |
|
|
502 | gr = getgrnam("tty"); |
|
|
503 | tty = ttyname(0); |
|
|
504 | if (gr != 0 |
|
|
505 | && tty != 0 |
|
|
506 | && (stat(tty, &st)) == 0 |
|
|
507 | && st.st_gid == gr->gr_gid) |
|
|
508 | return 0; |
|
|
509 | else |
|
|
510 | return 1; |
|
|
511 | }], |
|
|
512 | [tty_group=yes],[tty_group=no],[tty_group=no])]) |
|
|
513 | if test x$tty_group = xyes; then |
|
|
514 | AC_DEFINE(TTY_GID_SUPPORT, 1, "") |
|
|
515 | fi]) |
|
|
516 | |