AC_SUBST(KERNEL_CFLAGS)
fi
+if test "x$ac_system" = "xSolaris"
+then
+ CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
+fi
+
#
# Checks for header files.
#
])
# For the swap module
-AC_CHECK_HEADERS(sys/swap.h, [], [],
+have_sys_swap_h="yes"
+AC_CHECK_HEADERS(sys/swap.h, [], [have_sys_swap_h="no"],
[
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
])
+if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
+then
+ AC_MSG_NOTICE([Solaris detected and sys/swap.h not found: Try building a 64bit binary.])
+fi
+
# For load module
# For the processes plugin
# For users module
fi
AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
+AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
+if test "x$with_kvm_openfiles" = "xyes"
+then
+ AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
+ [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
+ with_libkvm="yes"
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
+
with_sensors_cflags=""
with_sensors_ldflags=""
AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
[with_libnotify="yes"],
[with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
-with_libupsclient="no (pkg-config isn't available)"
+with_libupsclient_config=""
with_libupsclient_cflags=""
with_libupsclient_libs=""
-if test "x$PKG_CONFIG" != "x"
-then
- pkg-config --exists 'libupsclient' 2>/dev/null
- if test "$?" = "0"
+AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
+[
+ if test "x$withval" = "xno"
then
- with_libupsclient="yes"
+ with_libupsclient="no"
+ else if test "x$withval" = "xyes"
+ then
+ with_libupsclient="use_pkgconfig"
else
+ if test -x "$withval"
+ then
+ with_libupsclient_config="$withval"
+ with_libupsclient="use_libupsclient_config"
+ else if test -x "$withval/bin/libupsclient-config"
+ then
+ with_libupsclient_config="$withval/bin/net-snmp-config"
+ with_libupsclient="use_libupsclient_config"
+ else
+ AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
+ with_libupsclient_cflags="-I$withval/include"
+ with_libupsclient_libs="-L$withval/lib -lupsclient"
+ with_libupsclient="yes"
+ fi; fi
+ fi; fi
+],
+[with_libupsclient="use_pkgconfig"])
+
+# configure using libupsclient-config
+if test "x$with_libupsclient" = "xuse_libupsclient_config"
+then
+ AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
+ with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
+ if test $? -ne 0
+ then
+ with_libupsclient="no ($with_libupsclient_config failed)"
+ fi
+ with_libupsclient_libs="`$with_libupsclient_config --libs`"
+ if test $? -ne 0
+ then
+ with_libupsclient="no ($with_libupsclient_config failed)"
+ fi
+fi
+if test "x$with_libupsclient" = "xuse_libupsclient_config"
+then
+ with_libupsclient="yes"
+fi
+
+# configure using pkg-config
+if test "x$with_libupsclient" = "xuse_pkgconfig"
+then
+ if test "x$PKG_CONFIG" = "x"
+ then
+ with_libupsclient="no (Don't have pkg-config)"
+ fi
+fi
+if test "x$with_libupsclient" = "xuse_pkgconfig"
+then
+ AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
+ $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
+ if test $? -ne 0
+ then
with_libupsclient="no (pkg-config doesn't know library)"
fi
fi
-if test "x$with_libupsclient" = "xyes"
+if test "x$with_libupsclient" = "xuse_pkgconfig"
then
- with_libupsclient_cflags="`pkg-config --cflags 'libupsclient'`"
+ with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
if test $? -ne 0
then
- with_libupsclient="no"
+ with_libupsclient="no ($PKG_CONFIG failed)"
fi
- with_libupsclient_libs="`pkg-config --libs 'libupsclient'`"
+ with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
if test $? -ne 0
then
- with_libupsclient="no"
+ with_libupsclient="no ($PKG_CONFIG failed)"
fi
fi
+if test "x$with_libupsclient" = "xuse_pkgconfig"
+then
+ with_libupsclient="yes"
+fi
+
+# with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
+# the actual checks.
if test "x$with_libupsclient" = "xyes"
then
SAVE_CPPFLAGS="$CPPFLAGS"
plugin_disk="yes"
plugin_interface="yes"
plugin_memory="yes"
- plugin_swap="yes"
plugin_tape="yes"
fi
+if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
+then
+ plugin_swap="yes"
+fi
+
# libstatgrab
if test "x$with_libstatgrab" = "xyes"
then
plugin_swap="yes"
fi
-if test "x$with_kvm_nlist" = "xyes"
+if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
then
plugin_tcpconns="yes"
fi