From ed7b2996620412b29e7a0fb776028c92df0228ee Mon Sep 17 00:00:00 2001 From: bdrewery Date: Mon, 9 May 2016 22:21:09 +0000 Subject: [PATCH] DIRDEPS_BUILD: Run the staged bootstrap-tools version of build-tools. This avoids running target binaries. Sponsored by: EMC / Isilon Storage Division --- bin/csh/Makefile | 2 +- bin/sh/Makefile | 4 ++-- contrib/ncurses/ncurses/tinfo/MKcaptab.sh | 4 ++-- lib/libmagic/Makefile | 2 +- lib/ncurses/ncurses/Makefile | 4 ++-- share/mk/local.meta.sys.mk | 2 ++ share/syscons/scrnmaps/Makefile | 2 +- usr.bin/awk/Makefile | 2 +- usr.bin/vi/catalog/Makefile | 2 +- 9 files changed, 13 insertions(+), 11 deletions(-) diff --git a/bin/csh/Makefile b/bin/csh/Makefile index 6e3c32d40745..3dbd0b5c0462 100644 --- a/bin/csh/Makefile +++ b/bin/csh/Makefile @@ -118,7 +118,7 @@ gethost: gethost.c sh.err.h tc.const.h sh.h ${BUILD_TOOLS_META} tc.defs.c: gethost ${TCSHDIR}/host.defs @rm -f ${.TARGET} @echo "/* Do not edit this file, make creates it */" > ${.TARGET} - ./gethost ${TCSHDIR}/host.defs >> ${.TARGET} + ${BTOOLSPATH:U.}/gethost ${TCSHDIR}/host.defs >> ${.TARGET} ed.defns.h: ed.defns.c @rm -f ${.TARGET} diff --git a/bin/sh/Makefile b/bin/sh/Makefile index d3422b43beff..a3e2c405bcb8 100644 --- a/bin/sh/Makefile +++ b/bin/sh/Makefile @@ -52,11 +52,11 @@ mksyntax: mksyntax.o ${BUILD_TOOLS_META} .ORDER: nodes.c nodes.h nodes.c nodes.h: mknodes nodetypes nodes.c.pat - ./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat + ${BTOOLSPATH:U.}/mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat .ORDER: syntax.c syntax.h syntax.c syntax.h: mksyntax - ./mksyntax + ${BTOOLSPATH:U.}/mksyntax token.h: mktokens sh ${.CURDIR}/mktokens diff --git a/contrib/ncurses/ncurses/tinfo/MKcaptab.sh b/contrib/ncurses/ncurses/tinfo/MKcaptab.sh index 20c94a639b9a..b9d9fbeb7b52 100644 --- a/contrib/ncurses/ncurses/tinfo/MKcaptab.sh +++ b/contrib/ncurses/ncurses/tinfo/MKcaptab.sh @@ -52,8 +52,8 @@ cat <<'EOF' EOF -./make_hash 1 info $OPT1 <$DATA -./make_hash 3 cap $OPT1 <$DATA +make_hash 1 info $OPT1 <$DATA +make_hash 3 cap $OPT1 <$DATA $AWK -f $OPT2 bigstrings=$OPT1 tablename=capalias <$DATA diff --git a/lib/libmagic/Makefile b/lib/libmagic/Makefile index a58dda7d7ebf..76f3e7cbd558 100644 --- a/lib/libmagic/Makefile +++ b/lib/libmagic/Makefile @@ -36,7 +36,7 @@ magic: ${MAGFILES} cat ${.ALLSRC:O} > ${.TARGET} magic.mgc: mkmagic magic - ./mkmagic magic + ${BTOOLSPATH:U.}/mkmagic magic CLEANFILES+= mkmagic build-tools: mkmagic diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index c361e29cb4ec..f8649ccf03d3 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -342,7 +342,7 @@ unctrl.c: MKunctrl.awk echo | ${AWK} -f ${NCURSES_DIR}/ncurses/base/MKunctrl.awk bigstrings=${USE_BIG_STRINGS} > unctrl.c comp_captab.c: MKcaptab.sh MKcaptab.awk Caps make_hash - sh ${NCURSES_DIR}/ncurses/tinfo/MKcaptab.sh "${AWK}" \ + env PATH=${BTOOLSPATH:U.}:${PATH} sh ${NCURSES_DIR}/ncurses/tinfo/MKcaptab.sh "${AWK}" \ ${USE_BIG_STRINGS} ${NCURSES_DIR}/ncurses/tinfo/MKcaptab.awk \ ${NCURSES_DIR}/include/Caps > comp_captab.c @@ -358,7 +358,7 @@ nomacros.h: MKlib_gen.sh curses.h "${AWK}" generated < curses.h | fgrep undef > $@ init_keytry.h: keys.list make_keys - ./make_keys keys.list > init_keytry.h + ${BTOOLSPATH:U.}/make_keys keys.list > init_keytry.h hashsize.h: MKhashsize.sh Caps sh ${NCURSES_DIR}/include/MKhashsize.sh ${NCURSES_DIR}/include/Caps > $@ diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk index e55d68de3953..6088c75e871b 100644 --- a/share/mk/local.meta.sys.mk +++ b/share/mk/local.meta.sys.mk @@ -232,6 +232,8 @@ TOOLSDIR?= ${HOST_OBJTOP}/tools .elif defined(STAGE_HOST_OBJTOP) TOOLSDIR?= ${STAGE_HOST_OBJTOP} .endif +BTOOLSPATH= ${HOST_OBJTOP}/tools${.CURDIR} + # Don't use the bootstrap tools logic on itself. .if ${.TARGETS:Mbootstrap-tools} == "" && \ !make(showconfig) && \ diff --git a/share/syscons/scrnmaps/Makefile b/share/syscons/scrnmaps/Makefile index 1e14e5052738..1a082a5d2871 100644 --- a/share/syscons/scrnmaps/Makefile +++ b/share/syscons/scrnmaps/Makefile @@ -15,7 +15,7 @@ FILESDIR= ${SHAREDIR}/syscons/scrnmaps build-tools: ${SCRMAPS_MK} ${SCRMAPS}: ${.TARGET:R}.mk - ./${.TARGET:R}.mk ${.TARGET:R}.tmp + ${BTOOLSPATH:U.}/${.TARGET:R}.mk ${.TARGET:R}.tmp uuencode ${.TARGET:R}.tmp ${.TARGET:R} > ${.TARGET} rm -f ${.TARGET:R}.tmp diff --git a/usr.bin/awk/Makefile b/usr.bin/awk/Makefile index e2e2758131c1..168b22eea632 100644 --- a/usr.bin/awk/Makefile +++ b/usr.bin/awk/Makefile @@ -21,7 +21,7 @@ ytab.h: awkgram.h .NOMETA ln -sf ${.ALLSRC} ${.TARGET} proctab.c: maketab - ./maketab > proctab.c + ${BTOOLSPATH:U.}/maketab > proctab.c build-tools: maketab maketab: ytab.h ${AWKSRC}/maketab.c ${BUILD_TOOLS_META} diff --git a/usr.bin/vi/catalog/Makefile b/usr.bin/vi/catalog/Makefile index e095e6d57d5e..a045dbce9119 100644 --- a/usr.bin/vi/catalog/Makefile +++ b/usr.bin/vi/catalog/Makefile @@ -98,7 +98,7 @@ ${c}.check: ${c}.base .endfor english.base: dump ${SCAN} #Makefile - ./dump ${SCAN} |\ + ${BTOOLSPATH:U.}/dump ${SCAN} |\ sed -e '/|/!d' \ -e 's/|/ "/' \ -e 's/^"//' |\