… | |
… | |
24 | setresuid \ |
24 | setresuid \ |
25 | ) |
25 | ) |
26 | |
26 | |
27 | have_clone=no |
27 | have_clone=no |
28 | |
28 | |
29 | AC_MSG_CHECKING(for /dev/ptym/clone) |
|
|
30 | if test -e /dev/ptym/clone; then |
|
|
31 | AC_MSG_RESULT(yes) |
|
|
32 | AC_DEFINE(HAVE_DEV_CLONE, 1, [Define to 1 if you have /dev/ptym/clone]) |
|
|
33 | AC_DEFINE(CLONE_DEVICE, "/dev/ptym/clone", [clone device filename]) |
|
|
34 | have_clone=yes |
|
|
35 | else |
|
|
36 | AC_MSG_RESULT(no) |
|
|
37 | fi |
|
|
38 | |
|
|
39 | AC_MSG_CHECKING(for /dev/ptc) |
29 | AC_MSG_CHECKING(for /dev/ptc) |
40 | if test -e /dev/ptc; then |
30 | if test -e /dev/ptc; then |
41 | AC_MSG_RESULT(yes) |
31 | AC_MSG_RESULT(yes) |
42 | AC_DEFINE(HAVE_DEV_PTC, 1, [Define to 1 if you have /dev/ptc]) |
|
|
43 | AC_DEFINE(CLONE_DEVICE, "/dev/ptc", [clone device filename]) |
32 | AC_DEFINE(CLONE_DEVICE, "/dev/ptc", [clone device filename]) |
44 | have_clone=yes |
33 | have_clone=yes |
45 | else |
34 | else |
46 | AC_MSG_RESULT(no) |
35 | AC_MSG_RESULT(no) |
47 | fi |
36 | fi |
… | |
… | |
73 | AC_MSG_RESULT(yes)], |
62 | AC_MSG_RESULT(yes)], |
74 | [AC_MSG_RESULT(no)]) |
63 | [AC_MSG_RESULT(no)]) |
75 | fi |
64 | fi |
76 | |
65 | |
77 | if test -z "$unix98_pty"; then |
66 | if test -z "$unix98_pty"; then |
78 | AC_CHECK_FUNCS(openpty, [], [AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"])]) |
67 | AC_SEARCH_LIBS(openpty, util, AC_DEFINE(HAVE_OPENPTY, 1, "")) |
79 | fi |
68 | fi |
80 | ]) |
69 | ]) |
81 | |
70 | |
82 | AC_DEFUN([UTMP_CHECK], |
71 | AC_DEFUN([UTMP_CHECK], |
83 | [ |
72 | [ |
… | |
… | |
236 | exit(0); |
225 | exit(0); |
237 | }]])],[pt_cv_path_utmp=`cat conftestval`],[pt_cv_path_utmp=],[dnl |
226 | }]])],[pt_cv_path_utmp=`cat conftestval`],[pt_cv_path_utmp=],[dnl |
238 | AC_MSG_WARN(Define UTMP_FILE in config.h manually)])]) |
227 | AC_MSG_WARN(Define UTMP_FILE in config.h manually)])]) |
239 | if test x$pt_cv_path_utmp != x; then |
228 | if test x$pt_cv_path_utmp != x; then |
240 | AC_DEFINE_UNQUOTED(UTMP_FILE, "$pt_cv_path_utmp", Define location of utmp) |
229 | AC_DEFINE_UNQUOTED(UTMP_FILE, "$pt_cv_path_utmp", Define location of utmp) |
241 | fi |
|
|
242 | |
|
|
243 | dnl# -------------------------------------------------------------------------- |
|
|
244 | |
|
|
245 | dnl# find utmpx - if a utmp file exists at the same location and is more than |
|
|
246 | dnl# a day newer, then dump the utmpx. People leave lots of junk around. |
|
|
247 | AC_CACHE_CHECK(where utmpx is located, pt_cv_path_utmpx, |
|
|
248 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
249 | #include <stdlib.h> |
|
|
250 | #include <sys/types.h> |
|
|
251 | #include <utmpx.h> |
|
|
252 | #include <errno.h> |
|
|
253 | #include <sys/stat.h> |
|
|
254 | #ifdef HAVE_STRING_H |
|
|
255 | #include <string.h> |
|
|
256 | #endif |
|
|
257 | main() |
|
|
258 | { |
|
|
259 | char **u, *p, *utmplist[] = { |
|
|
260 | #ifdef UTMPX_FILE |
|
|
261 | UTMPX_FILE, |
|
|
262 | #endif |
|
|
263 | #ifdef _PATH_UTMPX |
|
|
264 | _PATH_UTMPX, |
|
|
265 | #endif |
|
|
266 | "/var/adm/utmpx", "/etc/utmpx", NULL }; |
|
|
267 | FILE *a, *f=fopen("conftestval", "w"); |
|
|
268 | struct stat statu, statux; |
|
|
269 | if (!f) exit(1); |
|
|
270 | for (u = utmplist; *u; u++) { |
|
|
271 | if ((a = fopen(*u, "r")) != NULL || errno == EACCES) { |
|
|
272 | if (stat(*u, &statux) < 0) |
|
|
273 | continue; |
|
|
274 | p = strdup(*u); |
|
|
275 | p[strlen(p) - 1] = '\0'; |
|
|
276 | if (stat(p, &statu) >= 0 |
|
|
277 | && (statu.st_mtime - statux.st_mtime > 86400)) |
|
|
278 | continue; |
|
|
279 | fprintf(f, "%s\n", *u); |
|
|
280 | exit(0); |
|
|
281 | } |
|
|
282 | } |
|
|
283 | exit(0); |
|
|
284 | }]])],[pt_cv_path_utmpx=`cat conftestval`],[pt_cv_path_utmpx=],[dnl |
|
|
285 | AC_MSG_WARN(Define UTMPX_FILE in config.h manually)])]) |
|
|
286 | if test x$pt_cv_path_utmpx != x; then |
|
|
287 | AC_DEFINE_UNQUOTED(UTMPX_FILE, "$pt_cv_path_utmpx", Define location of utmpx) |
|
|
288 | fi |
230 | fi |
289 | |
231 | |
290 | dnl# -------------------------------------------------------------------------- |
232 | dnl# -------------------------------------------------------------------------- |
291 | |
233 | |
292 | dnl# find wtmp |
234 | dnl# find wtmp |