arch.mk.xtensa 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. ################################################################################
  2. # This variable can be used by packages that need to extract the overlay.
  3. #
  4. # ARCH_XTENSA_OVERLAY_FILE is the path to the overlay tarball; empty if not
  5. # using any overlay
  6. #
  7. # Example:
  8. # ifneq ($(ARCH_XTENSA_OVERLAY_FILE),)
  9. # tar xf $(ARCH_XTENSA_OVERLAY_FILE) -C $(@D) --strip-components=1 gcc
  10. # endif
  11. ################################################################################
  12. BR_ARCH_XTENSA_OVERLAY_FILE = $(call qstrip,$(BR2_XTENSA_OVERLAY_FILE))
  13. ifneq ($(filter http://% https://% ftp://% scp://%,$(BR_ARCH_XTENSA_OVERLAY_FILE)),)
  14. ARCH_XTENSA_OVERLAY_URL = $(BR_ARCH_XTENSA_OVERLAY_FILE)
  15. ARCH_XTENSA_OVERLAY_FILE = $($(PKG)_DL_DIR)/$(notdir $(BR_ARCH_XTENSA_OVERLAY_FILE))
  16. # Do not check that file, we can't know its hash
  17. BR_NO_CHECK_HASH_FOR += $(notdir $(ARCH_XTENSA_OVERLAY_URL))
  18. else
  19. ARCH_XTENSA_OVERLAY_FILE = $(BR_ARCH_XTENSA_OVERLAY_FILE)
  20. endif
  21. ################################################################################
  22. # arch-xtensa-overlay-extract -- extract an extensa overlay
  23. #
  24. # argument 1 is the path in which to extract
  25. # argument 2 is the component to extract, one of: gcc, binutils, gdb, linux,
  26. # u-boot
  27. #
  28. # Example:
  29. # $(call arch-xtensa-overlay-extract,/path/to/overlay.tar,$(@D),gcc)
  30. ################################################################################
  31. define arch-xtensa-overlay-extract
  32. $(call suitable-extractor,$(ARCH_XTENSA_OVERLAY_FILE)) \
  33. $(ARCH_XTENSA_OVERLAY_FILE) | \
  34. $(TAR) --strip-components=1 -C $(1) $(TAR_OPTIONS) - $(2)
  35. endef