From: Michael Tremer Date: Thu, 23 Oct 2025 13:38:44 +0000 (+0000) Subject: configure: Fix detection for libsensors X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7351663e559764d38903ae21bdc689aeaea13779;p=telemetry.git configure: Fix detection for libsensors Signed-off-by: Michael Tremer --- diff --git a/configure.ac b/configure.ac index 2a0ae0a..6a02140 100644 --- a/configure.ac +++ b/configure.ac @@ -163,9 +163,15 @@ save_LIBS="$LIBS" # lm-sensors AC_CHECK_HEADERS([sensors/sensors.h sensors/errors.h]) -LIBS= -AC_CHECK_LIB(sensors, sensors_init, [have_sensors=yes], [have_sensors=no]) -SENSORS_LIBS="$LIBS" +LIBS="-lm" +AC_CHECK_LIB([sensors], [sensors_init], + [have_sensors=yes; SENSORS_LIBS="-lsensors ${LIBS}"], + [have_sensors=no; SENSORS_LIBS=""]) + +if test "x$have_sensors" = "xyes"; then + AC_DEFINE([HAVE_SENSORS], [1], [Define if you have libsensors]) +fi + AC_SUBST(SENSORS_LIBS) LIBS="$save_LIBS"