kumquat-buildroot/toolchain/toolchain-external/toolchain-external.mk

29 lines
1.0 KiB
Makefile
Raw Normal View History

################################################################################
#
# toolchain-external
#
################################################################################
toolchain-external: introduce toolchain-external-package The toolchain-external-package infrastructure is just a copy of the toolchain-external commands, replacing TOOLCHAIN_EXTERNAL by $(2) and adding double-dollars everywhere. toolchain-external itself is converted to a virtual package, but it is faked a little to make sue the toolchains that haven't been converted to toolchain-external-package yet keep on working. The TOOLCHAIN_EXTERNAL_MOVE commands don't have to be redefined for every toolchain-external-package instance, so that is moved out into the common part of pkg-toolchain-external.mk. The musl-compat-headers dependency stays in the toolchain-external package itself. The musl ld link is duplicated in the legacy toolchain-external and the toolchain-external-package, because they have separate hooks. The handling of TOOLCHAIN_EXTERNAL_BIN deserves some special attention, because its value will be different for different toolchain-external-package instances. However, the value only depends on variables that are set by Kconfig (BR2_TOOLCHAIN_EXTERNAL_PREFIX and BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD) so it can easily be used in the generic part. So we don't have to do anything specific for this variable after all. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Romain Naour <romain.naour@gmail.com> Reviewed-by: Romain Naour <romain.naour@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-07 02:19:59 +01:00
TOOLCHAIN_EXTERNAL_ADD_TOOLCHAIN_DEPENDENCY = NO
# musl does not provide an implementation for sys/queue.h or sys/cdefs.h.
# So, add the musl-compat-headers package that will install those files,
# into the staging directory:
# sys/queue.h: header from NetBSD
# sys/cdefs.h: minimalist header bundled in Buildroot
ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
TOOLCHAIN_EXTERNAL_DEPENDENCIES += musl-compat-headers
endif
$(eval $(virtual-package))
# Ensure the external-toolchain package has a prefix defined.
# This comes after the virtual-package definition, which checks the provider.
ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
ifeq ($(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX)),)
$(error No prefix selected for external toolchain package $(BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL). Configuration error)
endif
endif
include $(sort $(wildcard toolchain/toolchain-external/*/*.mk))