From 1422052fd229875294e740e7daae4fca77fa72cc Mon Sep 17 00:00:00 2001 From: lotherk Date: Sat, 14 Nov 2026 08:06:52 +0000 Subject: [PATCH] mcde/dtksh: the compiler goes into the environment, not the argument list ksh93's bin/package takes its compiler from $CC ('case $cc in /*)') and the absolute path passed as a bare argument did not survive the script's own parsing: it still said 'cc: not found -- set CC=C-compiler' with the path on the command line (build/logs/userland-2026-11-14-finish4.log:16480). The rule now prefixes the one command with CC=, which is where the script looks first. --- programs/dtksh/Makefile.am | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/programs/dtksh/Makefile.am b/programs/dtksh/Makefile.am index adc02d23..79026adf 100644 --- a/programs/dtksh/Makefile.am +++ b/programs/dtksh/Makefile.am @@ -67,10 +67,16 @@ dtksh_SOURCES = init.c \ # 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's bin/package takes the compiler from $CC and insists on an absolute +# path ("case $cc in /*)"); a bare path argument did not survive its parsing +# (build/logs/userland-2026-11-14-finish4.log:16480), so the compiler is given in +# the environment of that one command. KSH_CC wins; otherwise the wrapper is +# derived from pkgsrc's CWRAPPERS_CONFIG_DIR, which every make of the build sees. +# A plain build has neither and keeps its own $CC. +KSH_CC_ENV = $(if $(KSH_CC),CC=$(KSH_CC),$(if $(CWRAPPERS_CONFIG_DIR),CC=$(dir $(CWRAPPERS_CONFIG_DIR))bin/cc)) ksh93/bin/ksh: - ksh93/bin/package flat make CCFLAGS='$(KSH93_SHOPTS) $(MCDE_DIALECT_CFLAGS)' $(KSH_CC_ARG) + $(KSH_CC_ENV) ksh93/bin/package flat make CCFLAGS='$(KSH93_SHOPTS) $(MCDE_DIALECT_CFLAGS)' init.c: ksh93/bin/ksh $(CP) ksh93/src/cmd/ksh93/sh/init.c ./