From 1a329f250fa2b462473da4633506908193ee81d6 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 20 Aug 2013 21:57:52 +0200 Subject: Check for who(1) only if utmpx(5) isn't available The who(1) command is only called by check_users if the system doesn't provide an utmpx(5) interface. diff --git a/configure.in b/configure.in index 529720e..a157596 100644 --- a/configure.in +++ b/configure.in @@ -316,10 +316,6 @@ AS_IF([test "x$with_ldap" != "xno"], [ LIBS="$_SAVEDLIBS" ]) -dnl Check for headers used by check_users -AC_CHECK_HEADERS(utmpx.h) -AM_CONDITIONAL([HAVE_UTMPX], [test "$ac_cv_header_utmpx_h" = "yes"]) - dnl Check for headers used by check_ide_smart case $host in *linux*) @@ -366,6 +362,26 @@ else AC_SUBST(MYSQLCFLAGS) fi +dnl Check for headers used by check_users +AC_CHECK_HEADERS(utmpx.h) +AM_CONDITIONAL([HAVE_UTMPX], [test "$ac_cv_header_utmpx_h" = "yes"]) + +dnl Fallback to who(1) if the system doesn't provide an utmpx(5) interface +if test "$ac_cv_header_utmpx_h" = "no" +then + AC_PATH_PROG(PATH_TO_WHO,who) + + if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null] + then + ac_cv_path_to_who="$PATH_TO_WHO -q" + else + ac_cv_path_to_who="$PATH_TO_WHO" + fi + + AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who", + [path and arguments for invoking 'who']) +fi + AC_ARG_WITH([ipv6], [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])], [], [with_ipv6=check]) @@ -1338,19 +1354,6 @@ else AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares]) fi - -AC_PATH_PROG(PATH_TO_WHO,who) - -if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null] -then - ac_cv_path_to_who="$PATH_TO_WHO -q" -else - ac_cv_path_to_who="$PATH_TO_WHO" -fi - -AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who", - [path and arguments for invoking 'who']) - AC_PATH_PROG(PATH_TO_SNMPGET,snmpget) AC_ARG_WITH(snmpget_command, ACX_HELP_STRING([--with-snmpget-command=PATH], -- cgit v0.10-9-g596f