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