Allow CROSS_TOOLCHAIN to be a path to a file.

This allows working with custom cross toolchains without the need to
create files in /usr/local/share/toolchains.

Obtained from:	CheriBSD
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14178
This commit is contained in:
Brooks Davis 2018-02-25 20:21:30 +00:00
parent 170430d505
commit 0df651d7ee

View File

@ -56,7 +56,13 @@ LOCALBASE?= /usr/local
# Cross toolchain changes must be in effect before bsd.compiler.mk
# so that gets the right CC, and pass CROSS_TOOLCHAIN to submakes.
.if defined(CROSS_TOOLCHAIN)
.if exists(${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk)
.include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk"
.elif exists(${CROSS_TOOLCHAIN})
.include "${CROSS_TOOLCHAIN}"
.else
.error CROSS_TOOLCHAIN is '${CROSS_TOOLCHAIN}' which is invalid
.endif
CROSSENV+=CROSS_TOOLCHAIN="${CROSS_TOOLCHAIN}"
.endif
.if defined(CROSS_TOOLCHAIN_PREFIX)