[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: setting SHELL variable
From: |
Eli Zaretskii |
Subject: |
Re: setting SHELL variable |
Date: |
Sat, 30 Jul 2005 18:49:53 +0300 |
> Date: Sat, 30 Jul 2005 17:32:39 +0300
> From: Eli Zaretskii <address@hidden>
> Cc: address@hidden
>
> > Z:\makeutil\test\t1> Z:\gnumake\win32\make.exe
> > Makefile:1: SHELL=C:/mks/mksnt/sh.exe
> > Makefile:5: SHELL=C:/mks/mksnt/sh.exe
> > 'b'' is not recognized as an internal or external command,
> > operable program or batch file.
> > echo %SHELL%
> > C:/mks/mksnt/sh.exe
> > echo 'a|b'
> > 'b'' is not recognized as an internal or external command,
> > operable program or batch file.
> > ake: *** [all] Error 255
>
> Actually, I just built a Windows binary of Make 3.81beta3 (using
> MinGW), and I cannot reproduce this output, unless I manually remove
> or rename my sh.exe. So please tell more about your environment; in
> particular, do you really have C:/mks/mksnt/sh.exe?
Found the problem. First, main.c was not setting default_shell if it
was requested to use cmd.exe and found it. The other piece of the
puzzle was in job.c: it incorrectly used no_default_sh_exe to decide
whether to use Unixy or DOSish built-in commands. Please see if the
two patches below fix your problem.
I still think that your MKS sh.exe did not exist, or was renamed, when
you ran the above test. Could you please confirm that?
2005-07-30 Eli Zaretskii <address@hidden>
* main.c (find_and_set_default_shell): If found a DOSish shell,
set sh_found and the value of default_shell, and report the
findings in debug mode.
* job.c (construct_command_argv_internal): Check unixy_shell, not
no_default_sh_exe, to decide whether to use Unixy or DOSish
builtin commands.
--- main.c~1 2005-07-30 17:22:26.817500000 +0300
+++ main.c 2005-07-30 18:02:58.395625000 +0300
@@ -751,7 +751,11 @@ find_and_set_default_shell (char *token)
&& !strcmpi (tokend - 4, "cmd.exe"))) {
batch_mode_shell = 1;
unixy_shell = 0;
- sh_found = 0;
+ sprintf(sh_path, "%s", search_token);
+ default_shell = xstrdup(w32ify(sh_path,0));
+ DB (DB_VERBOSE,
+ (_("find_and_set_shell setting default_shell = %s\n"), default_shell));
+ sh_found = 1;
} else if (!no_default_sh_exe &&
(token == NULL || !strcmp (search_token, default_shell))) {
/* no new information, path already set or known */
--- job.c~1 2005-07-30 16:57:16.755000000 +0300
+++ job.c 2005-07-30 18:27:04.161250000 +0300
@@ -2274,7 +2274,7 @@ construct_command_argv_internal (char *l
#ifdef WINDOWS32
int slow_flag = 0;
- if (no_default_sh_exe) {
+ if (!unixy_shell) {
sh_cmds = sh_cmds_dos;
sh_chars = sh_chars_dos;
} else {