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 ./