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)