Makefile.config 1.1 KB

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