|
|
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 | support_utmp=yes |
|
|
80 | support_wtmp=yes |
|
|
81 | support_lastlog=yes |
|
|
82 | |
|
|
83 | AC_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 | |
|
|
89 | AC_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 | |
|
|
95 | AC_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 | |
|
|
101 | if test x$support_utmp = xyes; then |
|
|
102 | AC_DEFINE(UTMP_SUPPORT, 1, Define if you want to have utmp/utmpx support) |
|
|
103 | fi |
|
|
104 | if 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) |
|
|
106 | fi |
|
|
107 | if 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) |
|
|
109 | fi |
|
|
110 | |
76 | AC_CHECK_FUNCS( \ |
111 | AC_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)])]) |
399 | if test x$path_lastlogx != x; then |
434 | if 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) |
401 | fi |
436 | fi |
|
|
437 | |
|
|
438 | if test x$support_utmp != xyes; then |
|
|
439 | echo " utmp support: disabled" |
|
|
440 | echo |
|
|
441 | else |
|
|
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" |
|
|
449 | fi |
402 | ]) |
450 | ]) |
403 | |
451 | |
404 | AC_DEFUN([SCM_RIGHTS_CHECK], |
452 | AC_DEFUN([SCM_RIGHTS_CHECK], |
405 | [ |
453 | [ |
406 | AC_CACHE_CHECK(for unix-compliant filehandle passing ability, can_pass_fds, |
454 | 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) |
486 | AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) |
439 | else |
487 | else |
440 | AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) |
488 | AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) |
441 | fi |
489 | fi |
442 | ]) |
490 | ]) |
|
|
491 | |
|
|
492 | AC_DEFUN([TTY_GROUP_CHECK], |
|
|
493 | [ |
|
|
494 | AC_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 | |
|
|
501 | main() |
|
|
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])]) |
|
|
517 | if test x$tty_group = xyes; then |
|
|
518 | AC_DEFINE(TTY_GID_SUPPORT, 1, "") |
|
|
519 | fi]) |
|
|
520 | |