[Top][All Lists]

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

Re: doc make "set -e" execution

From: Paul Eggert
Subject: Re: doc make "set -e" execution
Date: Sun, 16 May 2004 22:04:16 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Kevin Ryde <address@hidden> writes:

> What's the procedure for checkins these days?  Is anyone giving
> approvals, or for uncontroversial stuff can I just wait a polite
> interval then go ahead?

Traditionally we like to have two people saying "yes" (typically one
person is the submitter) with no "no"s.  For noncontroversial stuff
like yours, though, your procedure is fine, though it's better to send
it in diff -u format.  I installed this patch, which is worded a bit
differently from yours but I hope communicates the same idea.

2004-05-16  Paul Eggert  <address@hidden>

        * doc/autoconf.texi (Limitations of Make): Note that BSD make
        (until 2004) invoked subcommands with sh -e, contra POSIX.
        Reported by Kevin Ryde.

Index: autoconf.texi
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.812
retrieving revision 1.814
diff -p -u -r1.812 -r1.814
--- autoconf.texi       10 May 2004 18:54:25 -0000      1.812
+++ autoconf.texi       17 May 2004 05:01:45 -0000      1.814
@@ -11608,12 +11608,26 @@ of which are listed here.  First of all,
 are executed by the shell, all its weaknesses are address@hidden
 @table @asis
 @item @code{$<}
 @acronym{POSIX} says that the @samp{$<} construct in makefiles can be
 used only in inference rules and in the @samp{.DEFAULT} rule; its
 meaning in ordinary rules is unspecified.  Solaris 8's @command{make}
 for instance will replace it with the empty string.  OpenBSD (3.0 and
 later) @command{make} will diagnose these uses and error out.
address@hidden Command execution
+Since 1992 @acronym{POSIX} has required that @command{make} must invoke
+each command with the equivalent of a @samp{sh -c} subshell.  However,
+many @command{make} implementations, including BSD make through 2004,
+use @samp{sh -e -c} instead, and the @option{-e} option causes the
+subshell to exit immediately if a subsidiary simple-command fails.  For
+example, the command @samp{touch T; rm -f U} will always attempt to
+remove @file{U} with @acronym{POSIX} make, but incompatible
address@hidden implementations skip the @command{rm} if the
address@hidden fails.  One way to work around this is to reword the
+affected simple-commands so that they always succeed, e.g., @samp{touch
+T || :; rm -f U}.
 @item Leading underscore in macro names
 Some @command{make}s don't support leading underscores in macro names,

reply via email to

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