packages/admin/netdata/patches/007-dont-check-for-ebpf-dependencies-when-it-is-disabled.patch
Josef Schlehofer 5ba339b49a
netdata: update to version 1.26.0
Disable ebpf plugin as in OpenWrt there is no package libbpf.
- With that, I need to introduce patch, which is not merged into netdata,
yet. Without it, I still got during cross-compilation this error:
checking for externaldeps/libbpf/libbpf.a... configure: error: cannot check for file existence when cross compiling

- And yes, the flag was there.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2020-10-16 17:14:06 +02:00

79 lines
2.4 KiB
Diff

From bb405e3c274ca8860c974a720071d346b16c8462 Mon Sep 17 00:00:00 2001
From: Tomas Kopal <Tomas.Kopal@eccam.com>
Date: Tue, 6 Oct 2020 13:38:08 +0200
Subject: [PATCH] Don't check for ebpf dependencies if ebpf is disabled.
---
configure.ac | 56 +++++++++++++++++++++++++++-------------------------
1 file changed, 29 insertions(+), 27 deletions(-)
diff --git a/configure.ac b/configure.ac
index 57f6c0b1cb3a..5f13b4feb0d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -989,36 +989,38 @@ AM_CONDITIONAL([ENABLE_PLUGIN_PERF], [test "${enable_plugin_perf}" = "yes"])
# -----------------------------------------------------------------------------
# ebpf.plugin
-PKG_CHECK_MODULES(
- [LIBELF],
- [libelf],
- [have_libelf=yes],
- [have_libelf=no]
-)
+if test "${build_target}" = "linux" -a "${enable_ebpf}" != "no"; then
+ PKG_CHECK_MODULES(
+ [LIBELF],
+ [libelf],
+ [have_libelf=yes],
+ [have_libelf=no]
+ )
-AC_CHECK_TYPE(
- [struct bpf_prog_info],
- [have_bpf=yes],
- [have_bpf=no],
- [#include <linux/bpf.h>]
-)
+ AC_CHECK_TYPE(
+ [struct bpf_prog_info],
+ [have_bpf=yes],
+ [have_bpf=no],
+ [#include <linux/bpf.h>]
+ )
-AC_CHECK_FILE(
- externaldeps/libbpf/libbpf.a,
- [have_libbpf=yes],
- [have_libbpf=no]
-)
+ AC_CHECK_FILE(
+ externaldeps/libbpf/libbpf.a,
+ [have_libbpf=yes],
+ [have_libbpf=no]
+ )
-AC_MSG_CHECKING([if ebpf.plugin should be enabled])
-if test "${build_target}" = "linux" -a \
- "${enable_ebpf}" != "no" -a \
- "${have_libelf}" = "yes" -a \
- "${have_bpf}" = "yes" -a \
- "${have_libbpf}" = "yes"; then
- OPTIONAL_BPF_CFLAGS="${LIBELF_CFLAGS} -I externaldeps/libbpf/include"
- OPTIONAL_BPF_LIBS="externaldeps/libbpf/libbpf.a ${LIBELF_LIBS}"
- AC_DEFINE([HAVE_LIBBPF], [1], [libbpf usability])
- enable_ebpf="yes"
+ AC_MSG_CHECKING([if ebpf.plugin should be enabled])
+ if test "${have_libelf}" = "yes" -a \
+ "${have_bpf}" = "yes" -a \
+ "${have_libbpf}" = "yes"; then
+ OPTIONAL_BPF_CFLAGS="${LIBELF_CFLAGS} -I externaldeps/libbpf/include"
+ OPTIONAL_BPF_LIBS="externaldeps/libbpf/libbpf.a ${LIBELF_LIBS}"
+ AC_DEFINE([HAVE_LIBBPF], [1], [libbpf usability])
+ enable_ebpf="yes"
+ else
+ enable_ebpf="no"
+ fi
else
enable_ebpf="no"
fi