代码拉取完成,页面将自动刷新
# Only test the currently used features and
# display them.
FEATURE_TESTS ?= libelf lzma zlib btf-vmlinux cplus-demangle cxa-demangle libtcmalloc rpmalloc libunwind
FEATURE_DISPLAY := $(FEATURE_TESTS) demangle
FEATURE_GROUP_MEMBERS-libunwind = libunwind-x86 libunwind-x86_64 libunwind-arm libunwind-aarch64
FEATURE_GROUP_MEMBERS-demangle = cplus-demangle cxa-demangle
# Python embedding flags
ifndef NO_LIBPYTHON
PYTHON ?= python3
PYTHON_CONFIG ?= $(PYTHON)-config
PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG) --includes 2>/dev/null)
PYTHON_EMBED_LDOPTS := $(shell ($(PYTHON_CONFIG) --libs --embed &>/dev/null && $(PYTHON_CONFIG) --libs --embed 2>/dev/null) || $(PYTHON_CONFIG) --libs 2>/dev/null)
PYTHON_EMBED_LDFLAGS := $(shell ($(PYTHON_CONFIG) --ldflags --embed &>/dev/null && $(PYTHON_CONFIG) --ldflags --embed 2>/dev/null) || $(PYTHON_CONFIG) --ldflags 2>/dev/null)
# python-build-standalone support: add rpath and PYTHONHOME when PYTHON= is specified
ifeq ($(origin PYTHON),command line)
PYTHON_HOME ?= $(shell $(PYTHON_CONFIG) --prefix 2>/dev/null)
PYTHON_LIBDIR := $(PYTHON_HOME)/lib
ifneq ($(wildcard $(PYTHON_LIBDIR)/libpython3*.so),)
PYTHON_EMBED_LDFLAGS += -Wl,-rpath,$(PYTHON_LIBDIR)
endif
endif
FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS)
FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDFLAGS) $(PYTHON_EMBED_LDOPTS)
FEATURE_TESTS += libpython
FEATURE_DISPLAY += libpython
endif
# libunwind feature detection
ifndef NO_LIBUNWIND
ifeq ($(SRCARCH),x86)
ifeq ($(IS_64_BIT),1)
FEATURE_TESTS += libunwind-x86_64
FEATURE_CHECK_LDFLAGS-libunwind := -lunwind -lunwind-x86_64
FEATURE_CHECK_LDFLAGS-libunwind-x86_64 := -lunwind -lunwind-x86_64
else
FEATURE_TESTS += libunwind-x86
FEATURE_CHECK_LDFLAGS-libunwind := -lunwind -lunwind-x86
FEATURE_CHECK_LDFLAGS-libunwind-x86 := -lunwind -lunwind-x86 -lelf
endif
else ifeq ($(SRCARCH),arm64)
FEATURE_TESTS += libunwind-aarch64
FEATURE_CHECK_LDFLAGS-libunwind := -lunwind -lunwind-aarch64
FEATURE_CHECK_LDFLAGS-libunwind-aarch64 := -lunwind -lunwind-aarch64 -lelf
else ifeq ($(SRCARCH),arm)
FEATURE_TESTS += libunwind-arm
FEATURE_CHECK_LDFLAGS-libunwind := -lunwind -lunwind-arm
FEATURE_CHECK_LDFLAGS-libunwind-arm := -lunwind -lunwind-arm
endif
endif
include $(srctree)/build/Makefile.feature
$(shell printf "" > $(OUTPUT).config-detected)
detected = $(shell echo "$(1)=y" >> $(OUTPUT).config-detected)
detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
detected_override = $(shell echo "override $(1)=y" >> $(OUTPUT).config-detected)
################################
ifeq ($(feature-libelf), 1)
$(call detected,CONFIG_LIBELF)
else
$(error ERROR: No libelf found. Please install libelf-dev, libelf-devel, elfutils-libelf-devel.)
endif
ifeq ($(feature-lzma), 1)
override CFLAGS += -DHAVE_LZMA_SUPPORT
override CXXFLAGS += -DHAVE_LZMA_SUPPORT
$(call detected,CONFIG_LZMA)
else
$(warning No liblzma found, disables MiniDebugInfo decompression, please install xz-devel/liblzma-dev)
endif
ifeq ($(feature-zlib), 1)
$(call detected,CONFIG_ZLIB)
endif
ifeq ($(feature-btf-vmlinux), 1)
override CFLAGS += -DCONFIG_LIBBPF
# Overrides the make command line option
# `make CONFIG_LIBBPF=1`.
$(call detected_override,CONFIG_LIBBPF)
endif
ifeq ($(feature-cplus-demangle), 1)
override CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
override CXXFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
$(call detected,CONFIG_CPLUS_DEMANGLE)
else
ifeq ($(feature-cxa-demangle), 1)
override CFLAGS += -DHAVE_CXA_DEMANGLE_SUPPORT
override CXXFLAGS += -DHAVE_CXA_DEMANGLE_SUPPORT
$(call detected,CONFIG_CXX_DEMANGLE)
endif
endif
ifeq ($(feature-libtcmalloc), 1)
override CFLAGS += -DHAVE_LIBTCMALLOC
override CXXFLAGS += -DHAVE_LIBTCMALLOC
$(call detected,CONFIG_LIBTCMALLOC)
else ifeq ($(feature-rpmalloc), 1)
override CFLAGS += -DHAVE_RPMALLOC
override CXXFLAGS += -DHAVE_RPMALLOC
$(call detected,CONFIG_RPMALLOC)
endif
ifndef NO_LIBPYTHON
ifeq ($(feature-libpython), 1)
override CFLAGS += -DHAVE_LIBPYTHON
override CFLAGS += $(PYTHON_EMBED_CCOPTS)
$(call detected,CONFIG_LIBPYTHON)
$(call detected_var,PYTHON_EMBED_LDOPTS)
$(call detected_var,PYTHON_EMBED_LDFLAGS)
ifneq ($(PYTHON_HOME),)
$(call detected_var,PYTHON_HOME)
endif
else
$(warning No libpython found, disables Python profiler, please install python3-devel/python3-dev)
endif
else
$(warning Disabling Python profiler per NO_LIBPYTHON=1)
endif
ifndef NO_LIBUNWIND
ifeq ($(feature-libunwind), 1)
# Determine arch-specific libunwind library
ifeq ($(SRCARCH),x86)
ifeq ($(IS_64_BIT),1)
ifeq ($(feature-libunwind-x86_64), 1)
LIBUNWIND_ARCH := x86_64
endif
else
ifeq ($(feature-libunwind-x86), 1)
LIBUNWIND_ARCH := x86
endif
endif
else ifeq ($(SRCARCH),arm64)
ifeq ($(feature-libunwind-aarch64), 1)
LIBUNWIND_ARCH := aarch64
endif
else ifeq ($(SRCARCH),arm)
ifeq ($(feature-libunwind-arm), 1)
LIBUNWIND_ARCH := arm
endif
endif
ifneq ($(LIBUNWIND_ARCH),)
override CFLAGS += -DHAVE_LIBUNWIND
$(call detected,CONFIG_LIBUNWIND)
$(call detected_var,LIBUNWIND_ARCH)
else
$(warning libunwind found but arch-specific library missing, disables DWARF unwind)
endif
else
$(warning No libunwind found, disables DWARF unwind, please install libunwind-devel/libunwind-dev)
endif
endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。