make-alpha
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newline escape problem.


From: Paul D. Smith
Subject: Re: newline escape problem.
Date: Tue, 29 Oct 2002 13:13:01 -0500

%% David Boyce <address@hidden> writes:

  >> According to POSIX, setting the SHELL make variable has _NO_ effect on
  >> make's processing.  The POSIX definition of make requires that all
  >> commands be invoked "as if" passed directly to the system() function,
  >> and there is no way to specify that the system() function would use a
  >> different shell than the standard sh, of course.

  >> The standard handles SHELL specially such that it doesn't inherit that
  >> value from the environment nor put any make value for that variable back
  >> into the environment of subcommands, but neither does it provide for
  >> make to use the command provided by $(SHELL) rather than system() (or
  >> sh).

  db> Could you cite the relevant C&V please? I don't have access to
  db> POSIX.1 (unless it's become freely available since I last looked?)
  db> but SUSv3 says only this:

  db>       The SHELL macro shall be treated specially. It shall be provided by
  db>       make and set to the pathname of the shell command language
  db>       interpreter (see sh ). The SHELL environment variable shall not
  db>       affect the value of the SHELL macro. If SHELL is defined in the
  db>       makefile or is specified on the command line, it shall replace the
  db>       original value of the SHELL macro, but shall not affect the SHELL
  db>       environment variable. *Other effects of defining SHELL in the
  db>       makefile or on the command line are implementation-defined.*

  db> (emphasis mine). Does POSIX flatly contradict this? Surprising if
  db> true. And are you looking at a new or relatively old rev of POSIX?

No, this is what I mean.

I guess I wasn't quite clear above: I didn't mean that POSIX disallowed
what GNU make (and other makes) do with the SHELL variable.

I only meant that POSIX doesn't _require_ that setting SHELL would change
the way commands were invoked.

And in fact, elsewhere in the make standard it says explicitly:

  Command execution shall be as if the makefile command line were the
  argument to the system() function.

I suppose you could still do something like this:

  system("$(SHELL) -c <command>");

and be conforming :).

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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