my %p : shared;
- if ($data !~ m/^$pkg/) {
+ if ($data !~ m/^$pkg\:\:/) {
$data = $pkg . "::" . $data;
}
### END of check for libcurl ###
with_libiokit="no"
-collectd_libiokit=0
AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
[
with_libiokit="yes"
- collectd_libiokit=1
-],
+],
[
with_libiokit="no"
- collectd_libiokit=0
])
-AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
with_libstatgrab_cflags=""
with_libstatgrab_ldflags=""
AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
[
- if test "x$withval" != "xno" -a "x$withval" != "xyes"
+ if test "x$withval" != "xno" \
+ && test "x$withval" != "xyes"
then
with_libstatgrab_cflags="-I$withval/include"
with_libstatgrab_ldflags="-L$withval/lib"
fi
],
[
- if test "x$ac_system" == "xunknown"
+ if test "x$ac_system" = "xunknown"
then
with_libstatgrab="yes"
else
AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
if test "x$with_libstatgrab" = "xyes"
then
+ AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
#include "plugin.h"
#include "configfile.h"
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
/*
* Global variables
*/
#if HAVE_PTH_H
# include <pth.h>
#endif
-#if HAVE_STATGRAB_H
-# include <statgrab.h>
-#endif
#if HAVE_SENSORS_SENSORS_H
# include <sensors/sensors.h>
#endif
# include <ifaddrs.h>
#endif
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
/*
* Various people have reported problems with `getifaddrs' and varying versions
* of `glibc'. That's why it's disabled by default. Since more statistics are
#include <sys/loadavg.h>
#endif
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
#ifdef HAVE_GETLOADAVG
#if !defined(LOADAVG_1MIN) || !defined(LOADAVG_5MIN) || !defined(LOADAVG_15MIN)
#define LOADAVG_1MIN 0
load_submit (snum, mnum, lnum);
/* #endif KERNEL_LINUX */
-#elif defined(HAVE_LIBSTATGRAB)
+#elif HAVE_LIBSTATGRAB
gauge_t snum, mnum, lnum;
sg_load_stats *ls;
# include <mach/vm_statistics.h>
#endif
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
/* vm_statistics_data_t */
#if HAVE_HOST_STATISTICS
static mach_port_t port_host;
static kstat_t *ksp;
/* #endif HAVE_LIBKSTAT */
+#elif HAVE_LIBSTATGRAB
+/* no global variables */
+/* endif HAVE_LIBSTATGRAB */
+
#else
# error "No applicable input method."
#endif
memory_submit ("cache", sysctl_vals[6]);
/* #endif HAVE_SYSCTLBYNAME */
-#elif defined(KERNEL_LINUX)
+#elif KERNEL_LINUX
FILE *fh;
char buffer[1024];
memory_submit ("cached", mem_cached);
memory_submit ("free", mem_free);
}
-/* #endif defined(KERNEL_LINUX) */
+/* #endif KERNEL_LINUX */
-#elif defined(HAVE_LIBKSTAT)
+#elif HAVE_LIBKSTAT
long long mem_used;
long long mem_free;
long long mem_lock;
memory_submit ("used", mem_used);
memory_submit ("free", mem_free);
memory_submit ("locked", mem_lock);
-/* #endif defined(HAVE_LIBKSTAT) */
+/* #endif HAVE_LIBKSTAT */
-#elif defined(HAVE_LIBSTATGRAB)
+#elif HAVE_LIBSTATGRAB
sg_mem_stats *ios;
if ((ios = sg_get_mem_stats ()) != NULL)
exit (1);
}
+#ifdef __FreeBSD__
+ /* On FreeBSD, PERL_SYS_INIT3 expands to some expression which
+ * triggers a "value computed is not used" warning by gcc. */
+ (void)
+#endif
PERL_SYS_INIT3 (&argc, &argv, &environ);
perl_threads = (c_ithread_list_t *)smalloc (sizeof (c_ithread_list_t));
# include <kvm.h>
#endif
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
#undef MAX
#define MAX(x,y) ((x) > (y) ? (x) : (y))