]> granicus.if.org Git - sysstat/commitdiff
configure: Don't check for sensors library if --disable-sensors used
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 23 Feb 2019 09:01:34 +0000 (10:01 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 23 Feb 2019 09:01:34 +0000 (10:01 +0100)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
configure
configure.in

index 6585fd9dfdaa6c0c8590a9ef29d908f5df257ccf..74a06358beedc41bc6f4cee7a37c32b8f89a73bd 100755 (executable)
--- a/configure
+++ b/configure
@@ -4643,18 +4643,19 @@ else
 fi
 
 if test $SENSORS != "yes"; then
-   HAVE_SENSORS="n"
+       HAVE_SENSORS="n"
 else
-   HAVE_SENSORS="y"
+       HAVE_SENSORS="y"
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SENSORS" >&5
 $as_echo "$SENSORS" >&6; }
 
 # Check for lm_sensors
-SENSORS=no
 LFSENSORS=""
 DFSENSORS=""
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sensors_get_detected_chips in -lsensors" >&5
+if test $HAVE_SENSORS = "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; }
 if ${ac_cv_lib_sensors_sensors_get_detected_chips+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -4696,12 +4697,12 @@ else
   HAVE_SENSORS="n"
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sensors lib" >&5
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sensors lib" >&5
 $as_echo_n "checking for sensors lib... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sensors/sensors.h>
-#include <sensors/error.h>
+                      #include <sensors/error.h>
 
 int
 main ()
@@ -4717,8 +4718,9 @@ else
   HAVE_SENSORS="n"; SENSORS=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SENSORS" >&5
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SENSORS" >&5
 $as_echo "$SENSORS" >&6; }
+fi
 
 
 
index f476f5429d34e72fe8705c938c63283a3851ead2..dafd057e4303b1a9937b217d703fa69b5988b4e7 100644 (file)
@@ -102,22 +102,24 @@ AC_ARG_ENABLE(sensors,
                             [disable sensors support]),
                             SENSORS=$enableval,SENSORS=yes)
 if test $SENSORS != "yes"; then
-   HAVE_SENSORS="n"
+       HAVE_SENSORS="n"
 else
-   HAVE_SENSORS="y"
+       HAVE_SENSORS="y"
 fi
 AC_MSG_RESULT($SENSORS)
 
 # Check for lm_sensors
-SENSORS=no
 LFSENSORS=""
 DFSENSORS=""
-AC_CHECK_LIB(sensors, sensors_get_detected_chips, LFSENSORS="-lsensors", HAVE_SENSORS="n")
-AC_MSG_CHECKING(for sensors lib)
-AC_TRY_COMPILE(#include <sensors/sensors.h>
-#include <sensors/error.h>
-               , sensors_cleanup();,SENSORS=yes; DFSENSORS="-DHAVE_SENSORS", HAVE_SENSORS="n"; SENSORS=no)
-AC_MSG_RESULT($SENSORS)
+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_TRY_COMPILE(#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)