xdp-tools: don't rely on host bpf headers
authorDaniel Golle <daniel@makrotopia.org>
Mon, 12 Sep 2022 00:13:59 +0000 (01:13 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 12 Sep 2022 00:43:49 +0000 (01:43 +0100)
xdp-tools build currently breaks on build hosts which do not have
libbpf headers installed because the build system wrongly tries to
use the host's include path.
Properly pass path to libbpf headers to xdp-tools build system to
fix build e.g. on the buildbots.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
package/network/utils/xdp-tools/Makefile

index 32f302543a1de85171cd0c0a8a49638240da62cc..42a8a0695b0ee28dcfde20b98ddc4eda2abfd826 100644 (file)
@@ -85,7 +85,6 @@ CONFIGURE_VARS += \
        CFLAGS="$(TARGET_CFLAGS)" \
        LDFLAGS="$(TARGET_LDFLAGS)" \
        CLANG="$(CLANG)" \
-       BPF_CFLAGS="$(BPF_CFLAGS)" \
        BPF_TARGET="$(BPF_TARGET)" \
        LLC="$(LLVM_LLC)"
 
@@ -93,6 +92,11 @@ MAKE_VARS += \
        PREFIX=/usr \
        RUNDIR=/tmp/run
 
+define Build/Configure
+       $(call Build/Configure/Default)
+       echo "BPF_CFLAGS += -I$(BPF_HEADERS_DIR)/tools/lib" >> $(PKG_BUILD_DIR)/config.mk
+endef
+
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include/xdp
        $(CP) $(PKG_INSTALL_DIR)/usr/include/xdp/*.h $(1)/usr/include/xdp/