|
|
1 | dnl this file is part of libptytty, do not make local modifications |
|
|
2 | dnl http://software.schmorp.de/pkg/libptytty |
|
|
3 | |
1 | AC_DEFUN([PTY_CHECK], |
4 | AC_DEFUN([PTY_CHECK], |
2 | [ |
5 | [ |
3 | AC_CHECK_HEADERS( \ |
6 | AC_CHECK_HEADERS( \ |
4 | pty.h \ |
7 | pty.h \ |
5 | util.h \ |
8 | util.h \ |
… | |
… | |
71 | fi |
74 | fi |
72 | ]) |
75 | ]) |
73 | |
76 | |
74 | AC_DEFUN([UTMP_CHECK], |
77 | AC_DEFUN([UTMP_CHECK], |
75 | [ |
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 | |
76 | AC_CHECK_FUNCS( \ |
107 | AC_CHECK_FUNCS( \ |
77 | ttyslot \ |
108 | ttyslot \ |
78 | updwtmp \ |
109 | updwtmp \ |
79 | updwtmpx \ |
110 | updwtmpx \ |
80 | ) |
111 | ) |
… | |
… | |
397 | }]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl |
428 | }]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl |
398 | AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])]) |
429 | AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])]) |
399 | if test x$path_lastlogx != x; then |
430 | if test x$path_lastlogx != x; then |
400 | AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$path_lastlogx", Define location of lastlogx) |
431 | AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$path_lastlogx", Define location of lastlogx) |
401 | 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 |
402 | ]) |
446 | ]) |
403 | |
447 | |
404 | AC_DEFUN([SCM_RIGHTS_CHECK], |
448 | AC_DEFUN([SCM_RIGHTS_CHECK], |
405 | [ |
449 | [ |
406 | 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, |
… | |
… | |
438 | 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) |
439 | else |
483 | else |
440 | AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) |
484 | AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) |
441 | fi |
485 | fi |
442 | ]) |
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 | |