From: Marc Fournier Date: Fri, 1 May 2015 18:40:59 +0000 (+0200) Subject: Turbostat: confine AC_COMPILE_IFELSE() inside a AC_CACHE_CHECK block X-Git-Tag: collectd-5.5.0~24^2~4 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=dfe9bb8c5c2f2baaa9c2be9ceddf61248b5effb7;p=collectd.git Turbostat: confine AC_COMPILE_IFELSE() inside a AC_CACHE_CHECK block The previous way of doing worked as expected, but didn't print out anything in the summary, making it difficult to know why the plugin wasn't built on older systems. --- diff --git a/configure.ac b/configure.ac index 2ef82ee1..90420f8d 100644 --- a/configure.ac +++ b/configure.ac @@ -593,10 +593,23 @@ AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"]) have_asm_msrindex_h="no" AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"]) -have_usable_asm_msrindex_h="no" if test "x$have_asm_msrindex_h" = "xyes" then - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include]],[[int y = MSR_CORE_C3_RESIDENCY;]])], [have_usable_asm_msrindex_h="yes"]) + AC_CACHE_CHECK([whether asm/msr-index.h has MSR_CORE_C3_RESIDENCY], + [c_cv_have_usable_asm_msrindex_h], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[[ +#include +]]], +[[[ +int y = MSR_CORE_C3_RESIDENCY; +return(y); +]]] + )], + [c_cv_have_usable_asm_msrindex_h="yes"], + [c_cv_have_usable_asm_msrindex_h="no"], + ) + ) fi have_cpuid_h="no" @@ -5199,7 +5212,7 @@ then then plugin_ipvs="yes" fi - if test "x$have_usable_asm_msrindex_h" = "xyes" && test "x$have_cpuid_h" = "xyes" + if test "x$c_cv_have_usable_asm_msrindex_h" = "xyes" && test "x$have_cpuid_h" = "xyes" then plugin_turbostat="yes" fi