tools build: Pass libbpf feature only if libbpf 1.0+
[linux-2.6-block.git] / tools / build / feature / test-libbpf.c
index a508756cf4cca2b3a781a43787d27ca092c410c3..cd9989f521195cba0b8abd2bf3bf9f5a5dbe27ca 100644 (file)
@@ -1,6 +1,10 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <bpf/libbpf.h>
 
+#if !defined(LIBBPF_MAJOR_VERSION) || (LIBBPF_MAJOR_VERSION < 1)
+#error At least libbpf 1.0 is required for Linux tools.
+#endif
+
 int main(void)
 {
        return bpf_object__open("test") ? 0 : -1;