make-w32
[Top][All Lists]
Advanced

[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 13:50:16 +0300

> Date: Fri, 29 Jul 2005 11:18:57 -0700
> From: Jonathan Baccash <address@hidden>
> Cc: Eli Zaretskii <address@hidden>, address@hidden
> 
> $(warning SHELL=$(SHELL))
> dummy := $(shell echo 'a|b')
> SHELL := cmd.exe
> export SHELL
> $(warning SHELL=$(SHELL))
> dummy := $(shell echo 'a|b')
> 
> .PHONY: all
> all:
>       echo %SHELL%
>       echo 'a|b'
> 
> This is what my session looks like:
> 
> 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
> 
> As you can see, at line 5, the SHELL variable has not been updated,
> but at line 6, the correct shell is spawned or simulated (compare the
> error output to the non-error at line 2 -- the pipe sign is inside
> single quotes, which is all part of the argument for sh.exe shell).

Can you try to figure out why cmd.exe is used although SHELL is set to
the MKS shell?  It looks like your diagnosis is correct, and
main.c:754 should be changed to set sh_found=1, but I'm worried by the
fact that somehow the value of SHELL is not being used.  Perhaps
that's a different bug, but if we don't find and fix it, your original
problem might not go away.

> Also notice that make thinks its name is "ake"... I think I remember
> this bug is perhaps already fixed?

Yes, it's already fixed in the CVS.

> Can I reasonably expect SHELL to be set to what I want to set it to? 

Yes, although in the Windows port there are some quirks if you set
SHELL to something non-standard (standard values include cmd.exe and
the Unix-style sh).

> I am not a big fan of all the strange behavior on Windows.

This strange behavior is supposed to produce behavior that is
reasonable under both Windows-style shell and Unix-style shell.  That
is not an easy goal to achieve, so if you have more gripes about it,
please tell.

Incidentally, what, if any, changes did you make near the end of
config.h.W32?  Did you, for example, reset the value of
BATCH_MODE_ONLY_SHELL, or set HAVE_MKS_SHELL?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]