plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

commit e683bdfa76a5c2c54422a6bd2934b133d77ba610
parent d3ee9f70e4ee00bd12557910c9e3dcc1fabd53c7
Author: Dan Cross <cross@gajendra.net>
Date:   Sun,  3 Oct 2021 19:19:51 +0000

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>

Diffstat:
Msrc/cmd/mk/shell.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/cmd/mk/shell.c b/src/cmd/mk/shell.c @@ -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);