oksh-noxz

[fork] Portable OpenBSD ksh, based on the Public Domain Korn Shell (pdksh).
git clone https://noxz.tech/git/oksh-noxz.git
oksh-noxz

commit: 62d0e1b97e0231044c8a0feef836d8e4dc9aaa18
parent: d5dc133a78fc3790f6338fe0353e631292050269
author: Brian Callahan <bcallah@openbsd.org>
date:   Fri, 8 May 2020 20:46:34 -0400
Make BINDIR and MANDIR actually depend on PREFIX.
Noticed from a comment from Glaucus Linux on om4, which also
applies to oksh:
https://github.com/glaucuslinux/glaucus/tree/master/cerata/om4

While here, change the default mandir to /usr/local/share/man.
I know I can't make everyone happy, but I believe this one is more
common on Linux, which I surmise most people are using oksh on.
Everyone else can continue using --mandir= as before.

This allows you to run
./configure --prefix=/usr
and have PREFIX=/usr BINDIR=/usr/bin and MANDIR=/usr/share/man
which I think makes sense.
Mconfigure15+++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
@@ -488,8 +488,10 @@ else
   prefix="/usr/local"
 fi
 
+bindirset=0
+mandirset=0
 bindir="$prefix/bin"
-mandir="$prefix/man"
+mandir="$prefix/share/man"
 
 instprog="oksh"
 libs=""
@@ -503,12 +505,20 @@ do
   case "$opt" in
     --prefix=*)
 	prefix=`echo $opt | cut -d '=' -f 2`
+	if [ bindirset -eq 0 ] ; then
+	  bindir="$prefix/bin"
+	fi
+	if [ mandirset -eq 0 ] ; then
+	  mandir="$prefix/share/man"
+	fi
 	;;
     --bindir=*)
 	bindir=`echo $opt | cut -d '=' -f 2`
+	bindirset=1
 	;;
     --mandir=*)
 	mandir=`echo $opt | cut -d '=' -f 2`
+	mandirset=1
 	;;
     --disable-curses|--enable-curses)
 	if [ "x$opt" = "x--disable-curses" ] ; then
@@ -893,11 +903,12 @@ EOF
 fi
 
 cat << EOF >> Makefile
+
 PREFIX =	$prefix
 BINDIR =	$bindir
 MANDIR =	$mandir
-PROG =		$instprog
 
+PROG =	$instprog
 OBJS =	alloc.o asprintf.o c_ksh.o c_sh.o c_test.o c_ulimit.o edit.o \\
 	emacs.o eval.o exec.o expr.o history.o io.o jobs.o lex.o mail.o \\
 	main.o misc.o path.o shf.o syn.o table.o trap.o tree.o tty.o var.o \\