dnl Check whether ksysguardd can run; 
AC_MSG_CHECKING([if ksysguardd can be compiled])
case "$host" in 
  *-*-linux*) ksysguardd_compile=yes; UNAME='Linux' ;;
  *-*-freebsd*) ksysguardd_compile=yes; UNAME='FreeBSD' ;;
  *-*-netbsd*) ksysguardd_compile=yes; UNAME='NetBSD' ;;
  *-*-solaris*) ksysguardd_compile=yes; UNAME='Solaris' ;;
  *-*-osf*) ksysguardd_compile=yes; UNAME='Tru64' ;;
  *-*-irix*) ksysguardd_compile=yes; UNAME='Irix' ;;
  *) ksysguardd_compile=no; UNAME='' ;;
esac

AC_MSG_RESULT($ksysguardd_compile)

AM_CONDITIONAL(include_ksysguardd, test "$ksysguardd_compile" = "yes")
AM_CONDITIONAL(include_ksysguardd_linux, test "$UNAME" = Linux)
AM_CONDITIONAL(include_ksysguardd_freebsd, test "$UNAME" = FreeBSD)
AM_CONDITIONAL(include_ksysguardd_netbsd, test "$UNAME" = NetBSD)
AM_CONDITIONAL(include_ksysguardd_solaris, test "$UNAME" = Solaris)
AM_CONDITIONAL(include_ksysguardd_tru64, test "$UNAME" = Tru64)
AM_CONDITIONAL(include_ksysguardd_irix, test "$UNAME" = Irix)
AC_SUBST(UNAME)

AC_CHECK_LIB(sensors, sensors_init, [LIBSENSORS="-lsensors"])
AC_SUBST(LIBSENSORS)

dnl Check for dell laptop support
AM_CONDITIONAL(supports_i8k, test -f /proc/i8k)

case "$UNAME" in
	Linux) LIBHOSTS="$LIBSENSORS" ;;
	FreeBSD) LIBHOSTS="$LIBSENSORS -lkvm" ;;
	Solaris) LIBHOSTS="$LIBSENSORS -lkstat -lsocket" ;;
esac
AC_SUBST(LIBHOSTS)

AC_CHECK_HEADERS(sensors/sensors.h)
