diff options
author | green <green@FreeBSD.org> | 2000-08-16 23:31:43 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 2000-08-16 23:31:43 +0000 |
commit | dc14c5e4fd05e3b9cfa3c48ed029ab111dd48329 (patch) | |
tree | cc0e62b51ed1e79e231d912ec8759b2cd884047f /usr.bin/make/main.c | |
parent | d5af96afa040e66ed2df0eeeb0dc4ec7349132cc (diff) | |
download | FreeBSD-src-dc14c5e4fd05e3b9cfa3c48ed029ab111dd48329.zip FreeBSD-src-dc14c5e4fd05e3b9cfa3c48ed029ab111dd48329.tar.gz |
Allow use of the ${MAKE_SHELL} variable to specify alternate shells for
make(1) to use. Setting it to "sh" and "ksh" are the only values which
work right ATM; I wouldn't expect "csh" to get you far ;)
Diffstat (limited to 'usr.bin/make/main.c')
-rw-r--r-- | usr.bin/make/main.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 9530a0e..2694eed 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -478,6 +478,13 @@ main(argc, argv) /* avoid faults on read-only strings */ static char syspath[] = _PATH_DEFSYSPATH; +#if DEFSHELL == 2 + /* + * Turn off ENV to make ksh happier. + */ + unsetenv("ENV"); +#endif + #ifdef RLIMIT_NOFILE /* * get rid of resource limit on file descriptors @@ -1000,7 +1007,13 @@ Cmd_Exec(cmd, err) (void) dup2(fds[1], 1); (void) close(fds[1]); +#if DEFSHELL == 1 (void) execv("/bin/sh", args); +#elif DEFSHELL == 2 + (void) execv("/bin/ksh", args); +#else +#error "DEFSHELL must be 1 or 2." +#endif _exit(1); /*NOTREACHED*/ |