Viewing Issue Simple Details
[ Jump to Notes ]
|
[ Issue History ]
[ Print ]
|
ID |
Category |
Severity |
Type |
Date Submitted |
Last Update |
0000769 |
[1003.1(2013)/Issue7+TC1] Shell and Utilities |
Objection |
Enhancement Request |
2013-10-14 16:47 |
2019-06-10 08:55 |
|
Reporter |
dwheeler |
View Status |
public |
|
Assigned To |
ajosey |
Priority |
normal |
Resolution |
Accepted As Marked |
|
Status |
Closed |
|
|
|
|
Name |
David A. Wheeler |
Organization |
|
User Reference |
|
Section |
make |
Page Number |
2939-2942 |
Line Number |
97180-97327 |
Interp Status |
--- |
Final Accepted Text |
See Note: 0001986 |
|
Summary |
0000769: Add support for SHELL in make |
Description |
POSIX make can currently only invoke some unspecified Bourne shell (sh). This is very limiting; users may want to use a different program to interpret actions. Most POSIX systems allow users to select their interactive shell, and use a variety of interpreters; make should do the same.
Many “make” systems allow users to use an alternative shell. As noted in line 97755, this is even true of historic makes through MAKESHELL (omitted because it was always passed in through the environment, creating potential problems). In GNU make and makepp, this is done by setting the SHELL make macro (in the makefile or on the command line); the macro .SHELLFLAGS provides the flags. In some cases at least, GNU make also pays attention to MAKESHELL (though the conditions it does are not clear in the documentation). In the *BSD makes, this is done by using .SHELL and a variety of special-cased targets of the form key=value, e.g., “.SHELL: path=PATH_VALUE”; this is an unusual format, and it does not seem to support resetting the shell value from the command line.
The current POSIX specification already anticipates this special use of SHELL (e.g., in lines 97080-97081). In POSIX, the SHELL value is not passed in from the environment, but instead must be specially set. The Below I propose to standardize this existing use of SHELL. This is combines nicely with .ONESHELL, but .ONESHELL is a different issue so I plan to submit that separately.
(The page and line numbers given here are for the "Open Group Standard
Base Specifications, Issue 7, 2013 Edition".)
|
Desired Action |
Replace the following text beginning on line 97182: “The execution line shall then be executed by a shell as if it were passed as the argument to the system( ) interface, except that if errors are not being ignored then the shell −e option shall also be in effect. If errors are being ignored for the command (as a result of the −i option, a ’−’ command prefix, or a .IGNORE special target), the shell −e option shall not be in effect.”
with this text: “The execution line shall then be executed by a shell. If SHELL is not set as a macro or on the command line, or if the macro or command line value is set to the special values “sh” or “/bin/sh”, then standard shell execution is in effect. In standard shell execution, the command line is treated as if it were passed as the argument to the system( ) interface, except that if errors are not being ignored then the shell −e option shall also be in effect. In standard shell execution, if errors are being ignored for the command (as a result of the −i option, a ’−’ command prefix, or a .IGNORE special target), the shell −e option shall not be in effect. If standard shell execution is not in effect, then the commands are treated as if they were placed in some file temporary_file, and then running $(SHELL) $(.SHELLFLAGS) temporary_file.”
Also, beginning line 97326, delete the sentence “Other effects of defining SHELL in the makefile or on the command line are implementation-defined.”
|
Tags |
tc2-2008 |
|
Attached Files |
|
|