]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
gpu_sysman: use glob.h/libgen.h only if they are present 4293/head
authorEero Tamminen <eero.t.tamminen@intel.com>
Thu, 14 Mar 2024 14:39:52 +0000 (16:39 +0200)
committerEero Tamminen <eero.t.tamminen@intel.com>
Tue, 19 Mar 2024 15:33:47 +0000 (17:33 +0200)
Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
configure.ac
src/gpu_sysman.c

index 6d42a798bfc8c3d86b3a9fdbe4b036568523febb..65eafd5ebe3b91bb95080bdc04a9262afedfd702 100644 (file)
@@ -163,6 +163,7 @@ AC_CHECK_HEADERS_ONCE([ \
   fs_info.h \
   fshelp.h \
   grp.h \
+  glob.h \
   kstat.h \
   kvm.h \
   libgen.h \
index 3dff3bd6a93d1bb96c490ed605868e02841ec994..eaacb5685d40fe6398b207e9425613c71263f852 100644 (file)
 #include <stdlib.h>
 #include <time.h>
 
-#include <level_zero/ze_api.h>
 #include <level_zero/zes_api.h>
 
+/* 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 <glob.h>
 #include <libgen.h>
+#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"