From nobody Thu Apr 20 17:06:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q2PFq48KLz46KHk; Thu, 20 Apr 2023 17:06:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q2PFn695Kz3kHQ; Thu, 20 Apr 2023 17:06:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682010398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g04riSrt9kxPDZqlI+lrLehIDq6GZDAPK5MQ9ty31hQ=; b=c0kIjxYXrePAenzdm8W2n7PlU4QvUV8VWLGITcuPqCEErZamW8XYbDrzMLewABfEE1KmU4 GSt27h6PsgDNqMvy4vC+mcY19Kv6rNHr8td3prEFNET7+SGwamIOEWOeZeu9Vxg+41lR2h rixmaQHVOAfgyZEEIlmhUeOtgSi3eBePf6/SvJohXfNRVi1MvSeejVfoTHQ0R3XBrgPzpk 41Undqt/Sh5jzmZoQW95NPz7T2KlhgXX7lppVhFy+U7xX2JP6afPEh89fI7IjAsJGElVlS hjSQJnkN+FxXiCTJSN5r/5MQXQzSE4baR8ZuQJ9iF5m/4Epu+bTresb3+mpunQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682010398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g04riSrt9kxPDZqlI+lrLehIDq6GZDAPK5MQ9ty31hQ=; b=shDEdUY/qWPYkmDK35ajpS7D6mAnr8BFSY9/bEwCJqcLZR4twG3aLhooy4w0i0DMInnzlU hg6tpixCBSI8sHd8/o1MNcxSgyoNVgAa8gIGDr1nhxNb4I8u/qypvd5Tz7RZ+d1k252Lud G0rksWWC4I5wlaEN8plG8pVr7rwLm698P95u6QfRv6MIVaguGmje6wdQ1HD7+fSQewgv2Q 8lSgdSiCuhH15+/BWYOfio72TJQbFJG8gFxOsXgdkO0MMwi1S3NtTWbp/NB7FSpzdvlgmd VE0oYYOpje+YwFCEB2d3F+AWVqREKolbEZf56et3W9LtayIc4eUmDM2jmo2Nog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682010398; a=rsa-sha256; cv=none; b=RprnsnGQosSgGugPuAgbGMf7IuhNVKltUJbDjIccwlameFTdX+o3woM1aQM5j0so50UnF4 IB0ui5btMbBdD0bpFmEabrcm9Pc5us8HVo2fsP57SMr3taRavmFny+S91I6CaHhNhFrg7W n75WX0j4s3dPdBjpUbZpNwMR+XZZdpxZxqVIbZbZvayxisHnBi+sEoXr4Pbh68Spltnk6l LaedBk292IoNtVZ0hjHk6LkmWz+zkGpBlHlsfau7uworzueuMOAG03w8P4CIbP0nU2LPkC nFdHtiz70KrOJXCIHJzGQied3b7jFY4XxFfT45zAgtuYvu1yHAJfre2yMmmm0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q2PFn2BvMzlmx; Thu, 20 Apr 2023 17:06:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33KH6bYn028112; Thu, 20 Apr 2023 17:06:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33KH6bWs028111; Thu, 20 Apr 2023 17:06:37 GMT (envelope-from git) Date: Thu, 20 Apr 2023 17:06:37 GMT Message-Id: <202304201706.33KH6bWs028111@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 8fe4f8f7a75f - main - Fix building host tools for host List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8fe4f8f7a75f3f6d1fc52e31a6d25a112d4644fd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=8fe4f8f7a75f3f6d1fc52e31a6d25a112d4644fd commit 8fe4f8f7a75f3f6d1fc52e31a6d25a112d4644fd Author: Simon J. Gerraty AuthorDate: 2023-04-20 17:05:43 +0000 Commit: Simon J. Gerraty CommitDate: 2023-04-20 17:05:43 +0000 Fix building host tools for host Several makefile depend on tools built for host. At least when using DIRDEPS_BUILD we can build these for the pseudo machine "host" to facilitate building on older host versions. Ideally we would build these tools in their own directories to avoid building more than needed. For now, setting an appropriate default for BTOOLSPATH will suffice Reviewed by: stevek Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D39708 --- bin/csh/Makefile | 5 ++++- bin/sh/Makefile | 7 +++++-- lib/ncurses/tinfo/Makefile | 13 +++++++++++++ share/mk/local.meta.sys.mk | 7 +++++++ share/syscons/scrnmaps/Makefile | 10 ++++++---- usr.bin/awk/Makefile | 2 ++ 6 files changed, 37 insertions(+), 7 deletions(-) diff --git a/bin/csh/Makefile b/bin/csh/Makefile index d59626703685..2d1edcf53a80 100644 --- a/bin/csh/Makefile +++ b/bin/csh/Makefile @@ -118,15 +118,18 @@ NLSSRCFILES_${catalog:C/.*://}!= cd ${NLSSRCDIR_${catalog:C/.*://}}; echo charse csh.1: tcsh.man cat ${.ALLSRC} > ${.TARGET} +.if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no" build-tools: gethost +tc.defs.c: gethost DEPENDOBJS+= gethost gethost: gethost.c sh.err.h tc.const.h sh.h ${BUILD_TOOLS_META} @rm -f ${.TARGET} ${CC:N${CCACHE_BIN}} -o gethost ${LDFLAGS} ${CFLAGS:C/-DHAVE_ICONV//} \ ${TCSHDIR}/gethost.c +.endif -tc.defs.c: gethost ${TCSHDIR}/host.defs +tc.defs.c: ${TCSHDIR}/host.defs @rm -f ${.TARGET} @echo "/* Do not edit this file, make creates it */" > ${.TARGET} ${BTOOLSPATH:U.}/gethost ${TCSHDIR}/host.defs >> ${.TARGET} diff --git a/bin/sh/Makefile b/bin/sh/Makefile index c61094b06720..039da7309adc 100644 --- a/bin/sh/Makefile +++ b/bin/sh/Makefile @@ -39,15 +39,18 @@ CFLAGS+=-DSHELL -I. -I${.CURDIR} CLEANFILES+= mknodes mksyntax CLEANFILES+= ${GENSRCS} ${GENHDRS} +.if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no" build-tools: mknodes mksyntax +DEPENDOBJS+= mknodes mksyntax +mknodes mksyntax: ${BUILD_TOOLS_META} +.endif + .ORDER: builtins.c builtins.h builtins.h: .NOMETA builtins.c builtins.h: mkbuiltins builtins.def sh ${.CURDIR}/mkbuiltins ${.CURDIR} -DEPENDOBJS+= mknodes mksyntax -mknodes mksyntax: ${BUILD_TOOLS_META} .ORDER: nodes.c nodes.h nodes.h: .NOMETA diff --git a/lib/ncurses/tinfo/Makefile b/lib/ncurses/tinfo/Makefile index fc4e4447562e..2d251072acb8 100644 --- a/lib/ncurses/tinfo/Makefile +++ b/lib/ncurses/tinfo/Makefile @@ -270,6 +270,11 @@ keys.list: MKkeys_list.sh Caps Caps-ncurses AWK=${AWK} sh ${NCURSES_DIR}/ncurses/tinfo/MKkeys_list.sh \ ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/include/Caps-ncurses | LC_ALL=C sort > keys.list +.if ${MK_DIRDEPS_BUILD} == "yes" && ${MACHINE} != "host" +# we need to override the default +BTOOLSPATH= ${HOST_OBJTOP}/${RELDIR:S,w$,,} +.endif +.if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no" # Build tools DEPENDOBJS+= make_hash make_keys build-tools: make_hash make_keys @@ -280,6 +285,14 @@ make_keys: make_keys.c names.c ncurses_def.h ${HEADERS} ${BUILD_TOOLS_META} make_hash: make_hash.c hashsize.h ncurses_def.h ${HEADERS} ${BUILD_TOOLS_META} ${CC:N${CCACHE_BIN}} -o $@ ${CFLAGS} -DMAIN_PROGRAM \ ${NCURSES_DIR}/ncurses/tinfo/make_hash.c +.endif +.if ${MK_DIRDEPS_BUILD} == "yes" && ${MACHINE} != "host" +make_keys: ${BTOOLSPATH}/make_keys + ${LN:Uln} -sf ${.ALLSRC} ${.TARGET} + +make_hash: ${BTOOLSPATH}/make_hash + ${LN:Uln} -sf ${.ALLSRC} ${.TARGET} +.endif # ./configure generated MKterm.h.awk: MKterm.h.awk.in diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk index 6b5ff5e97555..6d54d9c5881c 100644 --- a/share/mk/local.meta.sys.mk +++ b/share/mk/local.meta.sys.mk @@ -210,12 +210,19 @@ TOOLSDIR?= ${HOST_OBJTOP}/tools .elif defined(STAGE_HOST_OBJTOP) TOOLSDIR?= ${STAGE_HOST_OBJTOP} .endif +.if ${MK_DIRDEPS_BUILD} == "yes" && ${MACHINE} != "host" +# ideally tools needed by makefiles like sh,csh,tinfo +# would be built in their own directories but for now +# this works well enough. +BTOOLSPATH= ${HOST_OBJTOP}/${RELDIR} +.else # Only define if it exists in case user didn't run bootstrap-tools. Otherwise # the tool will be built during the build. Building it assumes it is # TARGET==MACHINE. .if exists(${HOST_OBJTOP}/tools${.CURDIR}) BTOOLSPATH= ${HOST_OBJTOP}/tools${.CURDIR} .endif +.endif # Don't use the bootstrap tools logic on itself. .if ${.TARGETS:Mbootstrap-tools} == "" && \ diff --git a/share/syscons/scrnmaps/Makefile b/share/syscons/scrnmaps/Makefile index fb6bf59131b9..f3b5ed273cd3 100644 --- a/share/syscons/scrnmaps/Makefile +++ b/share/syscons/scrnmaps/Makefile @@ -14,16 +14,18 @@ CLEANFILES+= ${SCRMAPS_MK} ${SCRMAPS} FILES= ${SCRMAPS} FILESDIR= ${SHAREDIR}/syscons/scrnmaps +.if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no" DEPENDOBJS+= ${SCRMAPS_MK} build-tools: ${SCRMAPS_MK} +${SCRMAPS_MK}: ${.TARGET:R} mkscrfil.c ${BUILD_TOOLS_META} + ${CC:N${CCACHE_BIN}} ${CFLAGS} -I${.CURDIR} -DFIL=\"${.TARGET:R}\" \ + ${LDFLAGS} -o ${.TARGET} ${.CURDIR}/mkscrfil.c +.endif + ${SCRMAPS}: ${.TARGET:R}.mk ${BTOOLSPATH:U.}/${.TARGET:R}.mk ${.TARGET:R}.tmp uuencode ${.TARGET:R}.tmp ${.TARGET:R} > ${.TARGET} rm -f ${.TARGET:R}.tmp -${SCRMAPS_MK}: ${.TARGET:R} mkscrfil.c ${BUILD_TOOLS_META} - ${CC:N${CCACHE_BIN}} ${CFLAGS} -I${.CURDIR} -DFIL=\"${.TARGET:R}\" \ - ${LDFLAGS} -o ${.TARGET} ${.CURDIR}/mkscrfil.c - .include diff --git a/usr.bin/awk/Makefile b/usr.bin/awk/Makefile index 28212f75f7d9..f604684804fa 100644 --- a/usr.bin/awk/Makefile +++ b/usr.bin/awk/Makefile @@ -25,9 +25,11 @@ awkgram.tab.h: awkgram.h proctab.c: maketab awkgram.tab.h ${BTOOLSPATH:U.}/maketab awkgram.tab.h > proctab.c +.if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no" DEPENDOBJS+= maketab build-tools: maketab maketab: awkgram.tab.h ${BUILD_TOOLS_META} +.endif HAS_TESTS= SUBDIR.${MK_TESTS}+= tests