… | |
… | |
83 | support_utmp=yes |
83 | support_utmp=yes |
84 | support_wtmp=yes |
84 | support_wtmp=yes |
85 | support_lastlog=yes |
85 | support_lastlog=yes |
86 | |
86 | |
87 | AC_ARG_ENABLE(utmp, |
87 | AC_ARG_ENABLE(utmp, |
88 | [ --enable-utmp enable utmp (utmpx) support], |
88 | [AS_HELP_STRING([--enable-utmp],[enable utmp (utmpx) support])], |
89 | [if test x$enableval = xyes -o x$enableval = xno; then |
89 | [if test x$enableval = xyes -o x$enableval = xno; then |
90 | support_utmp=$enableval |
90 | support_utmp=$enableval |
91 | fi]) |
91 | fi]) |
92 | |
92 | |
93 | AC_ARG_ENABLE(wtmp, |
93 | AC_ARG_ENABLE(wtmp, |
94 | [ --enable-wtmp enable wtmp (wtmpx) support (requires --enable-utmp)], |
94 | [AS_HELP_STRING([--enable-wtmp],[enable wtmp (wtmpx) support (requires --enable-utmp)])], |
95 | [if test x$enableval = xyes -o x$enableval = xno; then |
95 | [if test x$enableval = xyes -o x$enableval = xno; then |
96 | support_wtmp=$enableval |
96 | support_wtmp=$enableval |
97 | fi]) |
97 | fi]) |
98 | |
98 | |
99 | AC_ARG_ENABLE(lastlog, |
99 | AC_ARG_ENABLE(lastlog, |
100 | [ --enable-lastlog enable lastlog support (requires --enable-utmp)], |
100 | [AS_HELP_STRING([--enable-lastlog],[enable lastlog support (requires --enable-utmp)])], |
101 | [if test x$enableval = xyes -o x$enableval = xno; then |
101 | [if test x$enableval = xyes -o x$enableval = xno; then |
102 | support_lastlog=$enableval |
102 | support_lastlog=$enableval |
103 | fi]) |
103 | fi]) |
104 | |
104 | |
105 | if test x$support_utmp = xyes; then |
105 | if test x$support_utmp = xyes; then |
… | |
… | |
114 | |
114 | |
115 | AC_CHECK_FUNCS( \ |
115 | AC_CHECK_FUNCS( \ |
116 | ttyslot \ |
116 | ttyslot \ |
117 | updwtmp \ |
117 | updwtmp \ |
118 | updwtmpx \ |
118 | updwtmpx \ |
|
|
119 | updlastlogx \ |
119 | ) |
120 | ) |
120 | |
121 | |
121 | AC_CHECK_HEADERS( \ |
122 | AC_CHECK_HEADERS( \ |
122 | utmp.h \ |
123 | utmp.h \ |
123 | utmpx.h \ |
124 | utmpx.h \ |
… | |
… | |
212 | dnl# -------------------------------------------------------------------------- |
213 | dnl# -------------------------------------------------------------------------- |
213 | |
214 | |
214 | dnl# find utmp |
215 | dnl# find utmp |
215 | AC_CACHE_CHECK(where utmp is located, path_utmp, |
216 | AC_CACHE_CHECK(where utmp is located, path_utmp, |
216 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
217 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
218 | #include <stdlib.h> |
217 | #include <sys/types.h> |
219 | #include <sys/types.h> |
218 | #include <utmp.h> |
220 | #include <utmp.h> |
219 | #include <errno.h> |
221 | #include <errno.h> |
220 | main() |
222 | main() |
221 | { |
223 | { |
… | |
… | |
248 | |
250 | |
249 | dnl# find utmpx - if a utmp file exists at the same location and is more than |
251 | dnl# find utmpx - if a utmp file exists at the same location and is more than |
250 | dnl# a day newer, then dump the utmpx. People leave lots of junk around. |
252 | dnl# a day newer, then dump the utmpx. People leave lots of junk around. |
251 | AC_CACHE_CHECK(where utmpx is located, path_utmpx, |
253 | AC_CACHE_CHECK(where utmpx is located, path_utmpx, |
252 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
254 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
255 | #include <stdlib.h> |
253 | #include <sys/types.h> |
256 | #include <sys/types.h> |
254 | #include <utmpx.h> |
257 | #include <utmpx.h> |
255 | #include <errno.h> |
258 | #include <errno.h> |
256 | #include <sys/stat.h> |
259 | #include <sys/stat.h> |
257 | #ifdef HAVE_STRING_H |
260 | #ifdef HAVE_STRING_H |
… | |
… | |
293 | dnl# -------------------------------------------------------------------------- |
296 | dnl# -------------------------------------------------------------------------- |
294 | |
297 | |
295 | dnl# find wtmp |
298 | dnl# find wtmp |
296 | AC_CACHE_CHECK(where wtmp is located, path_wtmp, |
299 | AC_CACHE_CHECK(where wtmp is located, path_wtmp, |
297 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
300 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
301 | #include <stdlib.h> |
298 | #include <sys/types.h> |
302 | #include <sys/types.h> |
299 | #ifdef HAVE_UTMP_H |
303 | #ifdef HAVE_UTMP_H |
300 | #include <utmp.h> |
304 | #include <utmp.h> |
301 | #endif |
305 | #endif |
302 | #include <errno.h> |
306 | #include <errno.h> |
303 | main() |
307 | main() |
304 | { |
308 | { |
305 | char **w, *wtmplist[] = { |
309 | char **w, *wtmplist[] = { |
306 | "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL }; |
310 | "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL }; |
307 | FILE *a, *f=fopen("conftestval", "w"); |
311 | FILE *a, *f=fopen("conftestval", "w"); |
308 | if (!f) exit(1); |
312 | if (!f) exit(1); |
309 | #ifdef WTMP_FILE |
313 | #ifdef WTMP_FILE |
310 | fprintf(f, "%s\n", WTMP_FILE); |
314 | fprintf(f, "%s\n", WTMP_FILE); |
311 | exit(0); |
315 | exit(0); |
… | |
… | |
329 | dnl# -------------------------------------------------------------------------- |
333 | dnl# -------------------------------------------------------------------------- |
330 | |
334 | |
331 | dnl# find wtmpx |
335 | dnl# find wtmpx |
332 | AC_CACHE_CHECK(where wtmpx is located, path_wtmpx, |
336 | AC_CACHE_CHECK(where wtmpx is located, path_wtmpx, |
333 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
337 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
338 | #include <stdlib.h> |
334 | #ifdef HAVE_UTMPX_H |
339 | #ifdef HAVE_UTMPX_H |
335 | #include <utmpx.h> |
340 | #include <utmpx.h> |
336 | #endif |
341 | #endif |
337 | #include <errno.h> |
342 | #include <errno.h> |
338 | main() |
343 | main() |
339 | { |
344 | { |
340 | char **w, *wtmplist[] = { |
345 | char **w, *wtmplist[] = { |
341 | "/var/log/wtmpx", "/var/adm/wtmpx", NULL }; |
346 | "/var/log/wtmpx", "/var/adm/wtmpx", NULL }; |
342 | FILE *a, *f=fopen("conftestval", "w"); |
347 | FILE *a, *f=fopen("conftestval", "w"); |
343 | if (!f) exit(1); |
348 | if (!f) exit(1); |
344 | #ifdef WTMPX_FILE |
349 | #ifdef WTMPX_FILE |
345 | fprintf(f, "%s\n", WTMPX_FILE); |
350 | fprintf(f, "%s\n", WTMPX_FILE); |
346 | exit(0); |
351 | exit(0); |
… | |
… | |
364 | dnl# -------------------------------------------------------------------------- |
369 | dnl# -------------------------------------------------------------------------- |
365 | |
370 | |
366 | dnl# find lastlog |
371 | dnl# find lastlog |
367 | AC_CACHE_CHECK(where lastlog is located, path_lastlog, |
372 | AC_CACHE_CHECK(where lastlog is located, path_lastlog, |
368 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
373 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
374 | #include <stdlib.h> |
369 | #include <sys/types.h> |
375 | #include <sys/types.h> |
370 | #ifdef HAVE_UTMPX_H |
376 | #ifdef HAVE_UTMPX_H |
371 | #include <utmpx.h> |
377 | #include <utmpx.h> |
372 | #elif defined(HAVE_UTMP_H) |
378 | #elif defined(HAVE_UTMP_H) |
373 | #include <utmp.h> |
379 | #include <utmp.h> |
… | |
… | |
407 | dnl# -------------------------------------------------------------------------- |
413 | dnl# -------------------------------------------------------------------------- |
408 | |
414 | |
409 | dnl# find lastlogx |
415 | dnl# find lastlogx |
410 | AC_CACHE_CHECK(where lastlogx is located, path_lastlogx, |
416 | AC_CACHE_CHECK(where lastlogx is located, path_lastlogx, |
411 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
417 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
418 | #include <stdlib.h> |
412 | #ifdef HAVE_UTMPX_H |
419 | #ifdef HAVE_UTMPX_H |
413 | #include <utmpx.h> |
420 | #include <utmpx.h> |
414 | #endif |
421 | #endif |
415 | #include <errno.h> |
422 | #include <errno.h> |
416 | main() |
423 | main() |