Change the check for BSD_PKG_MK into something which looks to see if we're
running from inside of $BSDSRCDIR (recurse back and look for file/dir signatures or reach /, whichever comes first). Do it once and then pass the results to sub-makes. Finally, if using the new toolchain and USETOOLS=yes check $TOOLDIR before using it. Print an error message out if it's not set when expected here.
This commit is contained in:
parent
5bd379b1b2
commit
a414473103
|
@ -1,4 +1,4 @@
|
||||||
# $NetBSD: bsd.own.mk,v 1.198 2001/10/25 22:31:11 bjh21 Exp $
|
# $NetBSD: bsd.own.mk,v 1.199 2001/10/26 04:59:10 jmc Exp $
|
||||||
|
|
||||||
.if !defined(_BSD_OWN_MK_)
|
.if !defined(_BSD_OWN_MK_)
|
||||||
_BSD_OWN_MK_=1
|
_BSD_OWN_MK_=1
|
||||||
|
@ -20,10 +20,21 @@ USE_NEW_TOOLCHAIN=yes # set
|
||||||
.endif
|
.endif
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.if defined(BSD_PKG_MK) || !defined(USE_NEW_TOOLCHAIN)
|
.if !defined(_SRC_TOP_)
|
||||||
USETOOLS:= no
|
# Find the top of the source tree to see if we're inside of $BSDSRCDIR
|
||||||
|
_SRC_TOP_!= cd ${.CURDIR}; while :; do \
|
||||||
|
here=`pwd`; echo "$$here" >&2 ; \
|
||||||
|
[ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \
|
||||||
|
case $$here in /) echo ""; break;; esac; \
|
||||||
|
cd ..; done
|
||||||
|
|
||||||
|
.MAKEOVERRIDES+= _SRC_TOP_
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
.if (${_SRC_TOP_} != "") && defined(USE_NEW_TOOLCHAIN)
|
||||||
USETOOLS?= yes
|
USETOOLS?= yes
|
||||||
|
.endif
|
||||||
|
USETOOLS?= no
|
||||||
|
|
||||||
.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "sh3"
|
.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "sh3"
|
||||||
.BEGIN:
|
.BEGIN:
|
||||||
|
@ -35,8 +46,12 @@ USETOOLS?= yes
|
||||||
@false
|
@false
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.if ${USETOOLS} != "no"
|
.if ${USETOOLS} == "yes" && defined(USE_NEW_TOOLCHAIN)
|
||||||
# Define default locations for common tools.
|
# Define default locations for common tools.
|
||||||
|
.if !defined(TOOLDIR)
|
||||||
|
.BEGIN:
|
||||||
|
@echo "USETOOLS=yes, but TOOLDIR isn't set which is a requirement"; exit 1
|
||||||
|
.endif
|
||||||
|
|
||||||
AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
|
AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
|
||||||
AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
|
AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
|
||||||
|
|
Loading…
Reference in New Issue