mk: provide a mechanism to default to rc

For cross-compiling plan9 from Unix, provide a way
to force `mk` to use `rc` instead of `sh` without
setting `MKSHELL` in individual `mkfile`s.

If the environment variable `FORCERCFORMK` is set,
`mk` will default to using `rc`, not `sh`.

Signed-off-by: Dan Cross <cross@gajendra.net>
This commit is contained in:
Dan Cross 2021-10-03 19:19:51 +00:00 committed by Dan Cross
parent d3ee9f70e4
commit e683bdfa76

View file

@ -41,6 +41,8 @@ setshell(Word *w)
void
initshell(void)
{
if(getenv("FORCERCFORMK") != nil)
shelldefault = &rcshell;
shellcmd = stow(shelldefault->name);
shellt = shelldefault;
setvar("MKSHELL", shellcmd);