toolchain-external-codescape-mti-mips.mk 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ################################################################################
  2. #
  3. # toolchain-external-codescape-mti-mips
  4. #
  5. ################################################################################
  6. TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_VERSION = 2018.09-02
  7. TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_SITE = https://codescape.mips.com/components/toolchain/$(TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_VERSION)
  8. TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_STRIP_COMPONENTS = 2
  9. ifeq ($(HOSTARCH),x86)
  10. TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_SOURCE = Codescape.GNU.Tools.Package.$(TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_VERSION).for.MIPS.MTI.Linux.CentOS-6.x86.tar.gz
  11. else
  12. TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_SOURCE = Codescape.GNU.Tools.Package.$(TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_VERSION).for.MIPS.MTI.Linux.CentOS-6.x86_64.tar.gz
  13. endif
  14. # Special fixup for Codescape MIPS toolchains, that have bin-<abi> and
  15. # sbin-<abi> directories. We create symlinks bin -> bin-<abi> and sbin
  16. # -> sbin-<abi> so that the rest of Buildroot can find the toolchain
  17. # tools in the appropriate location.
  18. ifeq ($(BR2_MIPS_OABI32),y)
  19. TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_BIN_DIR_SUFFIX = o32
  20. else ifeq ($(BR2_MIPS_NABI32),y)
  21. TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_BIN_DIR_SUFFIX = n32
  22. else ifeq ($(BR2_MIPS_NABI64),y)
  23. TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_BIN_DIR_SUFFIX = n64
  24. endif
  25. define TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_STAGING_FIXUPS
  26. rmdir $(STAGING_DIR)/usr/bin $(STAGING_DIR)/usr/sbin
  27. ln -sf bin-$(TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_BIN_DIR_SUFFIX) $(STAGING_DIR)/usr/bin
  28. ln -sf sbin-$(TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_BIN_DIR_SUFFIX) $(STAGING_DIR)/usr/sbin
  29. endef
  30. # The Codescape toolchain uses a sysroot layout that places them
  31. # side-by-side instead of nested like multilibs. A symlink is needed
  32. # much like for the nested sysroots which are handled in
  33. # copy_toolchain_sysroot but there is not enough information in there
  34. # to determine whether the sysroot layout was nested or side-by-side.
  35. # Add the symlink here for now.
  36. define TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_SYMLINK
  37. $(Q)ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))"; \
  38. ARCH_SUBDIR=`basename $${ARCH_SYSROOT_DIR}`; \
  39. ln -snf . $(STAGING_DIR)/$${ARCH_SUBDIR}
  40. endef
  41. TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_POST_INSTALL_STAGING_HOOKS += \
  42. TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_STAGING_FIXUPS \
  43. TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_SYMLINK
  44. $(eval $(toolchain-external-package))