From 81c3c7b0eb8c1814fee38b4fd0efaef715344d57 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sat, 9 Jul 2022 16:38:11 -0600 Subject: [PATCH] ksh93: fix BSD builds due to iconv confusion For the BSD's we do not want to pass CFLAGS since it includes a -I/usr/local/incude directive. This breaks ksh's iconv detection due to the weird way in which iconv seems to be handled on the BSD's - both a libc impl (preferred), and a possibly external GNU iconv impl installed in /usr/local. /usr/local/include is added to CFLAGS by the X11/Motif detection logic - since that is where all of the needed headers are on the BSDs. One of the patches from Martijn Decker added CFLAGS to the ksh93 build CCFLAGS which made this problem show up. So until/unless that is fixed in ksh93, we will avoid sending anything to the ksh build system except for SUIDEXECDEFINES --- cde/programs/dtksh/Makefile.am | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/cde/programs/dtksh/Makefile.am b/cde/programs/dtksh/Makefile.am index 6226c2f51..cf61c3485 100644 --- a/cde/programs/dtksh/Makefile.am +++ b/cde/programs/dtksh/Makefile.am @@ -55,8 +55,27 @@ dtksh_SOURCES = init.c \ extra.c \ msgs.c +# for the BSD's we do not want to pass CFLAGS since it includes a +# -I/usr/local/incude directive. This breaks ksh's iconv +# detection due to the weird way in which iconv seems to be handled on +# the BSD's - both a libc impl (preferred), and a possibly external +# GNU iconv impl installed in /usr/local. +# +# /usr/local/include is added to CFLAGS by the X11/Motif detection +# logic - since that is where all of the needed headers are on the +# BSDs. +# +# So until/unless that is fixed in ksh93, we will avoid sending +# anything to the ksh build system except for SUIDEXECDEFINES + +if BSD +KSH93_CCFLAGS=$(SUIDEXECDEFINES) +else +KSH93_CCFLAGS=$(CFLAGS) $(SUIDEXECDEFINES) +endif + ksh93/bin/ksh: - ksh93/bin/package flat make CCFLAGS='$(CFLAGS) $(SUIDEXECDEFINES)' + ksh93/bin/package flat make CCFLAGS='$(KSH93_CCFLAGS)' init.c: ksh93/bin/ksh $(CP) ksh93/src/cmd/ksh93/sh/init.c ./