]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Document sh -e problem with subcommands.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 17 May 2004 04:56:48 +0000 (04:56 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 17 May 2004 04:56:48 +0000 (04:56 +0000)
ChangeLog
doc/autoconf.texi

index d1d92e644b4884d3af18d010a1e63a732c316365..f2a9fb7208bbe7eeadd27e16bfea9a8ee01eff2c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * doc/autoconf.texi (Limitations of Make): Note that BSD make
+       (until 2004) invoked subcommands with sh -e, contra POSIX.
+       Reported by Kevin Ryde.
+
 2004-05-10  Eric Sunshine  <sunshine@sunshineco.com>
 
        * programs.m4 (_AC_PROG_GREP): Fixed bug where PATH argument handed to
index a2420575adcbebcbd2982d3f5254aa7e538b41be..0bdc972ced85d929fb14c9fb584084ebaedc2527 100644 (file)
@@ -11608,6 +11608,7 @@ of which are listed here.  First of all, remember that since commands
 are executed by the shell, all its weaknesses are inherited@enddots{}
 
 @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
@@ -11615,6 +11616,19 @@ 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.
 
+@item Command execution
+Since 1992 @acronym{POSIX} has required that @command{make} must invoke
+each command with the equivalent of @samp{sh -c} subshell.  However,
+many @command{make} implementations, including BSD make through circa
+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
+@command{make} implementations skip the @command{rm} if the
+@command{touch} 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,
 such as on NEWS-OS 4.2R.