Re: Make on XP - shell selection?

Eli Zaretskii <[email protected]>
Newsgroups gmane.comp.gnu.make.windows
Message-ID <[email protected]>
> From: "grischka" <[email protected]>
> Date: Fri, 19 Oct 2007 19:55:54 +0200
> Cc: [email protected]
> 
> It is one of gmake's undocumented non-features with SHELL on 
> windows.

I always wonder why people feel a need to post such derogatory
comments.  Is there some kind of satisfaction in it?

> I don't know who benefits from it but so far nobody dared to
> document it, either.

I'm not sure it should be documented: the Windows port just behaves
the same as the Unix original.  Here's the relevant fragment executed
by Make on Unix (job.c, around line 2100):

# ifdef __EMX__
	...
# else
	shell = getenv ("SHELL");
# endif
	if (shell == 0)
	  shell = default_shell;

and default_shell is "/bin/sh" on Unix, see line 74 in the same file.

The same is done around line 2355 in job.c:

  if (shell == 0)
    shell = default_shell;

Granted, the code in the Windows port that does the equivalent is more
complicated, but the net effect, as far as user is concerned, is the
same: sh.exe is used if it is available.

> Certainly it conflicts with the general rule that for makefile 
> portability reasons the SHELL to be used shall not depend on 
> individual environment settings.

The OP's report was not about SHELL in the environment, it was about
setting SHELL in the Makefile.  Certainly, you won't claim that Make
ignores _that_ on Unix, would you?

And if by ``individual environment settings'' you mean the value of
PATH, then I don't see how Make can do better, since, unlike on Posix
platforms, there's no "/bin" directory on your garden-variety Windows
box.  So it looks along PATH, which is a reasonable thing to do, IMO.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.