|
|
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 \ |
… | |
… | |
12 | revoke \ |
15 | revoke \ |
13 | _getpty \ |
16 | _getpty \ |
14 | getpt \ |
17 | getpt \ |
15 | posix_openpt \ |
18 | posix_openpt \ |
16 | isastream \ |
19 | isastream \ |
|
|
20 | setuid \ |
|
|
21 | seteuid \ |
|
|
22 | setreuid \ |
|
|
23 | setresuid \ |
17 | ) |
24 | ) |
18 | |
25 | |
19 | have_clone=no |
26 | have_clone=no |
20 | |
27 | |
21 | AC_MSG_CHECKING(for /dev/ptym/clone) |
28 | AC_MSG_CHECKING(for /dev/ptym/clone) |
… | |
… | |
71 | fi |
78 | fi |
72 | ]) |
79 | ]) |
73 | |
80 | |
74 | AC_DEFUN([UTMP_CHECK], |
81 | AC_DEFUN([UTMP_CHECK], |
75 | [ |
82 | [ |
|
|
83 | support_utmp=yes |
|
|
84 | support_wtmp=yes |
|
|
85 | support_lastlog=yes |
|
|
86 | |
|
|
87 | AC_ARG_ENABLE(utmp, |
|
|
88 | [ --enable-utmp enable utmp (utmpx) support], |
|
|
89 | [if test x$enableval = xyes -o x$enableval = xno; then |
|
|
90 | support_utmp=$enableval |
|
|
91 | fi]) |
|
|
92 | |
|
|
93 | AC_ARG_ENABLE(wtmp, |
|
|
94 | [ --enable-wtmp enable wtmp (wtmpx) support (requires --enable-utmp)], |
|
|
95 | [if test x$enableval = xyes -o x$enableval = xno; then |
|
|
96 | support_wtmp=$enableval |
|
|
97 | fi]) |
|
|
98 | |
|
|
99 | AC_ARG_ENABLE(lastlog, |
|
|
100 | [ --enable-lastlog enable lastlog support (requires --enable-utmp)], |
|
|
101 | [if test x$enableval = xyes -o x$enableval = xno; then |
|
|
102 | support_lastlog=$enableval |
|
|
103 | fi]) |
|
|
104 | |
|
|
105 | if test x$support_utmp = xyes; then |
|
|
106 | AC_DEFINE(UTMP_SUPPORT, 1, Define if you want to have utmp/utmpx support) |
|
|
107 | fi |
|
|
108 | if test x$support_wtmp = xyes; then |
|
|
109 | AC_DEFINE(WTMP_SUPPORT, 1, Define if you want to have wtmp support when utmp/utmpx is enabled) |
|
|
110 | fi |
|
|
111 | if test x$support_lastlog = xyes; then |
|
|
112 | AC_DEFINE(LASTLOG_SUPPORT, 1, Define if you want to have lastlog support when utmp/utmpx is enabled) |
|
|
113 | fi |
|
|
114 | |
76 | AC_CHECK_FUNCS( \ |
115 | AC_CHECK_FUNCS( \ |
77 | ttyslot \ |
116 | ttyslot \ |
78 | updwtmp \ |
117 | updwtmp \ |
79 | updwtmpx \ |
118 | updwtmpx \ |
80 | ) |
119 | ) |
… | |
… | |
397 | }]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl |
436 | }]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl |
398 | AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])]) |
437 | AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])]) |
399 | if test x$path_lastlogx != x; then |
438 | if test x$path_lastlogx != x; then |
400 | AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$path_lastlogx", Define location of lastlogx) |
439 | AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$path_lastlogx", Define location of lastlogx) |
401 | fi |
440 | fi |
|
|
441 | |
|
|
442 | if test x$support_utmp != xyes; then |
|
|
443 | echo " utmp support: disabled" |
|
|
444 | echo |
|
|
445 | else |
|
|
446 | echo " utmp support: enabled |
|
|
447 | utmp file: $path_utmp |
|
|
448 | utmpx file: $path_utmpx |
|
|
449 | wtmp file: $path_wtmp |
|
|
450 | wtmpx file: $path_wtmpx |
|
|
451 | lastlog file: $path_lastlog |
|
|
452 | lastlogx file: $path_lastlogx" |
|
|
453 | fi |
402 | ]) |
454 | ]) |
403 | |
455 | |
404 | AC_DEFUN([SCM_RIGHTS_CHECK], |
456 | AC_DEFUN([SCM_RIGHTS_CHECK], |
405 | [ |
457 | [ |
406 | AC_CACHE_CHECK(for unix-compliant filehandle passing ability, can_pass_fds, |
458 | AC_CACHE_CHECK(for unix-compliant filehandle passing ability, can_pass_fds, |
407 | [AC_TRY_LINK([ |
459 | [AC_TRY_LINK([ |
408 | #include <cstddef> // broken bsds (is that redundant) need this |
460 | #include <cstddef> // broken bsds (is that redundant?) need this |
409 | #include <sys/types.h> |
461 | #include <sys/types.h> |
410 | #include <sys/socket.h> |
462 | #include <sys/socket.h> |
411 | #include <sys/uio.h> |
463 | #include <sys/uio.h> |
412 | ],[ |
464 | ],[ |
413 | { |
465 | { |
… | |
… | |
438 | AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) |
490 | AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) |
439 | else |
491 | else |
440 | AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) |
492 | AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) |
441 | fi |
493 | fi |
442 | ]) |
494 | ]) |
|
|
495 | |
|
|
496 | AC_DEFUN([TTY_GROUP_CHECK], |
|
|
497 | [ |
|
|
498 | AC_CACHE_CHECK([for tty group], tty_group, |
|
|
499 | [AC_TRY_RUN([ |
|
|
500 | #include <sys/types.h> |
|
|
501 | #include <sys/stat.h> |
|
|
502 | #include <unistd.h> |
|
|
503 | #include <grp.h> |
|
|
504 | |
|
|
505 | main() |
|
|
506 | { |
|
|
507 | struct stat st; |
|
|
508 | struct group *gr; |
|
|
509 | char *tty; |
|
|
510 | gr = getgrnam("tty"); |
|
|
511 | tty = ttyname(0); |
|
|
512 | if (gr != 0 |
|
|
513 | && tty != 0 |
|
|
514 | && (stat(tty, &st)) == 0 |
|
|
515 | && st.st_gid == gr->gr_gid) |
|
|
516 | return 0; |
|
|
517 | else |
|
|
518 | return 1; |
|
|
519 | }], |
|
|
520 | [tty_group=yes],[tty_group=no],[tty_group=no])]) |
|
|
521 | if test x$tty_group = xyes; then |
|
|
522 | AC_DEFINE(TTY_GID_SUPPORT, 1, "") |
|
|
523 | fi]) |
|
|
524 | |