@cryptotaxi247 / netdata-1 / commits / 4ed573ca5

Don't check for ebpf dependencies if ebpf is disabled. (#10034)

Tomáš Kopal committed Oct 20, 2020 at 17:44 UTC 4ed573ca506bd7f59c74eba72aaeb3047a7b9a72
1 file changed +29 -27
configure.ac
+29 -27
@@ -989,36 +989,38 @@ AM_CONDITIONAL([ENABLE_PLUGIN_PERF], [test "${enable_plugin_perf}" = "yes"])
989 # -----------------------------------------------------------------------------
990 # ebpf.plugin
991
992 -PKG_CHECK_MODULES(
993 - [LIBELF],
994 - [libelf],
995 - [have_libelf=yes],
996 - [have_libelf=no]
997 -)
992 +if test "${build_target}" = "linux" -a "${enable_ebpf}" != "no"; then
993 + PKG_CHECK_MODULES(
994 + [LIBELF],
995 + [libelf],
996 + [have_libelf=yes],
997 + [have_libelf=no]
998 + )
999
999 -AC_CHECK_TYPE(
1000 - [struct bpf_prog_info],
1001 - [have_bpf=yes],
1002 - [have_bpf=no],
1003 - [#include <linux/bpf.h>]
1004 -)
1000 + AC_CHECK_TYPE(
1001 + [struct bpf_prog_info],
1002 + [have_bpf=yes],
1003 + [have_bpf=no],
1004 + [#include <linux/bpf.h>]
1005 + )
1006
1006 -AC_CHECK_FILE(
1007 - externaldeps/libbpf/libbpf.a,
1008 - [have_libbpf=yes],
1009 - [have_libbpf=no]
1010 -)
1007 + AC_CHECK_FILE(
1008 + externaldeps/libbpf/libbpf.a,
1009 + [have_libbpf=yes],
1010 + [have_libbpf=no]
1011 + )
1012
1012 -AC_MSG_CHECKING([if ebpf.plugin should be enabled])
1013 -if test "${build_target}" = "linux" -a \
1014 - "${enable_ebpf}" != "no" -a \
1015 - "${have_libelf}" = "yes" -a \
1016 - "${have_bpf}" = "yes" -a \
1017 - "${have_libbpf}" = "yes"; then
1018 - OPTIONAL_BPF_CFLAGS="${LIBELF_CFLAGS} -I externaldeps/libbpf/include"
1019 - OPTIONAL_BPF_LIBS="externaldeps/libbpf/libbpf.a ${LIBELF_LIBS}"
1020 - AC_DEFINE([HAVE_LIBBPF], [1], [libbpf usability])
1021 - enable_ebpf="yes"
1013 + AC_MSG_CHECKING([if ebpf.plugin should be enabled])
1014 + if test "${have_libelf}" = "yes" -a \
1015 + "${have_bpf}" = "yes" -a \
1016 + "${have_libbpf}" = "yes"; then
1017 + OPTIONAL_BPF_CFLAGS="${LIBELF_CFLAGS} -I externaldeps/libbpf/include"
1018 + OPTIONAL_BPF_LIBS="externaldeps/libbpf/libbpf.a ${LIBELF_LIBS}"
1019 + AC_DEFINE([HAVE_LIBBPF], [1], [libbpf usability])
1020 + enable_ebpf="yes"
1021 + else
1022 + enable_ebpf="no"
1023 + fi
1024 else
1025 enable_ebpf="no"
1026 fi