From da98eef08ecfd2def238028e76ee840a4d04f1e9 Mon Sep 17 00:00:00 2001 From: lotherk Date: Sat, 14 Nov 2026 07:54:54 +0000 Subject: [PATCH] mcde/dtksh: the wrapper path is derived where the rule runs KSH_CC from the recipe reached the top-level make (bmake show-var BUILD_MAKE_CMD carries it) but not the sub-make that runs the rule -- AM_MAKEFLAGS of programs/dtksh is automake's own and empty, and the value did not travel down (build/logs/userland-2026-11-14-finish3.log:16459 runs without an argument). The rule now derives it from CWRAPPERS_CONFIG_DIR, which pkgsrc exports into every make in the tree: the wrapper is one level beside it. KSH_CC still wins when it is set; a plain build keeps $CC. --- programs/dtksh/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/programs/dtksh/Makefile.am b/programs/dtksh/Makefile.am index 59cc2e36..adc02d23 100644 --- a/programs/dtksh/Makefile.am +++ b/programs/dtksh/Makefile.am @@ -64,7 +64,10 @@ dtksh_SOURCES = init.c \ # (x86_64--netbsd-gcc), so the pkgsrc recipe passes KSH_CC, the compiler wrapper # by its path; native builds leave it empty and bin/package uses $CC as before # (build/logs/userland-2026-11-14n.log:16461). -KSH_CC_ARG = $(if $(KSH_CC),$(KSH_CC)) +# CWRAPPERS_CONFIG_DIR is pkgsrc's; it is exported to every make of the build and +# names the wrapper directory, whose bin/cc applies the cross flags. A plain +# build has neither KSH_CC nor CWRAPPERS_CONFIG_DIR and keeps using $CC. +KSH_CC_ARG = $(if $(KSH_CC),$(KSH_CC),$(if $(CWRAPPERS_CONFIG_DIR),$(dir $(CWRAPPERS_CONFIG_DIR))bin/cc)) ksh93/bin/ksh: ksh93/bin/package flat make CCFLAGS='$(KSH93_SHOPTS) $(MCDE_DIALECT_CFLAGS)' $(KSH_CC_ARG)