From: Eero Tamminen Date: Thu, 14 Mar 2024 14:39:52 +0000 (+0200) Subject: gpu_sysman: use glob.h/libgen.h only if they are present X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F4293%2Fhead;p=thirdparty%2Fcollectd.git gpu_sysman: use glob.h/libgen.h only if they are present Signed-off-by: Eero Tamminen --- diff --git a/configure.ac b/configure.ac index 6d42a798b..65eafd5eb 100644 --- a/configure.ac +++ b/configure.ac @@ -163,6 +163,7 @@ AC_CHECK_HEADERS_ONCE([ \ fs_info.h \ fshelp.h \ grp.h \ + glob.h \ kstat.h \ kvm.h \ libgen.h \ diff --git a/src/gpu_sysman.c b/src/gpu_sysman.c index 3dff3bd6a..eaacb5685 100644 --- a/src/gpu_sysman.c +++ b/src/gpu_sysman.c @@ -42,21 +42,24 @@ #include #include -#include #include +/* includes config.h with HAVE_*_H defines, needed by check below */ +#include "collectd.h" + +#if HAVE_GLOB_H && HAVE_LIBGEN_H /* "dev_file" label (for k8s Intel GPU plugin) and "pci_dev" label * (for k8s Intel resource driver) need (POSIX.1-2001/-2008) * glob() + basename() functions. */ #define ADD_DEV_FILE 1 -#if ADD_DEV_FILE #include #include +#else +#pragma message \ + "glob / libgen headers missing => no 'dev_file' / 'pci_dev' labels" #endif -#include "collectd.h" -/* comment avoiding local clang-format conflict with collectd CI one */ #include "plugin.h" #include "utils/common/common.h"