git: ed8b456f82ed - main - csh: Remove gethost dependency on tc.const.h
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 09 Feb 2025 00:31:10 UTC
The branch main has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=ed8b456f82ed822652f2abb24d65ab73ac3dbb0a
commit ed8b456f82ed822652f2abb24d65ab73ac3dbb0a
Author: Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2025-02-07 01:23:47 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-02-09 00:30:55 +0000
csh: Remove gethost dependency on tc.const.h
gethost is a build tool built in stage 2.3, but it had a dependency on
tc.const.h, which requires target headers (that are not installed until
stage 4.1). The build falls back to the host's headers if the target
headers don't yet exist, which may result in a build failure if the
host's headers don't match the target.
As gethost.c doesn't actually require the definitions in tc.const.h, add
a hack to skip the include of tc.const.h and remove the dependency.
PR: 283273
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Fixes: e754e5f36195 ("Upgrade to 6.10")
Differential Revision: https://reviews.freebsd.org/D48880
---
bin/csh/Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/bin/csh/Makefile b/bin/csh/Makefile
index 6b05c01e0a61..5cbb58bd0ead 100644
--- a/bin/csh/Makefile
+++ b/bin/csh/Makefile
@@ -121,9 +121,14 @@ build-tools: gethost
tc.defs.c: gethost
DEPENDOBJS+= gethost
-gethost: gethost.c sh.err.h tc.const.h sh.h ${BUILD_TOOLS_META}
+gethost: gethost.c sh.err.h sh.h ${BUILD_TOOLS_META}
@rm -f ${.TARGET}
+ # Define _h_tc_const so that tc.h will skip including tc.const.h.
+ # gethost.c does not actually require any of the definitions in there,
+ # and building tc.const.h requires target headers which are not
+ # available when we need to build gethost.
${HOST_CC:N${CCACHE_BIN}} -o gethost ${LDFLAGS} ${CFLAGS:C/-DHAVE_ICONV//} \
+ -D_h_tc_const \
${TCSHDIR}/gethost.c
.endif