|
|
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 \ |
… | |
… | |
438 | AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) |
441 | AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) |
439 | else |
442 | else |
440 | AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) |
443 | AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) |
441 | fi |
444 | fi |
442 | ]) |
445 | ]) |
|
|
446 | |
|
|
447 | AC_DEFUN([TTY_GROUP_CHECK], |
|
|
448 | [ |
|
|
449 | AC_CACHE_CHECK([for tty group], tty_group, |
|
|
450 | [AC_TRY_RUN([ |
|
|
451 | #include <sys/types.h> |
|
|
452 | #include <sys/stat.h> |
|
|
453 | #include <unistd.h> |
|
|
454 | #include <grp.h> |
|
|
455 | |
|
|
456 | main() |
|
|
457 | { |
|
|
458 | struct stat st; |
|
|
459 | struct group *gr; |
|
|
460 | char *tty; |
|
|
461 | gr = getgrnam("tty"); |
|
|
462 | tty = ttyname(0); |
|
|
463 | if (gr != 0 |
|
|
464 | && tty != 0 |
|
|
465 | && (stat(tty, &st)) == 0 |
|
|
466 | && st.st_gid == gr->gr_gid) |
|
|
467 | return 0; |
|
|
468 | else |
|
|
469 | return 1; |
|
|
470 | }], |
|
|
471 | [tty_group=yes],[tty_group=no],[tty_group=no])]) |
|
|
472 | if test x$tty_group = xyes; then |
|
|
473 | AC_DEFINE(TTY_GID_SUPPORT, 1, "") |
|
|
474 | fi]) |
|
|
475 | |