diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-01-29 09:28:58 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-17 15:30:15 -0200 |
commit | c55c8c231613c4d014601ba54e706bcf3ffd5c45 (patch) | |
tree | a2665950d0c0e9af277fb6cd6a28a8f0f7ac86d8 | |
parent | eb8ca9be84851ecc6b53be5fd4ec7fafbaf68d24 (diff) |
configure.ac: add --enable-perfcounters
-rw-r--r-- | configure.ac | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 44595050..9bc94f7f 100644 --- a/configure.ac +++ b/configure.ac @@ -256,6 +256,50 @@ then AC_DEFINE(HAVE_SETUID_ENABLED, 1, [Define if setuid support should be enabled.]) fi +AC_ARG_ENABLE(perfcounters, [AS_HELP_STRING([--enable-perfcounters], [enable hardware performance counters])],, enable_perfcounters="yes") +if test "x$enable_perfcounters_$my_htop_platform" = xyes_linux +then + AC_CHECK_HEADERS([linux/perf_counter.h], [have_perf_counter=yes], + [have_perf_counter=no]) + + AC_CHECK_HEADERS([linux/perf_event.h], [have_perf_event=yes], + [have_perf_event=no]) + + if test "x${have_perf_counter}" = xno -a "x${have_perf_event}" = xno; then + os=`uname -s -r` + AC_MSG_FAILURE([ + ------------------------------------------------------------ + Could not locate linux/perf_count.h or linux/perf_event.h. + Are performance counters supported on this machine? + Linux 2.6.31+ is required. + uname reports: ${os} + ------------------------------------------------------------]) + fi + + # Check for hardware architecture + no_target=yes + AC_MSG_CHECKING([hardware]) + hw=`uname -m` + case $hw in + x86_64 | i386 | i686 ) : + AC_MSG_RESULT([x86]) + AC_DEFINE([TARGET_X86], [1], [Define to 1 if the target is x86.]) + no_target=no + ;; + unknown ) : + AC_MSG_RESULT([unknown]) + AC_MSG_WARN([Could not detect architecture]) + ;; + * ) : + AC_MSG_RESULT([$hw]) + ;; + esac + + if test x$no_target = xyes; then + AC_DEFINE([NOTARGET], [1], [Define to 1 when no specific target is supported.]) + fi +fi + AC_ARG_ENABLE(delayacct, [AS_HELP_STRING([--enable-delayacct], [enable linux delay accounting])],, enable_delayacct="no") if test "x$enable_delayacct" = xyes then |