… | |
… | |
7 | pty.h \ |
7 | pty.h \ |
8 | util.h \ |
8 | util.h \ |
9 | libutil.h \ |
9 | libutil.h \ |
10 | sys/ioctl.h \ |
10 | sys/ioctl.h \ |
11 | sys/stropts.h \ |
11 | sys/stropts.h \ |
|
|
12 | stropts.h \ |
12 | ) |
13 | ) |
13 | |
14 | |
14 | AC_CHECK_FUNCS( \ |
15 | AC_CHECK_FUNCS( \ |
15 | revoke \ |
16 | revoke \ |
16 | _getpty \ |
17 | _getpty \ |
… | |
… | |
63 | ;; |
64 | ;; |
64 | esac |
65 | esac |
65 | |
66 | |
66 | if test x$ac_cv_func_getpt = xyes -o x$ac_cv_func_posix_openpt = xyes -o x$have_clone = xyes; then |
67 | if test x$ac_cv_func_getpt = xyes -o x$ac_cv_func_posix_openpt = xyes -o x$have_clone = xyes; then |
67 | AC_MSG_CHECKING(for UNIX98 ptys) |
68 | AC_MSG_CHECKING(for UNIX98 ptys) |
68 | AC_TRY_LINK([#include <stdlib.h>], |
69 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>]], |
69 | [grantpt(0);unlockpt(0);ptsname(0);], |
70 | [[grantpt(0);unlockpt(0);ptsname(0);]])], |
70 | [unix98_pty=yes |
71 | [unix98_pty=yes |
71 | AC_DEFINE(UNIX98_PTY, 1, "") |
72 | AC_DEFINE(UNIX98_PTY, 1, "") |
72 | AC_MSG_RESULT(yes)], |
73 | AC_MSG_RESULT(yes)], |
73 | [AC_MSG_RESULT(no)]) |
74 | [AC_MSG_RESULT(no)]) |
74 | fi |
75 | fi |
… | |
… | |
111 | if test x$support_lastlog = xyes; then |
112 | 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 | AC_DEFINE(LASTLOG_SUPPORT, 1, Define if you want to have lastlog support when utmp/utmpx is enabled) |
113 | fi |
114 | fi |
114 | |
115 | |
115 | AC_CHECK_FUNCS( \ |
116 | AC_CHECK_FUNCS( \ |
116 | ttyslot \ |
|
|
117 | updwtmp \ |
117 | updwtmp \ |
118 | updwtmpx \ |
118 | updwtmpx \ |
119 | updlastlogx \ |
119 | updlastlogx \ |
120 | ) |
120 | ) |
121 | |
121 | |
122 | AC_CHECK_HEADERS( \ |
122 | AC_CHECK_HEADERS(lastlog.h) |
123 | utmp.h \ |
|
|
124 | utmpx.h \ |
|
|
125 | lastlog.h \ |
|
|
126 | ) |
|
|
127 | |
123 | |
128 | dnl# -------------------------------------------------------------------------- |
124 | dnl# -------------------------------------------------------------------------- |
129 | dnl# DO ALL UTMP AND WTMP CHECKING |
125 | dnl# DO ALL UTMP AND WTMP CHECKING |
130 | dnl# -------------------------------------------------------------------------- |
126 | dnl# -------------------------------------------------------------------------- |
131 | dnl# check for host field in utmp structure |
127 | dnl# check for host field in utmp structure |
132 | |
128 | |
133 | dnl# -------------------------------------------- |
129 | dnl# -------------------------------------------- |
134 | AC_CHECK_HEADER(utmp.h, |
130 | AC_CHECK_HEADERS(utmp.h, |
135 | [AC_CACHE_CHECK([for struct utmp], struct_utmp, |
131 | [AC_CACHE_CHECK([for struct utmp], struct_utmp, |
136 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
132 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
137 | #include <utmp.h>]], [[struct utmp ut;]])],[struct_utmp=yes],[struct_utmp=no])]) |
133 | #include <utmp.h>]], [[struct utmp ut;]])],[struct_utmp=yes],[struct_utmp=no])]) |
138 | if test x$struct_utmp = xyes; then |
134 | if test x$struct_utmp = xyes; then |
139 | AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp) |
135 | AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp) |
… | |
… | |
151 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
147 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
152 | #include <utmp.h>]], [[struct utmp ut; ut.ut_pid;]])],[struct_utmp_pid=yes],[struct_utmp_pid=no])]) |
148 | #include <utmp.h>]], [[struct utmp ut; ut.ut_pid;]])],[struct_utmp_pid=yes],[struct_utmp_pid=no])]) |
153 | if test x$struct_utmp_pid = xyes; then |
149 | if test x$struct_utmp_pid = xyes; then |
154 | AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid) |
150 | AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid) |
155 | fi |
151 | fi |
156 | ) dnl# AC_CHECK_HEADER(utmp.h |
152 | ) dnl# AC_CHECK_HEADERS(utmp.h |
157 | |
153 | |
158 | dnl# -------------------------------------------- |
154 | dnl# -------------------------------------------- |
159 | |
155 | |
160 | AC_CHECK_HEADER(utmpx.h, |
156 | AC_CHECK_HEADERS(utmpx.h, |
161 | [AC_CACHE_CHECK([for struct utmpx], struct_utmpx, |
157 | [AC_CACHE_CHECK([for struct utmpx], struct_utmpx, |
162 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
158 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
163 | #include <utmpx.h>]], [[struct utmpx ut;]])],[struct_utmpx=yes],[struct_utmpx=no])]) |
159 | #include <utmpx.h>]], [[struct utmpx ut;]])],[struct_utmpx=yes],[struct_utmpx=no])]) |
164 | if test x$struct_utmpx = xyes; then |
160 | if test x$struct_utmpx = xyes; then |
165 | AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx) |
161 | AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx) |
… | |
… | |
172 | if test x$struct_utmpx_host = xyes; then |
168 | if test x$struct_utmpx_host = xyes; then |
173 | AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host) |
169 | AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host) |
174 | fi |
170 | fi |
175 | |
171 | |
176 | AC_CACHE_CHECK(for session in utmpx struct, struct_utmpx_session, |
172 | AC_CACHE_CHECK(for session in utmpx struct, struct_utmpx_session, |
177 | [AC_TRY_COMPILE([#include <sys/types.h> |
173 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
178 | #include <utmpx.h>], |
174 | #include <utmpx.h>]], [[struct utmpx utx; utx.ut_session;]])],[struct_utmpx_session=yes],[struct_utmpx_session=no])]) |
179 | [struct utmpx utx; utx.ut_session;], |
|
|
180 | struct_utmpx_session=yes, struct_utmpx_session=no)]) |
|
|
181 | if test x$struct_utmpx_session = xyes; then |
175 | if test x$struct_utmpx_session = xyes; then |
182 | AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session) |
176 | AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session) |
183 | fi |
177 | fi |
184 | ) dnl# AC_CHECK_HEADER(utmpx.h |
178 | ) dnl# AC_CHECK_HEADERS(utmpx.h |
185 | |
179 | |
186 | dnl# -------------------------------------------------------------------------- |
180 | dnl# -------------------------------------------------------------------------- |
187 | dnl# check for struct lastlog |
181 | dnl# check for struct lastlog |
188 | AC_CACHE_CHECK(for struct lastlog, struct_lastlog, |
182 | AC_CACHE_CHECK(for struct lastlog, struct_lastlog, |
189 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
183 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
… | |
… | |
404 | exit(0); |
398 | exit(0); |
405 | }]])],[path_lastlog=`cat conftestval`],[path_lastlog=],[dnl |
399 | }]])],[path_lastlog=`cat conftestval`],[path_lastlog=],[dnl |
406 | AC_MSG_WARN(Define LASTLOG_FILE in config.h manually)])]) |
400 | AC_MSG_WARN(Define LASTLOG_FILE in config.h manually)])]) |
407 | if test x$path_lastlog != x; then |
401 | if test x$path_lastlog != x; then |
408 | AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$path_lastlog", Define location of lastlog) |
402 | AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$path_lastlog", Define location of lastlog) |
409 | if test -d "$path_lastlog"; then |
|
|
410 | AC_DEFINE(LASTLOG_IS_DIR, 1, Define if lastlog is provided via a directory) |
|
|
411 | fi |
|
|
412 | fi |
403 | fi |
413 | dnl# -------------------------------------------------------------------------- |
404 | dnl# -------------------------------------------------------------------------- |
414 | |
405 | |
415 | dnl# find lastlogx |
406 | dnl# find lastlogx |
416 | AC_CACHE_CHECK(where lastlogx is located, path_lastlogx, |
407 | AC_CACHE_CHECK(where lastlogx is located, path_lastlogx, |
… | |
… | |
448 | ]) |
439 | ]) |
449 | |
440 | |
450 | AC_DEFUN([SCM_RIGHTS_CHECK], |
441 | AC_DEFUN([SCM_RIGHTS_CHECK], |
451 | [ |
442 | [ |
452 | AC_CACHE_CHECK(for unix-compliant filehandle passing ability, can_pass_fds, |
443 | AC_CACHE_CHECK(for unix-compliant filehandle passing ability, can_pass_fds, |
453 | [AC_TRY_LINK([ |
444 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
454 | #include <cstddef> // broken bsds (is that redundant?) need this |
445 | #include <cstddef> // broken bsds (is that redundant?) need this |
455 | #include <sys/types.h> |
446 | #include <sys/types.h> |
456 | #include <sys/socket.h> |
447 | #include <sys/socket.h> |
457 | #include <sys/uio.h> |
448 | #include <sys/uio.h> |
458 | ],[ |
449 | ]], [[ |
459 | { |
450 | { |
460 | msghdr msg; |
451 | msghdr msg; |
461 | iovec iov; |
452 | iovec iov; |
462 | char buf [100]; |
453 | char buf [100]; |
463 | char data = 0; |
454 | char data = 0; |
… | |
… | |
477 | |
468 | |
478 | *(int *)CMSG_DATA (cmsg) = 5; |
469 | *(int *)CMSG_DATA (cmsg) = 5; |
479 | |
470 | |
480 | return sendmsg (3, &msg, 0); |
471 | return sendmsg (3, &msg, 0); |
481 | } |
472 | } |
482 | ],[can_pass_fds=yes],[can_pass_fds=no])]) |
473 | ]])],[can_pass_fds=yes],[can_pass_fds=no])]) |
483 | if test x$can_pass_fds = xyes; then |
474 | if test x$can_pass_fds = xyes; then |
484 | AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) |
475 | AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) |
485 | else |
476 | else |
486 | AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) |
477 | AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) |
487 | fi |
478 | fi |
488 | ]) |
479 | ]) |
489 | |
480 | |
490 | AC_DEFUN([TTY_GROUP_CHECK], |
481 | AC_DEFUN([TTY_GROUP_CHECK], |
491 | [ |
482 | [ |
492 | AC_CACHE_CHECK([for tty group], tty_group, |
483 | AC_CACHE_CHECK([for tty group], tty_group, |
493 | [AC_TRY_RUN([ |
484 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
494 | #include <sys/types.h> |
485 | #include <sys/types.h> |
495 | #include <sys/stat.h> |
486 | #include <sys/stat.h> |
496 | #include <unistd.h> |
487 | #include <unistd.h> |
497 | #include <grp.h> |
488 | #include <grp.h> |
498 | |
489 | |
… | |
… | |
508 | && (stat(tty, &st)) == 0 |
499 | && (stat(tty, &st)) == 0 |
509 | && st.st_gid == gr->gr_gid) |
500 | && st.st_gid == gr->gr_gid) |
510 | return 0; |
501 | return 0; |
511 | else |
502 | else |
512 | return 1; |
503 | return 1; |
513 | }], |
|
|
514 | [tty_group=yes],[tty_group=no],[tty_group=no])]) |
504 | }]])],[tty_group=yes],[tty_group=no],[tty_group=no])]) |
515 | if test x$tty_group = xyes; then |
505 | if test x$tty_group = xyes; then |
516 | AC_DEFINE(TTY_GID_SUPPORT, 1, "") |
506 | AC_DEFINE(TTY_GID_SUPPORT, 1, "") |
517 | fi]) |
507 | fi]) |
518 | |
508 | |