summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-07-29 11:16:29 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-07-29 11:16:29 -0700
commita9040b281062ddabcfb2cfdfc37e431b047531b2 (patch)
tree42fd4fb262ebf9f8da5912a4242a8842711fcd27 /configure.ac
parentcafa4376f4761c2d565b2c1deeb7dbfb553d7045 (diff)
Set utmp/wtmp paths via configure instead of hardcoding them
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac40
1 files changed, 40 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 19b3c26..fb46901 100644
--- a/configure.ac
+++ b/configure.ac
@@ -236,6 +236,46 @@ AC_ARG_WITH(config-type,
[SERVERSTYPE="$withval"], [SERVERSTYPE="ws"])
AC_SUBST(SERVERSTYPE)
+# Ideally we'd just pull out UTMP_FILE & WTMP_FILE from <utmp.h>
+# but that's not easy to do in autoconf
+AC_ARG_WITH(utmp_file,
+ AC_HELP_STRING([--with-utmp-file=<pathname>],
+ [specify file to pass to sessreg -u for current logins]),
+ [UTMP_FILE="$withval"])
+if test "x$UTMP_FILE" = "xyes" ; then
+ AC_MSG_ERROR([path was not specified to --with-utmp-file])
+fi
+if test "x$UTMP_FILE" = "x" ; then
+ for UTMP_FILE in /var/adm/utmpx /var/run/utmp /var/log/utmp /var/adm/utmp /usr/adm/utmp /etc/utmp ; do
+ AC_CHECK_FILE([$UTMP_FILE], [break], [UTMP_FILE=""])
+ done
+ if test "x$UTMP_FILE" = "x" ; then
+ UTMP_FILE="/var/run/utmp"
+ fi
+fi
+AC_MSG_CHECKING([for path to file listing current logins for sessreg])
+AC_MSG_RESULT([$UTMP_FILE])
+AC_SUBST(UTMP_FILE)
+
+AC_ARG_WITH(wtmp_file,
+ AC_HELP_STRING([--with-wtmp-file=<pathname>],
+ [specify file to pass to sessreg -w for login history]),
+ [WTMP_FILE="$withval"])
+if test "x$WTMP_FILE" = "xyes" ; then
+ AC_MSG_ERROR([path was not specified to --with-wtmp-file])
+fi
+if test "x$WTMP_FILE" = "x" ; then
+ for WTMP_FILE in /var/adm/wtmpx /var/log/wtmp /var/adm/wtmp /usr/adm/wtmp /etc/wtmp ; do
+ AC_CHECK_FILE([$WTMP_FILE], [break], [WTMP_FILE=""])
+ done
+ if test "x$WTMP_FILE" = "x" ; then
+ WTMP_FILE="/var/log/wtmp"
+ fi
+fi
+AC_MSG_CHECKING([for path to file listing login history for sessreg])
+AC_MSG_RESULT([$WTMP_FILE])
+AC_SUBST(WTMP_FILE)
+
case $host_os in
*sco*|*solaris*)
SHELL_CMD="/bin/ksh" ;;