Source-Changes-HG archive

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

[src/trunk]: src/tools TOOLDIR must be valid, unless MKTOOLS=no.



details:   https://anonhg.NetBSD.org/src/rev/fa5010f38be7
branches:  trunk
changeset: 783036:fa5010f38be7
user:      apb <apb%NetBSD.org@localhost>
date:      Sun Dec 02 12:10:43 2012 +0000

description:
TOOLDIR must be valid, unless MKTOOLS=no.
Add tests and .error directives to enforce this.

diffstat:

 tools/Makefile |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (27 lines):

diff -r 05ecb0d47ab5 -r fa5010f38be7 tools/Makefile
--- a/tools/Makefile    Sun Dec 02 11:46:34 2012 +0000
+++ b/tools/Makefile    Sun Dec 02 12:10:43 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.163 2012/12/02 11:46:34 apb Exp $
+#      $NetBSD: Makefile,v 1.164 2012/12/02 12:10:43 apb Exp $
 
 .include <bsd.own.mk>
 
@@ -6,6 +6,17 @@
 # plain make.
 .MAIN: build_install
 
+# TOOLDIR must be valid, unless MKTOOLS=no
+.if ${MKTOOLS:Uyes} != "no"
+.if "${TOOLDIR}" == ""
+.error "TOOLDIR is undefined or empty"
+.elif "${TOOLDIR:tW:M/*}" == ""
+.error "TOOLDIR is not an absolute path: ${TOOLDIR}"
+#.elif !exists(TOOLDIR) # XXX .exists fails for directories
+#.error "TOOLDIR does not exist: ${TOOLDIR}"
+.endif
+.endif # MKTOOLS != no
+
 .if ${TOOLCHAIN_MISSING} == "no"
 .if defined(HAVE_GCC)
 TOOLCHAIN_BITS= gmake .WAIT



Home | Main Index | Thread Index | Old Index