diff options
Diffstat (limited to 'package/network/utils/bpftools/Makefile')
-rw-r--r-- | package/network/utils/bpftools/Makefile | 72 |
1 files changed, 26 insertions, 46 deletions
diff --git a/package/network/utils/bpftools/Makefile b/package/network/utils/bpftools/Makefile index f044cc81f8..406481d784 100644 --- a/package/network/utils/bpftools/Makefile +++ b/package/network/utils/bpftools/Makefile @@ -8,12 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bpftools -PKG_VERSION:=5.11.16 PKG_RELEASE:=1 -PKG_SOURCE:=linux-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=@KERNEL/linux/kernel/v5.x -PKG_HASH:=21163681d130cbce5a6be39019e2c69e44f284855ddd70b1a3bd039249540f43 +PKG_SOURCE_URL:=https://github.com/libbpf/bpftool +PKG_SOURCE_PROTO:=git +PKG_SOURCE_DATE:=2022-03-08 +PKG_SOURCE_VERSION:=04c465fd1f561f67796dc68bbfe1aa7cfa956c3c +PKG_MIRROR_HASH:=e22a954cd186f43228a96586bbdc120b11e6c87360ab88ae96ba37afb9c7cb58 +PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com> @@ -21,16 +23,6 @@ PKG_USE_MIPS16:=0 PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 -LINUX_VERSION:=$(PKG_VERSION) -LINUX_TLD:=linux-$(LINUX_VERSION) - -BPF_FILES:= \ - kernel/bpf scripts tools/Makefile tools/bpf tools/perf/perf-sys.h \ - tools/arch tools/build tools/include tools/lib tools/scripts -TAR_OPTIONS+= \ - --transform="s;$(LINUX_TLD)/;$(PKG_NAME)-$(PKG_VERSION)/;" \ - $(addprefix $(LINUX_TLD)/,$(BPF_FILES)) - include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/nls.mk @@ -77,7 +69,7 @@ define Package/libbpf TITLE:=libbpf - eBPF helper library VARIANT:=lib LICENSE:=LGPL-2.1 OR BSD-2-Clause - ABI_VERSION:=0 + ABI_VERSION:=$(PKG_ABI_VERSION) URL:=http://www.kernel.org DEPENDS:=+libelf endef @@ -93,47 +85,35 @@ ifneq ($(BUILD_VARIANT),lib) TARGET_LDFLAGS += -Wl,--gc-sections endif +ifeq ($(BUILD_VARIANT),full) + full:=1 +else + full:=0 +endif + MAKE_VARS = \ EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" MAKE_FLAGS += \ - BPFTOOL_VERSION="$(LINUX_VERSION)" \ - FEATURES_DUMP="$(PKG_BUILD_DIR)/FEATURE-DUMP.openwrt" \ OUTPUT="$(PKG_BUILD_DIR)/" \ prefix="/usr" \ - $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') + $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \ + LIBSUBDIR=lib \ + check_feat=0 \ + feature-clang-bpf-co-re=0 \ + feature-reallocarray=1 \ + feature-zlib=1 \ + feature-libbfd=$(full) \ + feature-libcap=0 \ + feature-disassembler-four-args=$(full) -ifeq ($(BUILD_VARIANT),full) - HAVE_LIBBFD:=1 - HAVE_LIBCAP:=0 - HAVE_CLANG:=0 - MAKE_PATH:=tools/bpf/bpftool -else ifeq ($(BUILD_VARIANT),minimal) - HAVE_LIBBFD:=0 - HAVE_LIBCAP:=0 - HAVE_CLANG:=0 - MAKE_PATH:=tools/bpf/bpftool -else ifeq ($(BUILD_VARIANT),lib) - HAVE_LIBBFD:=0 - HAVE_LIBCAP:=0 - HAVE_CLANG:=0 - MAKE_PATH:=tools/lib/bpf +ifeq ($(BUILD_VARIANT),lib) + MAKE_PATH = libbpf/src +else + MAKE_PATH = src endif -# Perform a "throw-away" make to create a FEATURE-DUMP.* file to edit later. -# The "//" in the make target is actually needed, very unPOSIXly. -define Build/Configure - +$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/tools/bpf/bpftool \ - $(MAKE_FLAGS) FEATURES_DUMP= $(PKG_BUILD_DIR)//libbpf/libbpf.a - (cd $(PKG_BUILD_DIR); cat FEATURE-DUMP.bpftool libbpf/FEATURE-DUMP.libbpf \ - | sort | uniq > FEATURE-DUMP.openwrt) - $(SED) 's/feature-libbfd=1/feature-libbfd=$(HAVE_LIBBFD)/' \ - -e 's/feature-libcap=1/feature-libcap=$(HAVE_LIBCAP)/' \ - -e 's/feature-clang-bpf-co-re=1/feature-clang-bpf-co-re=$(HAVE_CLANG)/' \ - $(PKG_BUILD_DIR)/FEATURE-DUMP.openwrt -endef - define Build/InstallDev/libbpf $(INSTALL_DIR) $(1)/usr/include/bpf $(CP) $(PKG_INSTALL_DIR)/usr/include/bpf/*.h $(1)/usr/include/bpf/ |