From 6e481905ed44d53c8ebf00224490b76490e018dd Mon Sep 17 00:00:00 2001 From: octo Date: Sun, 4 Dec 2005 18:34:48 +0000 Subject: [PATCH] Added checks for `utmpx.h' and `getutxent' to the configure script --- Makefile.am | 8 ++++++++ configure.in | 4 +++- src/config.h.in | 6 ++++++ src/users.h | 4 ++++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 Makefile.am diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 00000000..f8279e3e --- /dev/null +++ b/Makefile.am @@ -0,0 +1,8 @@ +AUTOMAKE_OPTIONS = dist-bzip2 + +SUBDIRS = src + +EXTRA_DIST = collectd.spec contrib debian + +dist-hook: + find $(distdir) -type d -name '.svn' | xargs rm -rf diff --git a/configure.in b/configure.in index 14f4806f..ad43b17d 100644 --- a/configure.in +++ b/configure.in @@ -36,6 +36,7 @@ AC_CHECK_HEADERS(netinet/in.h) AC_CHECK_HEADERS(netdb.h) AC_CHECK_HEADERS(syslog.h) AC_CHECK_HEADERS(dlfcn.h) +AC_CHECK_HEADERS(utmpx.h) dnl Checking for libraries AC_CHECK_LIB(m, ext) @@ -53,6 +54,7 @@ AC_CHECK_FUNCS(socket, , AC_CHECK_LIB(socket, socket)) AC_CHECK_FUNCS(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname)) AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen) AC_CHECK_FUNCS(strncasecmp strcasecmp strncmp) +AC_CHECK_FUNCS(getutxent) AC_MSG_CHECKING([for kernel type ($host_os)]) case $host_os in @@ -387,7 +389,7 @@ AM_CONDITIONAL(BUILD_MODULE_TRAFFIC, test "x$enable_traffic" = "xyes") AC_ARG_ENABLE(users, AC_HELP_STRING([--disable-users], [Disable user count statistics]),, [enable_users="yes"]) if test "x$enable_users" != "xno" then - if test "x$ac_system" = "xLinux" + if test "x$ac_system" = "xLinux" -o "x$ac_system" = "xSolaris" then enable_users="yes" else diff --git a/src/config.h.in b/src/config.h.in index fd97bf63..72bf7e2e 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -63,6 +63,9 @@ /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY +/* Define to 1 if you have the `getutxent' function. */ +#undef HAVE_GETUTXENT + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H @@ -201,6 +204,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the header file. */ +#undef HAVE_UTMPX_H + /* True if program is to be compiled for a Linux kernel */ #undef KERNEL_LINUX diff --git a/src/users.h b/src/users.h index 360c595b..f8b95445 100644 --- a/src/users.h +++ b/src/users.h @@ -28,7 +28,11 @@ #include "config.h" #ifndef COLLECT_USERS +#if defined(HAVE_UTMPX_H) && defined(HAVE_GETUTXENT) #define COLLECT_USERS 1 +#else +#define COLLECT_USERS 0 +#endif #endif /* ! defined(COLLECT_USERS) */ void users_init(void); -- 2.11.0