Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/mk Change the check for BSD_PKG_MK into something whic...



details:   https://anonhg.NetBSD.org/src/rev/c43c8df9552c
branches:  trunk
changeset: 516615:c43c8df9552c
user:      jmc <jmc%NetBSD.org@localhost>
date:      Fri Oct 26 04:59:10 2001 +0000

description:
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.

diffstat:

 share/mk/bsd.own.mk |  23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diffs (47 lines):

diff -r 862f6ddda5ce -r c43c8df9552c share/mk/bsd.own.mk
--- a/share/mk/bsd.own.mk       Fri Oct 26 04:22:25 2001 +0000
+++ b/share/mk/bsd.own.mk       Fri Oct 26 04:59:10 2001 +0000
@@ -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_)
 _BSD_OWN_MK_=1
@@ -20,10 +20,21 @@
 .endif
 .endif
 
-.if defined(BSD_PKG_MK) || !defined(USE_NEW_TOOLCHAIN)
-USETOOLS:=     no
+.if !defined(_SRC_TOP_)
+# 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
+
+.if (${_SRC_TOP_} != "") && defined(USE_NEW_TOOLCHAIN)
 USETOOLS?=     yes
+.endif
+USETOOLS?=     no
 
 .if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "sh3"
 .BEGIN:
@@ -35,8 +46,12 @@
        @false
 .endif
 
-.if ${USETOOLS} != "no"
+.if ${USETOOLS} == "yes" && defined(USE_NEW_TOOLCHAIN)
 # 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
 AS=            ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as



Home | Main Index | Thread Index | Old Index