Code

Added checks for `utmpx.h' and `getutxent' to the configure script
authorocto <octo>
Sun, 4 Dec 2005 18:34:48 +0000 (18:34 +0000)
committerocto <octo>
Sun, 4 Dec 2005 18:34:48 +0000 (18:34 +0000)
Makefile.am [new file with mode: 0644]
configure.in
src/config.h.in
src/users.h

diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..f8279e3
--- /dev/null
@@ -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
index 14f4806f399b963ff5981d6b1dcdf966d369b03c..ad43b17d34f8511f8cabdeb264743f3d87418a41 100644 (file)
@@ -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
index fd97bf6345e5848642d81f4914548df795354c3e..72bf7e2e999f6979d807e88685eb448d2e5e7a33 100644 (file)
@@ -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 <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if you have the <utmpx.h> header file. */
+#undef HAVE_UTMPX_H
+
 /* True if program is to be compiled for a Linux kernel */
 #undef KERNEL_LINUX
 
index 360c595b6f909b0e35f26a6249a60b2f6493c4d1..f8b95445bcf6c118ab01b3f0f904057c00fd7abf 100644 (file)
 #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);