|
53 | 53 | $(info Please install libcpupower-dev/kernel-tools-libs-devel)
|
54 | 54 | endif
|
55 | 55 |
|
| 56 | +ifndef BUILD_BPF_SKEL |
| 57 | + # BPF skeletons are used to implement improved sample collection, enable |
| 58 | + # them by default. |
| 59 | + BUILD_BPF_SKEL := 1 |
| 60 | +endif |
| 61 | + |
| 62 | +ifeq ($(BUILD_BPF_SKEL),0) |
| 63 | + $(info BPF skeleton support disabled, building without BPF skeleton support.) |
| 64 | +endif |
| 65 | + |
| 66 | +$(call feature_check,libbpf) |
| 67 | +ifeq ($(feature-libbpf), 1) |
| 68 | + $(call detected,CONFIG_LIBBPF) |
| 69 | +else |
| 70 | + $(info libbpf is missing, building without BPF skeleton support.) |
| 71 | + $(info Please install libbpf-dev/libbpf-devel) |
| 72 | + BUILD_BPF_SKEL := 0 |
| 73 | +endif |
| 74 | + |
| 75 | +$(call feature_check,clang-bpf-co-re) |
| 76 | +ifeq ($(feature-clang-bpf-co-re), 1) |
| 77 | + $(call detected,CONFIG_CLANG_BPF_CO_RE) |
| 78 | +else |
| 79 | + $(info clang is missing or does not support BPF CO-RE, building without BPF skeleton support.) |
| 80 | + $(info Please install clang) |
| 81 | + BUILD_BPF_SKEL := 0 |
| 82 | +endif |
| 83 | + |
| 84 | +$(call feature_check,bpftool-skeletons) |
| 85 | +ifeq ($(feature-bpftool-skeletons), 1) |
| 86 | + $(call detected,CONFIG_BPFTOOL_SKELETONS) |
| 87 | +else |
| 88 | + $(info bpftool is missing or not supporting skeletons, building without BPF skeleton support.) |
| 89 | + $(info Please install bpftool) |
| 90 | + BUILD_BPF_SKEL := 0 |
| 91 | +endif |
| 92 | + |
| 93 | +ifeq ($(BUILD_BPF_SKEL),1) |
| 94 | + CFLAGS += -DHAVE_BPF_SKEL |
| 95 | + EXTLIBS += -lbpf |
| 96 | +endif |
| 97 | + |
56 | 98 | ifeq ($(STOP_ERROR),1)
|
57 | 99 | $(error Please, check the errors above.)
|
58 | 100 | endif
|
0 commit comments