1# SPDX-License-Identifier: GPL-2.0-only 2 3include $(srctree)/tools/scripts/utilities.mak 4 5STOP_ERROR := 6 7ifndef ($(NO_LIBTRACEEVENT),1) 8 ifeq ($(call get-executable,$(PKG_CONFIG)),) 9 $(error Error: $(PKG_CONFIG) needed by libtraceevent/libtracefs is missing on this system, please install it) 10 endif 11endif 12 13define lib_setup 14 $(eval LIB_INCLUDES += $(shell sh -c "$(PKG_CONFIG) --cflags lib$(1)")) 15 $(eval LDFLAGS += $(shell sh -c "$(PKG_CONFIG) --libs-only-L lib$(1)")) 16 $(eval EXTLIBS += $(shell sh -c "$(PKG_CONFIG) --libs-only-l lib$(1)")) 17endef 18 19$(call feature_check,libtraceevent) 20ifeq ($(feature-libtraceevent), 1) 21 $(call detected,CONFIG_LIBTRACEEVENT) 22 $(call lib_setup,traceevent) 23else 24 STOP_ERROR := 1 25 $(info libtraceevent is missing. Please install libtraceevent-dev/libtraceevent-devel) 26endif 27 28$(call feature_check,libtracefs) 29ifeq ($(feature-libtracefs), 1) 30 $(call detected,CONFIG_LIBTRACEFS) 31 $(call lib_setup,tracefs) 32else 33 STOP_ERROR := 1 34 $(info libtracefs is missing. Please install libtracefs-dev/libtracefs-devel) 35endif 36 37ifeq ($(STOP_ERROR),1) 38 $(error Please, check the errors above.) 39endif 40