kumquat-buildroot/package/libbpf/libbpf.mk
James Hilliard 4b1003855b package/libbpf: bump to version 0.7.0
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-03-10 22:26:02 +01:00

42 lines
1.4 KiB
Makefile

################################################################################
#
# libbpf
#
################################################################################
LIBBPF_VERSION = 0.7.0
LIBBPF_SITE = $(call github,libbpf,libbpf,v$(LIBBPF_VERSION))
LIBBPF_LICENSE = GPL-2.0, LGPL-2.1, BSD-2-Clause
LIBBPF_LICENSE_FILES = LICENSE LICENSE.BSD-2-Clause LICENSE.LGPL-2.1
LIBBPF_CPE_ID_VENDOR = libbpf_project
LIBBPF_DEPENDENCIES = host-bison host-flex host-pkgconf elfutils zlib
LIBBPF_INSTALL_STAGING = YES
define LIBBPF_BUILD_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \
-C $(@D)/src
endef
# bpf/bpf.h installed by libbpf uses bpf_iter_link_info that was added since
# kernel 5.9, so we need to update some uapi headers in STAGING_DIR if the
# toolchain is build with linux-headers < 5.9.
# Otherwise bpf/bpf.h is broken due to out of date linux/bpf.h installed by the
# toolchain.
# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a5cbe05a6673b85bed2a63ffcfea6a96c6410cff
ifeq ($(BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_9),)
LIBBPF_UPDATE_UAPI_HEADERS = install_uapi_headers
endif
define LIBBPF_INSTALL_STAGING_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \
-C $(@D)/src install $(LIBBPF_UPDATE_UAPI_HEADERS) \
DESTDIR=$(STAGING_DIR)
endef
define LIBBPF_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \
-C $(@D)/src install DESTDIR=$(TARGET_DIR)
endef
$(eval $(generic-package))