AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
fi
-AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"])
-if test "x$with_libkvm" = "xyes"
+AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
+if test "x$with_kvm_getswapinfo" = "xyes"
then
- AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)])
+ AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
+ [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
fi
-AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes")
+AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
with_sensors_cflags=""
with_sensors_ldflags=""
if BUILD_WITH_LIBDEVINFO
swap_la_LIBADD += -ldevinfo
endif
-if BUILD_WITH_LIBKVM
+if BUILD_WITH_LIBKVM_GETSWAPINFO
swap_la_LIBADD += -lkvm
endif
if BUILD_WITH_LIBSTATGRAB
/* No global variables */
/* #endif defined(VM_SWAPUSAGE) */
-#elif HAVE_LIBKVM
+#elif HAVE_LIBKVM_GETSWAPINFO
static kvm_t *kvm_obj = NULL;
int kvm_pagesize;
-/* #endif HAVE_LIBKVM */
+/* #endif HAVE_LIBKVM_GETSWAPINFO */
#elif HAVE_LIBSTATGRAB
/* No global variables */
/* No init stuff */
/* #endif defined(VM_SWAPUSAGE) */
-#elif HAVE_LIBKVM
+#elif HAVE_LIBKVM_GETSWAPINFO
if (kvm_obj != NULL)
{
kvm_close (kvm_obj);
ERROR ("swap plugin: kvm_open failed.");
return (-1);
}
-/* #endif HAVE_LIBKVM */
+/* #endif HAVE_LIBKVM_GETSWAPINFO */
#elif HAVE_LIBSTATGRAB
/* No init stuff */
swap_submit ("free", sw_usage.xsu_avail);
/* #endif VM_SWAPUSAGE */
-#elif HAVE_LIBKVM
+#elif HAVE_LIBKVM_GETSWAPINFO
struct kvm_swap data_s;
int status;
swap_submit ("used", used);
swap_submit ("free", free);
-/* #endif HAVE_LIBKVM */
+/* #endif HAVE_LIBKVM_GETSWAPINFO */
#elif HAVE_LIBSTATGRAB
sg_swap_stats *swap;