Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src * Create a variable HOST_OSTYPE that represents the host bui...
details: https://anonhg.NetBSD.org/src/rev/e184104a8ac7
branches: trunk
changeset: 516834:e184104a8ac7
user: tv <tv%NetBSD.org@localhost>
date: Wed Oct 31 17:46:08 2001 +0000
description:
* Create a variable HOST_OSTYPE that represents the host build environment,
using `uname -s`-`uname -r`-`uname -p || uname -m`. This can be overridden
in mk.conf or the environment, and is used by host tools to ensure that
build hosts do not clobber each other.
* Now that there's an objdir in src/tools, make a default TOOLDIR by creating
"tools.${HOST_OSTYPE}" in the objdir (if it exists) of src/tools. This
means that TOOLDIR is no longer required to be set in a build, though it
still may be set manually if desired.
* Set MKTOOLS to "yes" by default, since the default TOOLDIR is now located
in a known mutable location. This may still be set manually if desired.
diffstat:
share/mk/bsd.own.mk | 28 +++++++++++++++++++---------
tools/Makefile | 6 +++++-
tools/Makefile.inc | 7 +++----
3 files changed, 27 insertions(+), 14 deletions(-)
diffs (103 lines):
diff -r 1ffd9da5ebb4 -r e184104a8ac7 share/mk/bsd.own.mk
--- a/share/mk/bsd.own.mk Wed Oct 31 17:44:42 2001 +0000
+++ b/share/mk/bsd.own.mk Wed Oct 31 17:46:08 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.own.mk,v 1.203 2001/10/31 16:25:21 tv Exp $
+# $NetBSD: bsd.own.mk,v 1.204 2001/10/31 17:46:08 tv Exp $
.if !defined(_BSD_OWN_MK_)
_BSD_OWN_MK_=1
@@ -46,13 +46,26 @@
@false
.endif
-.if ${USETOOLS} == "yes"
-# Define default locations for common tools.
-.if !defined(TOOLDIR)
-.BEGIN:
- @echo "USETOOLS=yes, but TOOLDIR isn't set which is a requirement"; exit 1
+PRINTOBJDIR= printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}\n" | ${MAKE} -B -s -f-
+
+# Host platform information; may be overridden
+.if !defined(HOST_OSTYPE)
+_HOST_OSNAME!= uname -s
+_HOST_OSREL!= uname -r
+_HOST_ARCH!= uname -p 2>/dev/null || uname -m
+HOST_OSTYPE:= ${_HOST_OSNAME}-${_HOST_OSREL}-${_HOST_ARCH}
+.MAKEOVERRIDES+= HOST_OSTYPE
.endif
+.if ${USETOOLS} == "yes"
+# Provide a default for TOOLDIR.
+.if !defined(TOOLDIR)
+_TOOLOBJ!= cd ${_SRC_TOP_:U${BSDSRCDIR}}/tools && ${PRINTOBJDIR}
+TOOLDIR:= ${_TOOLOBJ}/tools.${HOST_OSTYPE}
+.MAKEOVERRIDES+= TOOLDIR
+.endif
+
+# Define default locations for common tools.
AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
ASN1_COMPILE= ${TOOLDIR}/bin/asn1_compile
@@ -102,7 +115,6 @@
# Make sure DESTDIR is set, so that builds with these tools always
# get appropriate -nostdinc, -nostdlib, etc. handling. The default is
# <empty string>, meaning start from /, the root directory.
-
DESTDIR?=
.endif
@@ -281,8 +293,6 @@
cleandir: .NOTMAIN clean
.endif
-PRINTOBJDIR= printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}\n" | ${MAKE} -B -s -f-
-
# Define MKxxx variables (which are either yes or no) for users
# to set in /etc/mk.conf and override on the make commandline.
# These should be tested with `== "no"' or `!= "no"'.
diff -r 1ffd9da5ebb4 -r e184104a8ac7 tools/Makefile
--- a/tools/Makefile Wed Oct 31 17:44:42 2001 +0000
+++ b/tools/Makefile Wed Oct 31 17:46:08 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2001/10/31 01:20:10 tv Exp $
+# $NetBSD: Makefile,v 1.12 2001/10/31 17:46:08 tv Exp $
.include <bsd.own.mk>
@@ -13,3 +13,7 @@
.include <bsd.subdir.mk>
.include <bsd.obj.mk>
+
+cleandir: cleantools
+cleantools:
+ rm -r -f tools.${HOST_OSTYPE}
diff -r 1ffd9da5ebb4 -r e184104a8ac7 tools/Makefile.inc
--- a/tools/Makefile.inc Wed Oct 31 17:44:42 2001 +0000
+++ b/tools/Makefile.inc Wed Oct 31 17:46:08 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.10 2001/10/31 16:15:01 tv Exp $
+# $NetBSD: Makefile.inc,v 1.11 2001/10/31 17:46:08 tv Exp $
.include <bsd.own.mk>
@@ -15,7 +15,7 @@
# "make build": Only build if the installed program is out-of-date.
# ("make all" and "make install" always build and install.)
.if make(build)
-MKTOOLS?=no
+MKTOOLS?=yes
.if ${MKTOOLS} == "always"
build:
.else
@@ -27,8 +27,7 @@
@cd ${_CURDIR} && ${MAKE} all
@cd ${_CURDIR} && ${MAKE} install
.else
- @echo "===> $@ must be updated"
- @echo "===> (set MKTOOLS=yes in /etc/mk.conf or the environment to continue)"
+ @echo "===> $@ must be updated, but MKTOOLS=no, so cannot build"
@false
.endif
.endif
Home |
Main Index |
Thread Index |
Old Index