Index: Makefile.inc1 =================================================================== --- Makefile.inc1 +++ Makefile.inc1 @@ -57,6 +57,8 @@ SRCDIR?= ${.CURDIR} LOCALBASE?= /usr/local +.include "share/mk/src.bootools.mk" + # Cross toolchain changes must be in effect before bsd.compiler.mk # so that gets the right CC, and pass CROSS_TOOLCHAIN to submakes. .if defined(CROSS_TOOLCHAIN) @@ -887,8 +889,8 @@ INSTALLFLAGS+= -h sha256 .endif .if defined(DB_FROM_SRC) || defined(NO_ROOT) -IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}" -IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}" +IMAKE_INSTALL= INSTALL="${INSTALL_CMD} ${INSTALLFLAGS}" +IMAKE_MTREE= MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}" .endif DESTDIR_MTREEFLAGS= -deU @@ -900,7 +902,7 @@ # that are created by mtree to be owned by root/wheel. DESTDIR_MTREEFLAGS+= -W .endif -MTREE?= mtree +MTREE?= ${MTREE_CMD} .if ${BUILD_WITH_STRICT_TMPPATH} != 0 MTREE= ${WORLDTMP}/legacy/usr/sbin/mtree .endif Index: etc/Makefile =================================================================== --- etc/Makefile +++ etc/Makefile @@ -2,11 +2,11 @@ # $FreeBSD$ .include +.include FILESGROUPS= FILES NLS_ALIASES= POSIX C \ en_US.US_ASCII C -PWD_MKDB_CMD?= pwd_mkdb # No need as it is empty and just causes rebuilds since this file does so much. UPDATE_DEPENDFILE= no @@ -93,8 +93,6 @@ .endif .endif -MTREE_CMD?= mtree - MTREES= mtree/BSD.root.dist / \ mtree/BSD.var.dist /var \ mtree/BSD.usr.dist /usr \ Index: lib/libc/gen/Makefile.inc =================================================================== --- lib/libc/gen/Makefile.inc +++ lib/libc/gen/Makefile.inc @@ -545,11 +545,13 @@ MLINKS+=wordexp.3 wordfree.3 +.include + afterinstallconfig: .if ${MK_TCSH} == "no" sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd .endif - pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd + ${PWD_MKDB_CMD} -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd .if defined(NO_ROOT) && defined(METALOG) ( \ echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \ Index: share/mk/src.bootools.mk =================================================================== --- /dev/null +++ share/mk/src.bootools.mk @@ -0,0 +1,25 @@ +# Various (hence "Boo":) Tools used by the FreeBSD make installworld / +# distrib-dirs / distribution / installkernel targets. Also called +# "bootstrap tools" historically, however that name seemed to be ambiguous, +# as those tools merely help distributing the OS build artefacts into staging +# / production area. +# +# Very tiny subset of "itools", if you are old enough to know what it is. +# +# Please keep the list short, this file may and will be included from +# many places within the source tree. Rule of thumb: if the above mentioned +# targets survive with MYBOOTOOL_CMD=false, then MYBOOTOOL_CMD probably +# does not belong here. Stick it somewhere else, thank you very much! +# +# $FreeBSD$ + +.if !target(____) + +INSTALL_CMD?= install +MTREE_CMD?= mtree +PWD_MKDB_CMD?= pwd_mkdb +SERVICES_MKDB_CMD?= services_mkdb +CAP_MKDB_CMD?= cap_mkdb + +____: +.endif # !target(____) Index: share/mk/sys.mk =================================================================== --- share/mk/sys.mk +++ share/mk/sys.mk @@ -234,7 +234,11 @@ .endif EFLAGS ?= +.if !defined(INSTALL_CMD) INSTALL ?= install +.else +INSTALL ?= ${INSTALL_CMD} +.endif LEX ?= lex LFLAGS ?= Index: share/termcap/Makefile =================================================================== --- share/termcap/Makefile +++ share/termcap/Makefile @@ -13,9 +13,10 @@ CONFS= termcap.small .include +.include termcap.db: termcap - cap_mkdb ${CAP_MKDB_ENDIAN} -f ${.TARGET:R} ${.ALLSRC} + ${CAP_MKDB_CMD} ${CAP_MKDB_ENDIAN} -f ${.TARGET:R} ${.ALLSRC} etc-termcap: ${INSTALL_SYMLINK} ${BINDIR}/misc/termcap ${DESTDIR}/etc/termcap Index: usr.bin/login/Makefile =================================================================== --- usr.bin/login/Makefile +++ usr.bin/login/Makefile @@ -2,13 +2,13 @@ # $FreeBSD$ .include +.include CONFS= fbtab login.conf motd login.access PROG= login SRCS= login.c login_fbtab.c CFLAGS+=-DLOGALL LIBADD= util pam -CAP_MKDB_CMD?= cap_mkdb WARNS?= 5 Index: usr.bin/vgrind/Makefile =================================================================== --- usr.bin/vgrind/Makefile +++ usr.bin/vgrind/Makefile @@ -19,8 +19,9 @@ CLEANFILES= vgrindefs.src.db .include +.include vgrindefs.src.db: vgrindefs.src - cap_mkdb ${CAP_MKDB_ENDIAN} -f vgrindefs.src ${.ALLSRC} + ${CAP_MKDB_CMD} ${CAP_MKDB_ENDIAN} -f vgrindefs.src ${.ALLSRC} .include Index: usr.sbin/services_mkdb/Makefile =================================================================== --- usr.sbin/services_mkdb/Makefile +++ usr.sbin/services_mkdb/Makefile @@ -4,11 +4,13 @@ PROG= services_mkdb MAN= services_mkdb.8 SRCS= services_mkdb.c uniq.c extern.h -SERVICES_MKDB_CMD?= ${PROG} .include .include .if ${MK_SERVICESDB} != "no" +# SERVICES_MKDB_CMD defined here +.include + afterinstallconfig: ${SERVICES_MKDB_CMD} ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \ ${DESTDIR}/etc/services