Provide automatic cross-binutils path if no BINUTILS_BOOTSTRAP

The in-tree binutils does not support arm64, so will not work for the
forthcoming FreeBSD arm64 port. BROKEN_OPTIONS will include
BINUTILS_BOOTSTRAP, so provide a default CROSS_BINUTILS_PREFIX for this
case.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Ed Maste 2015-03-12 08:40:32 +00:00
parent 5f1c186b14
commit 4c4073fd06

View File

@ -318,6 +318,19 @@ LOCALBASE?= /usr/local
CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
.endif
# If we do not have a bootstrap binutils (because the in-tree one does not
# support the target architecture), provide a default cross-binutils prefix.
# This allows aarch64 builds, for example, to automatically use the
# aarch64-binutils port or package.
.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \
!defined(CROSS_BINUTILS_PREFIX)
CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/
.if !exists(${CROSS_BINUTILS_PREFIX})
.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX.
.endif
.endif
XCOMPILERS= CC CXX CPP
.for COMPILER in ${XCOMPILERS}
.if defined(CROSS_COMPILER_PREFIX)