1# SPDX-License-Identifier: GPL-2.0-only 2 3STOP_ERROR := 4 5LIBTRACEEVENT_MIN_VERSION = 1.5 6LIBTRACEFS_MIN_VERSION = 1.6 7 8define lib_setup 9 $(eval LIB_INCLUDES += $(shell sh -c "$(PKG_CONFIG) --cflags lib$(1)")) 10 $(eval EXTLIBS += -l$(1)) 11endef 12 13$(call feature_check,libtraceevent) 14ifeq ($(feature-libtraceevent), 1) 15 $(call detected,CONFIG_LIBTRACEEVENT) 16 17 TEST = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEEVENT_MIN_VERSION) libtraceevent > /dev/null 2>&1 && echo y || echo n") 18 ifeq ($(TEST),n) 19 $(info libtraceevent version is too low, it must be at least $(LIBTRACEEVENT_MIN_VERSION)) 20 STOP_ERROR := 1 21 endif 22 23 $(call lib_setup,traceevent) 24else 25 STOP_ERROR := 1 26 $(info libtraceevent is missing. Please install libtraceevent-dev/libtraceevent-devel) 27endif 28 29$(call feature_check,libtracefs) 30ifeq ($(feature-libtracefs), 1) 31 $(call detected,CONFIG_LIBTRACEFS) 32 33 TEST = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEFS_MIN_VERSION) libtracefs > /dev/null 2>&1 && echo y || echo n") 34 ifeq ($(TEST),n) 35 $(info libtracefs version is too low, it must be at least $(LIBTRACEFS_MIN_VERSION)) 36 STOP_ERROR := 1 37 endif 38 39 $(call lib_setup,tracefs) 40else 41 STOP_ERROR := 1 42 $(info libtracefs is missing. Please install libtracefs-dev/libtracefs-devel) 43endif 44 45ifeq ($(STOP_ERROR),1) 46 $(error Please, check the errors above.) 47endif 48