Separate display from sampling in SysArch and Hostname Meters

Several of our newer meters have merged coding concerns in terms
of extracting values and displaying those values.  This commit
rectifies that for the SysArch and Hostname meters, allowing use
of this code with alternative front/back ends.  The SysArch code
is also refined to detect whether the platform has an os-release
file at all and/or the sys/utsname.h header via configure.ac.
This commit is contained in:
Nathan Scott
2021-03-02 15:58:11 +11:00
parent 2328e52403
commit 5b50ae3aa3
14 changed files with 210 additions and 77 deletions

View File

@ -108,6 +108,7 @@ AC_CHECK_HEADERS([ \
strings.h \
sys/param.h \
sys/time.h \
sys/utsname.h \
unistd.h
], [], [AC_MSG_ERROR([can not find required generic header files])])
@ -316,6 +317,18 @@ case "$enable_hwloc" in
;;
esac
AC_ARG_WITH([os-release],
[AS_HELP_STRING([--with-os-release=FILE],
[location of an os-release file @<:@default=/etc/os-release@:>@])],
[],
[with_os_release=/etc/os-release])
if test -n "$with_os_release" -a ! -f "$with_os_release"; then
if test -f "/usr/lib/os-release"; then
with_os_release="/usr/lib/os-release"
fi
fi
AC_DEFINE_UNQUOTED([OSRELEASEFILE], ["$with_os_release"], [File with OS release details.])
# ----------------------------------------------------------------------
@ -608,6 +621,7 @@ AC_MSG_RESULT([
${PACKAGE_NAME} ${VERSION}
platform: $my_htop_platform
os-release file: $with_os_release
(Linux) proc directory: $with_proc
(Linux) openvz: $enable_openvz
(Linux) vserver: $enable_vserver