… | |
… | |
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 |
… | |
… | |
111 | if test x$support_lastlog = xyes; then |
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) |
112 | AC_DEFINE(LASTLOG_SUPPORT, 1, Define if you want to have lastlog support when utmp/utmpx is enabled) |
113 | fi |
113 | fi |
114 | |
114 | |
115 | AC_CHECK_FUNCS( \ |
115 | AC_CHECK_FUNCS( \ |
116 | ttyslot \ |
|
|
117 | updwtmp \ |
116 | updwtmp \ |
118 | updwtmpx \ |
117 | updwtmpx \ |
|
|
118 | updlastlogx \ |
119 | ) |
119 | ) |
120 | |
120 | |
121 | AC_CHECK_HEADERS( \ |
121 | AC_CHECK_HEADERS( \ |
122 | utmp.h \ |
122 | utmp.h \ |
123 | utmpx.h \ |
123 | utmpx.h \ |
… | |
… | |
212 | dnl# -------------------------------------------------------------------------- |
212 | dnl# -------------------------------------------------------------------------- |
213 | |
213 | |
214 | dnl# find utmp |
214 | dnl# find utmp |
215 | AC_CACHE_CHECK(where utmp is located, path_utmp, |
215 | AC_CACHE_CHECK(where utmp is located, path_utmp, |
216 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
216 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
217 | #include <stdlib.h> |
217 | #include <sys/types.h> |
218 | #include <sys/types.h> |
218 | #include <utmp.h> |
219 | #include <utmp.h> |
219 | #include <errno.h> |
220 | #include <errno.h> |
220 | main() |
221 | main() |
221 | { |
222 | { |
… | |
… | |
248 | |
249 | |
249 | dnl# find utmpx - if a utmp file exists at the same location and is more than |
250 | 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. |
251 | dnl# a day newer, then dump the utmpx. People leave lots of junk around. |
251 | AC_CACHE_CHECK(where utmpx is located, path_utmpx, |
252 | AC_CACHE_CHECK(where utmpx is located, path_utmpx, |
252 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
253 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
254 | #include <stdlib.h> |
253 | #include <sys/types.h> |
255 | #include <sys/types.h> |
254 | #include <utmpx.h> |
256 | #include <utmpx.h> |
255 | #include <errno.h> |
257 | #include <errno.h> |
256 | #include <sys/stat.h> |
258 | #include <sys/stat.h> |
257 | #ifdef HAVE_STRING_H |
259 | #ifdef HAVE_STRING_H |
… | |
… | |
293 | dnl# -------------------------------------------------------------------------- |
295 | dnl# -------------------------------------------------------------------------- |
294 | |
296 | |
295 | dnl# find wtmp |
297 | dnl# find wtmp |
296 | AC_CACHE_CHECK(where wtmp is located, path_wtmp, |
298 | AC_CACHE_CHECK(where wtmp is located, path_wtmp, |
297 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
299 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
300 | #include <stdlib.h> |
298 | #include <sys/types.h> |
301 | #include <sys/types.h> |
299 | #ifdef HAVE_UTMP_H |
302 | #ifdef HAVE_UTMP_H |
300 | #include <utmp.h> |
303 | #include <utmp.h> |
301 | #endif |
304 | #endif |
302 | #include <errno.h> |
305 | #include <errno.h> |
303 | main() |
306 | main() |
304 | { |
307 | { |
305 | char **w, *wtmplist[] = { |
308 | char **w, *wtmplist[] = { |
306 | "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL }; |
309 | "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL }; |
307 | FILE *a, *f=fopen("conftestval", "w"); |
310 | FILE *a, *f=fopen("conftestval", "w"); |
308 | if (!f) exit(1); |
311 | if (!f) exit(1); |
309 | #ifdef WTMP_FILE |
312 | #ifdef WTMP_FILE |
310 | fprintf(f, "%s\n", WTMP_FILE); |
313 | fprintf(f, "%s\n", WTMP_FILE); |
311 | exit(0); |
314 | exit(0); |
… | |
… | |
329 | dnl# -------------------------------------------------------------------------- |
332 | dnl# -------------------------------------------------------------------------- |
330 | |
333 | |
331 | dnl# find wtmpx |
334 | dnl# find wtmpx |
332 | AC_CACHE_CHECK(where wtmpx is located, path_wtmpx, |
335 | AC_CACHE_CHECK(where wtmpx is located, path_wtmpx, |
333 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
336 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
337 | #include <stdlib.h> |
334 | #ifdef HAVE_UTMPX_H |
338 | #ifdef HAVE_UTMPX_H |
335 | #include <utmpx.h> |
339 | #include <utmpx.h> |
336 | #endif |
340 | #endif |
337 | #include <errno.h> |
341 | #include <errno.h> |
338 | main() |
342 | main() |
339 | { |
343 | { |
340 | char **w, *wtmplist[] = { |
344 | char **w, *wtmplist[] = { |
341 | "/var/log/wtmpx", "/var/adm/wtmpx", NULL }; |
345 | "/var/log/wtmpx", "/var/adm/wtmpx", NULL }; |
342 | FILE *a, *f=fopen("conftestval", "w"); |
346 | FILE *a, *f=fopen("conftestval", "w"); |
343 | if (!f) exit(1); |
347 | if (!f) exit(1); |
344 | #ifdef WTMPX_FILE |
348 | #ifdef WTMPX_FILE |
345 | fprintf(f, "%s\n", WTMPX_FILE); |
349 | fprintf(f, "%s\n", WTMPX_FILE); |
346 | exit(0); |
350 | exit(0); |
… | |
… | |
364 | dnl# -------------------------------------------------------------------------- |
368 | dnl# -------------------------------------------------------------------------- |
365 | |
369 | |
366 | dnl# find lastlog |
370 | dnl# find lastlog |
367 | AC_CACHE_CHECK(where lastlog is located, path_lastlog, |
371 | AC_CACHE_CHECK(where lastlog is located, path_lastlog, |
368 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
372 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
373 | #include <stdlib.h> |
369 | #include <sys/types.h> |
374 | #include <sys/types.h> |
370 | #ifdef HAVE_UTMPX_H |
375 | #ifdef HAVE_UTMPX_H |
371 | #include <utmpx.h> |
376 | #include <utmpx.h> |
372 | #elif defined(HAVE_UTMP_H) |
377 | #elif defined(HAVE_UTMP_H) |
373 | #include <utmp.h> |
378 | #include <utmp.h> |
… | |
… | |
398 | exit(0); |
403 | exit(0); |
399 | }]])],[path_lastlog=`cat conftestval`],[path_lastlog=],[dnl |
404 | }]])],[path_lastlog=`cat conftestval`],[path_lastlog=],[dnl |
400 | AC_MSG_WARN(Define LASTLOG_FILE in config.h manually)])]) |
405 | AC_MSG_WARN(Define LASTLOG_FILE in config.h manually)])]) |
401 | if test x$path_lastlog != x; then |
406 | if test x$path_lastlog != x; then |
402 | AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$path_lastlog", Define location of lastlog) |
407 | AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$path_lastlog", Define location of lastlog) |
403 | if test -d "$path_lastlog"; then |
|
|
404 | AC_DEFINE(LASTLOG_IS_DIR, 1, Define if lastlog is provided via a directory) |
|
|
405 | fi |
|
|
406 | fi |
408 | fi |
407 | dnl# -------------------------------------------------------------------------- |
409 | dnl# -------------------------------------------------------------------------- |
408 | |
410 | |
409 | dnl# find lastlogx |
411 | dnl# find lastlogx |
410 | AC_CACHE_CHECK(where lastlogx is located, path_lastlogx, |
412 | AC_CACHE_CHECK(where lastlogx is located, path_lastlogx, |
411 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
413 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
414 | #include <stdlib.h> |
412 | #ifdef HAVE_UTMPX_H |
415 | #ifdef HAVE_UTMPX_H |
413 | #include <utmpx.h> |
416 | #include <utmpx.h> |
414 | #endif |
417 | #endif |
415 | #include <errno.h> |
418 | #include <errno.h> |
416 | main() |
419 | main() |
… | |
… | |
435 | exit(0); |
438 | exit(0); |
436 | }]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl |
439 | }]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl |
437 | AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])]) |
440 | AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])]) |
438 | if test x$path_lastlogx != x; then |
441 | if test x$path_lastlogx != x; then |
439 | AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$path_lastlogx", Define location of lastlogx) |
442 | AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$path_lastlogx", Define location of lastlogx) |
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 |
443 | fi |
454 | ]) |
444 | ]) |
455 | |
445 | |
456 | AC_DEFUN([SCM_RIGHTS_CHECK], |
446 | AC_DEFUN([SCM_RIGHTS_CHECK], |
457 | [ |
447 | [ |