INSTALL_DATA = @INSTALL_DATA@
INSTALL_BIN = @INSTALL_BIN@
+ifndef HAVE_SENSORS
HAVE_SENSORS = @HAVE_SENSORS@
+endif
LFSENSORS =
DFSENSORS =
ifeq ($(HAVE_SENSORS),y)
LFSENSORS = @LFSENSORS@
DFSENSORS = @DFSENSORS@
endif
+ifndef HAVE_SENSORS32
+HAVE_SENSORS32 = @HAVE_SENSORS32@
+endif
+LFSENSORS32 =
+DFSENSORS32 =
+ifeq ($(HAVE_SENSORS32),y)
+LFSENSORS32 = @LFSENSORS32@
+DFSENSORS32 = @DFSENSORS32@
+endif
HAVE_PCP = @HAVE_PCP@
LFPCP =
endif
NLS_DIR = $(PREFIX)/share/locale
+
+ifndef SYSCONFIG_DIR
SYSCONFIG_DIR = @SYSCONFIG_DIR@
+endif
+ifndef SYSCONFIG_FILE
SYSCONFIG_FILE = @SYSCONFIG_FILE@
+endif
# Compiler flags
-CFLAGS = @CFLAGS@ -Wall -Wstrict-prototypes -pipe -O2
+ifndef CFLAGS
+CFLAGS = @CFLAGS@
+endif
+CFLAGS += -Wall -Wstrict-prototypes -pipe -O2
+
+ifndef DFLAGS
DFLAGS = @DFLAGS@
-LFLAGS = @STRIP@
+endif
DFLAGS += -DSA_DIR=\"$(SA_DIR)\" -DSADC_PATH=\"$(SADC_PATH)\"
-DFLAGS += $(DFSENSORS)
+DFLAGS += $(DFSENSORS) $(DFSENSORS32)
DFLAGS += $(DFPCP)
+ifdef TFLAGS
+DFLAGS += $(TFLAGS)
+endif
+
+ifndef LFLAGS
+LFLAGS = @STRIP@
+endif
# Commands
ifndef MSGFMT
ifeq ($(SYSPARAM),y)
DFLAGS += -DHAVE_SYS_PARAM_H
endif
+
+ifndef TGLIB32
TGLIB32 = @TGLIB32@
+endif
+
+ifndef NLS
NLS = @NLS@
+endif
LFLAGS += @LFINTL@
ifeq ($(NLS),y)
REQUIRE_NLS = -DUSE_NLS -DPACKAGE=\"$(PACKAGE)\" -DLOCALEDIR=\"$(NLS_DIR)\"
ifdef REQUIRE_NLS
DFLAGS += $(REQUIRE_NLS)
endif
+
+ifndef INSTALL_CRON
INSTALL_CRON = @INSTALL_CRON@
+endif
+ifndef CRON_OWNER
CRON_OWNER = @CRON_OWNER@
+endif
MAN_GROUP = @MAN_GROUP@
ifndef IGNORE_FILE_ATTRIBUTES
cifsiostat: cifsiostat.o librdstats_light.a libsyscom.a
+# inisar: Old sar version
+
tests/ini/sa_common.o: tests/ini/sa_common.c tests/ini/iniversion.h tests/ini/sa.h tests/ini/common.h tests/ini/rd_stats.h tests/ini/rd_sensors.h tests/ini/ioconf.h tests/ini/inisysconfig.h
tests/ini/act_sar.o: tests/ini/activity.c tests/ini/sa.h tests/ini/common.h tests/ini/rd_stats.h tests/ini/rd_sensors.h tests/ini/pr_stats.h
tests/ini/inisar: tests/ini/inisar.o tests/ini/act_sar.o tests/ini/format_sar.o tests/ini/sa_common.o tests/ini/pr_stats.o tests/ini/librdstats_light.a tests/ini/libsyscom.a
+# sar32/sadc32: 32-bit versions of sar/sadc
tests/32bits/sadc32.o: sadc.c sa.h version.h common.h rd_stats.h rd_sensors.h
- $(CC) -m32 -o $@ -c $(CFLAGS) $(DFLAGS) $<
-
-tests/32bits/sadc32: LFLAGS += $(LFSENSORS)
-
-tests/32bits/sadc32: tests/32bits/sadc32.o tests/32bits/act_sadc32.o tests/32bits/sa_wrap32.o tests/32bits/sa_common_light32.o tests/32bits/common_light32.o tests/32bits/systest32.o tests/32bits/librdstats32.a tests/32bits/librdsensors32.a
- $(CC) -m32 -o $@ $(CFLAGS) $^ $(LFLAGS)
+ $(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
tests/32bits/sar32.o: sar.c sa.h version.h common.h rd_stats.h rd_sensors.h
- $(CC) -m32 -o $@ -c $(CFLAGS) $(DFLAGS) $<
-
-tests/32bits/sar32: tests/32bits/sar32.o tests/32bits/act_sar32.o tests/32bits/format_sar32.o tests/32bits/sa_common32.o tests/32bits/pr_stats32.o tests/32bits/librdstats_light32.a tests/32bits/libsyscom32.a
- $(CC) -m32 -o $@ $(CFLAGS) $^ $(LFLAGS)
+ $(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
tests/32bits/act_sadc32.o: activity.c sa.h common.h rd_stats.h rd_sensors.h
- $(CC) -m32 -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
tests/32bits/act_sar32.o: activity.c sa.h common.h rd_stats.h rd_sensors.h pr_stats.h
- $(CC) -m32 -o $@ -c $(CFLAGS) -DSOURCE_SAR $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) -DSOURCE_SAR $(DFLAGS) $<
tests/32bits/sa_wrap32.o: sa_wrap.c sa.h common.h rd_stats.h count.h rd_sensors.h
- $(CC) -m32 -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
tests/32bits/sa_common_light32.o: sa_common.c version.h sa.h common.h rd_stats.h rd_sensors.h ioconf.h sysconfig.h
- $(CC) -m32 -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
tests/32bits/sa_common32.o: sa_common.c version.h sa.h common.h rd_stats.h rd_sensors.h ioconf.h sysconfig.h
- $(CC) -m32 -o $@ -c $(CFLAGS) $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
tests/32bits/common_light32.o: common.c version.h common.h
- $(CC) -m32 -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
tests/32bits/systest32.o: systest.c systest.h
- $(CC) -m32 -o $@ -c $(CFLAGS) $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
tests/32bits/libsyscom32.a: tests/32bits/common32.o tests/32bits/ioconf32.o tests/32bits/systest32.o
$(AR) rvs $@ $?
$(AR) rvs $@ $?
tests/32bits/rd_stats32.o: rd_stats.c common.h rd_stats.h
- $(CC) -m32 -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
tests/32bits/rd_stats_light32.o: rd_stats.c common.h rd_stats.h ioconf.h sysconfig.h
- $(CC) -m32 -o $@ -c $(CFLAGS) $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
tests/32bits/count32.o: count.c common.h rd_stats.h
- $(CC) -m32 -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
tests/32bits/count_light32.o: count.c common.h rd_stats.h
- $(CC) -m32 -o $@ -c $(CFLAGS) $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
tests/32bits/format_sar32.o: format.c sa.h common.h rd_stats.h rd_sensors.h
- $(CC) -m32 -o $@ -c $(CFLAGS) -DSOURCE_SAR $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) -DSOURCE_SAR $(DFLAGS) $<
tests/32bits/pr_stats32.o: pr_stats.c sa.h common.h rd_stats.h rd_sensors.h ioconf.h sysconfig.h pr_stats.h
- $(CC) -m32 -o $@ -c $(CFLAGS) $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
tests/32bits/common32.o: common.c version.h common.h
- $(CC) -m32 -o $@ -c $(CFLAGS) $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
tests/32bits/ioconf32.o: ioconf.c ioconf.h common.h sysconfig.h
- $(CC) -m32 -o $@ -c $(CFLAGS) $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
tests/32bits/rd_sensors32.o: rd_sensors.c common.h rd_sensors.h rd_stats.h
- $(CC) -m32 -o $@ -c $(CFLAGS) $(DFLAGS) $<
+ $(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
+
+tests/32bits/sadc32: LFLAGS += $(LFSENSORS32)
+
+tests/32bits/sadc32: tests/32bits/sadc32.o tests/32bits/act_sadc32.o tests/32bits/sa_wrap32.o tests/32bits/sa_common_light32.o tests/32bits/common_light32.o tests/32bits/systest32.o tests/32bits/librdstats32.a tests/32bits/librdsensors32.a
+
+tests/32bits/sar32: tests/32bits/sar32.o tests/32bits/act_sar32.o tests/32bits/format_sar32.o tests/32bits/sa_common32.o tests/32bits/pr_stats32.o tests/32bits/librdstats_light32.a tests/32bits/libsyscom32.a
ifdef REQUIRE_NLS
locales: $(NLSGMO)
testcomp: tests/ini/inisar sa32bit
ifeq ($(TGLIB32),yes)
+sa32bit: DFLAGS += -DARCH32
+
+sa32bit: CFLAGS += -m32
+
sa32bit: tests/32bits/sadc32 tests/32bits/sar32
else
sa32bit:
RC_DIR
rcdir
TGLIB32
+DFSENSORS32
+LFSENSORS32
+HAVE_SENSORS32
+DFSENSORS
+LFSENSORS
+HAVE_SENSORS
PCP_IMPL
DFPCP
LFPCP
HAVE_PCP
-DFSENSORS
-LFSENSORS
-HAVE_SENSORS
SYSTEMD_SLEEP_DIR
SYSTEMD_UNIT_DIR
SYSTEMCTL
enable_option_checking
with_systemdsystemunitdir
with_systemdsleepdir
-enable_sensors
enable_pcp
+enable_sensors
enable_largefile
enable_nls
enable_file_attr
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --disable-sensors disable sensors support
--disable-pcp disable PCP support
+ --disable-sensors disable sensors support
--disable-largefile omit support for large files
--disable-nls disable National Language Support
--disable-file-attr do not set attributes on files being installed
done
+# Should we check for PCP support?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCP support" >&5
+$as_echo_n "checking for PCP support... " >&6; }
+# Check whether --enable-pcp was given.
+if test "${enable_pcp+set}" = set; then :
+ enableval=$enable_pcp; PCP=$enableval
+else
+ PCP=yes
+fi
+
+if test $PCP != "yes"; then
+ HAVE_PCP="n"
+else
+ HAVE_PCP="y"
+fi
+
+if test ! $HAVE_PCP_PMAPI_H; then
+ HAVE_PCP="n"
+ PCP=no
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCP" >&5
+$as_echo "$PCP" >&6; }
+
+# Check for PCP libraries
+LFPCP=""
+DFPCP=""
+if test $HAVE_PCP = "y"; then
+ PCP=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pmGetVersion in -lpcp" >&5
+$as_echo_n "checking for pmGetVersion in -lpcp... " >&6; }
+if ${ac_cv_lib_pcp_pmGetVersion+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpcp $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pmGetVersion ();
+int
+main ()
+{
+return pmGetVersion ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pcp_pmGetVersion=yes
+else
+ ac_cv_lib_pcp_pmGetVersion=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcp_pmGetVersion" >&5
+$as_echo "$ac_cv_lib_pcp_pmGetVersion" >&6; }
+if test "x$ac_cv_lib_pcp_pmGetVersion" = xyes; then :
+ LFPCP="-lpcp -lpcp_import"
+else
+ HAVE_PCP="n"
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCP libraries" >&5
+$as_echo_n "checking for PCP libraries... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pcp/pmapi.h>
+ #include <pcp/import.h>
+int
+main ()
+{
+pmiEnd();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ PCP=yes; DFPCP="-DHAVE_PCP"
+else
+ HAVE_PCP="n"; PCP=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCP" >&5
+$as_echo "$PCP" >&6; }
+fi
+
+
+
+
+if test $HAVE_PCP_IMPL_H; then
+ PCP_IMPL="y"
+else
+ PCP_IMPL="n"
+fi
+
+
# Should we check for lm_sensors?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sensors support" >&5
$as_echo_n "checking for sensors support... " >&6; }
fi
if test $SENSORS != "yes"; then
- HAVE_SENSORS="n"
+ SENSORS_SUPPORT="n"
else
- HAVE_SENSORS="y"
+ SENSORS_SUPPORT="y"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SENSORS" >&5
$as_echo "$SENSORS" >&6; }
-# Check for lm_sensors
+# Check for lm_sensors library
LFSENSORS=""
DFSENSORS=""
-if test $HAVE_SENSORS = "y"; then
+HAVE_SENSORS="n"
+if test $SENSORS_SUPPORT = "y"; then
SENSORS=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sensors_get_detected_chips in -lsensors" >&5
$as_echo_n "checking for sensors_get_detected_chips in -lsensors... " >&6; }
HAVE_SENSORS="n"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sensors lib" >&5
-$as_echo_n "checking for sensors lib... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sensors library" >&5
+$as_echo_n "checking for sensors library... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sensors/sensors.h>
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- SENSORS=yes; DFSENSORS="-DHAVE_SENSORS"
+ SENSORS=yes; HAVE_SENSORS="y"; DFSENSORS="-DHAVE_SENSORS"
else
HAVE_SENSORS="n"; SENSORS=no
fi
-# Should we check for PCP support?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCP support" >&5
-$as_echo_n "checking for PCP support... " >&6; }
-# Check whether --enable-pcp was given.
-if test "${enable_pcp+set}" = set; then :
- enableval=$enable_pcp; PCP=$enableval
-else
- PCP=yes
-fi
-
-if test $PCP != "yes"; then
- HAVE_PCP="n"
-else
- HAVE_PCP="y"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCP" >&5
-$as_echo "$PCP" >&6; }
-
-if test ! $HAVE_PCP_PMAPI_H; then
- HAVE_PCP="n"
-fi
-
-# Check for PCP libraries
-LFPCP=""
-DFPCP=""
-if test $HAVE_PCP = "y"; then
- PCP=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pmGetVersion in -lpcp" >&5
-$as_echo_n "checking for pmGetVersion in -lpcp... " >&6; }
-if ${ac_cv_lib_pcp_pmGetVersion+:} false; then :
+# Check for 32-bit version of lm_sensors library
+LFSENSORS32=""
+DFSENSORS32=""
+HAVE_SENSORS32="n"
+if test $SENSORS_SUPPORT = "y"; then
+ CFLAGS_SAVE=$CFLAGS
+ CFLAGS+=" -m32"
+ LDFLAGS=" -lsensors"
+ SENSORS=no
+# Check for another function to avoid using cached result
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sensors_cleanup in -lsensors" >&5
+$as_echo_n "checking for sensors_cleanup in -lsensors... " >&6; }
+if ${ac_cv_lib_sensors_sensors_cleanup+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpcp $LIBS"
+LIBS="-lsensors $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __cplusplus
extern "C"
#endif
-char pmGetVersion ();
+char sensors_cleanup ();
int
main ()
{
-return pmGetVersion ();
+return sensors_cleanup ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_pcp_pmGetVersion=yes
+ ac_cv_lib_sensors_sensors_cleanup=yes
else
- ac_cv_lib_pcp_pmGetVersion=no
+ ac_cv_lib_sensors_sensors_cleanup=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcp_pmGetVersion" >&5
-$as_echo "$ac_cv_lib_pcp_pmGetVersion" >&6; }
-if test "x$ac_cv_lib_pcp_pmGetVersion" = xyes; then :
- LFPCP="-lpcp -lpcp_import"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sensors_sensors_cleanup" >&5
+$as_echo "$ac_cv_lib_sensors_sensors_cleanup" >&6; }
+if test "x$ac_cv_lib_sensors_sensors_cleanup" = xyes; then :
+ LFSENSORS32="-lsensors"
else
- HAVE_PCP="n"
+ HAVE_SENSORS32="n"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCP libraries" >&5
-$as_echo_n "checking for PCP libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sensors 32-bit library" >&5
+$as_echo_n "checking for sensors 32-bit library... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <pcp/pmapi.h>
- #include <pcp/import.h>
+#include <sensors/sensors.h>
+ #include <sensors/error.h>
int
main ()
{
-pmiEnd();
+sensors_cleanup();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- PCP=yes; DFPCP="-DHAVE_PCP"
+if ac_fn_c_try_link "$LINENO"; then :
+ SENSORS=yes; HAVE_SENSORS32="y"; DFSENSORS32="-DHAVE_SENSORS32"
else
- HAVE_PCP="n"; PCP=no
+ HAVE_SENSORS32="n"; SENSORS=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCP" >&5
-$as_echo "$PCP" >&6; }
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SENSORS" >&5
+$as_echo "$SENSORS" >&6; }
+ CFLAGS=$CFLAGS_SAVE
fi
-if test $HAVE_PCP_IMPL_H; then
- PCP_IMPL="y"
-else
- PCP_IMPL="n"
-fi
-
-
# Check for 32-bit system libraries
TGLIB32=no
CFLAGS_SAVE=$CFLAGS
AC_CHECK_FUNCS(strspn)
AC_CHECK_FUNCS(strstr)
-# Should we check for lm_sensors?
-AC_MSG_CHECKING(for sensors support)
-AC_ARG_ENABLE(sensors,
- AC_HELP_STRING([--disable-sensors],
- [disable sensors support]),
- SENSORS=$enableval,SENSORS=yes)
-if test $SENSORS != "yes"; then
- HAVE_SENSORS="n"
-else
- HAVE_SENSORS="y"
-fi
-AC_MSG_RESULT($SENSORS)
-
-# Check for lm_sensors
-LFSENSORS=""
-DFSENSORS=""
-if test $HAVE_SENSORS = "y"; then
- SENSORS=no
- AC_CHECK_LIB(sensors, sensors_get_detected_chips, LFSENSORS="-lsensors", HAVE_SENSORS="n")
- AC_MSG_CHECKING(for sensors lib)
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sensors/sensors.h>
- #include <sensors/error.h>]],
- [[sensors_cleanup();]])],SENSORS=yes; DFSENSORS="-DHAVE_SENSORS", HAVE_SENSORS="n"; SENSORS=no)
- AC_MSG_RESULT($SENSORS)
-fi
-AC_SUBST(HAVE_SENSORS)
-AC_SUBST(LFSENSORS)
-AC_SUBST(DFSENSORS)
-
# Should we check for PCP support?
AC_MSG_CHECKING(for PCP support)
AC_ARG_ENABLE(pcp,
else
HAVE_PCP="y"
fi
-AC_MSG_RESULT($PCP)
if test ! $HAVE_PCP_PMAPI_H; then
HAVE_PCP="n"
+ PCP=no
fi
+AC_MSG_RESULT($PCP)
# Check for PCP libraries
LFPCP=""
fi
AC_SUBST(PCP_IMPL)
+# Should we check for lm_sensors?
+AC_MSG_CHECKING(for sensors support)
+AC_ARG_ENABLE(sensors,
+ AC_HELP_STRING([--disable-sensors],
+ [disable sensors support]),
+ SENSORS=$enableval,SENSORS=yes)
+if test $SENSORS != "yes"; then
+ SENSORS_SUPPORT="n"
+else
+ SENSORS_SUPPORT="y"
+fi
+AC_MSG_RESULT($SENSORS)
+
+# Check for lm_sensors library
+LFSENSORS=""
+DFSENSORS=""
+HAVE_SENSORS="n"
+if test $SENSORS_SUPPORT = "y"; then
+ SENSORS=no
+ AC_CHECK_LIB(sensors, sensors_get_detected_chips, LFSENSORS="-lsensors", HAVE_SENSORS="n")
+ AC_MSG_CHECKING(for sensors library)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sensors/sensors.h>
+ #include <sensors/error.h>]],
+ [[sensors_cleanup();]])], SENSORS=yes; HAVE_SENSORS="y"; DFSENSORS="-DHAVE_SENSORS", HAVE_SENSORS="n"; SENSORS=no)
+ AC_MSG_RESULT($SENSORS)
+fi
+AC_SUBST(HAVE_SENSORS)
+AC_SUBST(LFSENSORS)
+AC_SUBST(DFSENSORS)
+
+# Check for 32-bit version of lm_sensors library
+LFSENSORS32=""
+DFSENSORS32=""
+HAVE_SENSORS32="n"
+if test $SENSORS_SUPPORT = "y"; then
+ CFLAGS_SAVE=$CFLAGS
+ CFLAGS+=" -m32"
+ LDFLAGS=" -lsensors"
+ SENSORS=no
+# Check for another function to avoid using cached result
+ AC_CHECK_LIB(sensors, sensors_cleanup, LFSENSORS32="-lsensors", HAVE_SENSORS32="n")
+ AC_MSG_CHECKING(for sensors 32-bit library)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sensors/sensors.h>
+ #include <sensors/error.h>]],
+ [[sensors_cleanup();]])], SENSORS=yes; HAVE_SENSORS32="y"; DFSENSORS32="-DHAVE_SENSORS32", HAVE_SENSORS32="n"; SENSORS=no)
+ AC_MSG_RESULT($SENSORS)
+ CFLAGS=$CFLAGS_SAVE
+fi
+AC_SUBST(HAVE_SENSORS32)
+AC_SUBST(LFSENSORS32)
+AC_SUBST(DFSENSORS32)
+
# Check for 32-bit system libraries
TGLIB32=no
CFLAGS_SAVE=$CFLAGS
#define _(string) (string)
#endif
-#ifdef HAVE_SENSORS
+#if (defined(HAVE_SENSORS) && !defined(ARCH32)) || (defined(ARCH32) && defined(HAVE_SENSORS32))
#include "sensors/sensors.h"
#endif
*/
__nr_t read_fan(struct stats_pwr_fan *st_pwr_fan, __nr_t nr_alloc)
{
-#ifdef HAVE_SENSORS
+#if (defined(HAVE_SENSORS) && !defined(ARCH32)) || (defined(ARCH32) && defined(HAVE_SENSORS32))
__nr_t fan_read = 0;
const sensors_chip_name *chip;
const sensors_feature *feature;
*/
__nr_t read_temp(struct stats_pwr_temp *st_pwr_temp, __nr_t nr_alloc)
{
-#ifdef HAVE_SENSORS
+#if (defined(HAVE_SENSORS) && !defined(ARCH32)) || (defined(ARCH32) && defined(HAVE_SENSORS32))
__nr_t temp_read = 0;
const sensors_chip_name *chip;
const sensors_feature *feature;
*/
__nr_t read_in(struct stats_pwr_in *st_pwr_in, __nr_t nr_alloc)
{
-#ifdef HAVE_SENSORS
+#if (defined(HAVE_SENSORS) && !defined(ARCH32)) || (defined(ARCH32) && defined(HAVE_SENSORS32))
__nr_t in_read = 0;
const sensors_chip_name *chip;
const sensors_feature *feature;
#endif /* HAVE_SENSORS */
}
-#ifdef HAVE_SENSORS
+#if (defined(HAVE_SENSORS) && !defined(ARCH32)) || (defined(ARCH32) && defined(HAVE_SENSORS32))
/*
***************************************************************************
* Count the number of sensors of given type on the machine.
*/
__nr_t get_fan_nr(void)
{
-#ifdef HAVE_SENSORS
+#if (defined(HAVE_SENSORS) && !defined(ARCH32)) || (defined(ARCH32) && defined(HAVE_SENSORS32))
return get_sensors_nr(SENSORS_FEATURE_FAN);
#else
return 0;
*/
__nr_t get_temp_nr(void)
{
-#ifdef HAVE_SENSORS
+#if (defined(HAVE_SENSORS) && !defined(ARCH32)) || (defined(ARCH32) && defined(HAVE_SENSORS32))
return get_sensors_nr(SENSORS_FEATURE_TEMP);
#else
return 0;
#endif /* HAVE_SENSORS */
-
}
/*
*/
__nr_t get_in_nr(void)
{
-#ifdef HAVE_SENSORS
+#if (defined(HAVE_SENSORS) && !defined(ARCH32)) || (defined(ARCH32) && defined(HAVE_SENSORS32))
return get_sensors_nr(SENSORS_FEATURE_IN);
#else
return 0;
#endif /* HAVE_SENSORS */
-
}
#define _(string) (string)
#endif
-#ifdef HAVE_SENSORS
+#if (defined(HAVE_SENSORS) && !defined(ARCH32)) || (defined(ARCH32) && defined(HAVE_SENSORS32))
#include "sensors/sensors.h"
#include "sensors/error.h"
#endif
ofile[0] = sa_dir[0] = comment[0] = '\0';
-#ifdef HAVE_SENSORS
+#if (defined(HAVE_SENSORS) && !defined(ARCH32)) || (defined(ARCH32) && defined(HAVE_SENSORS32))
/* Initialize sensors, let it use the default cfg file */
int err = sensors_init(NULL);
if (err) {
/* Main loop */
rw_sa_stat_loop(count, stdfd, ofd, ofile, sa_dir);
-#ifdef HAVE_SENSORS
+#if (defined(HAVE_SENSORS) && !defined(ARCH32)) || (defined(ARCH32) && defined(HAVE_SENSORS32))
/* Cleanup sensors */
sensors_cleanup();
#endif /* HAVE_SENSORS */