From: Akim Demaille Date: Sat, 9 Jun 2001 18:39:12 +0000 (+0000) Subject: * doc/autoconf.texi (Limitations of Builtins): Complete the X-Git-Tag: AUTOCONF-2.50a~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4bfb5fa660400964003071ad6c47452bbed4cd9;p=thirdparty%2Fautoconf.git * doc/autoconf.texi (Limitations of Builtins): Complete the description of the here-docs penalties with Alexandre Oliva's explanations. --- diff --git a/ChangeLog b/ChangeLog index 8920a597e..b9292a2c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-06-09 Akim Demaille + + * doc/autoconf.texi (Limitations of Builtins): Complete the + description of the here-docs penalties with Alexandre Oliva's + explanations. + 2001-06-01 Paul Eggert * doc/autoconf.texi: Talk about here documents and speedups. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 49a3ba6a2..e696841a8 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -5975,6 +5975,39 @@ inefficiently. Users can generally speed things up by using a faster shell, e.g., by using the command @samp{bash ./configure} rather than plain @samp{./configure}. +Some shells can be extremely inefficient when there are a lot of +here-documents inside a single statement. For instance if your +@file{configure.ac} includes something like: + +@example +@group +if ; then + assume this and that +else + check this + check that + check something else + on and on forever +fi +@end group +@end example + +A shell parses the whole @code{if}/@code{fi} construct, creating +temporary files for each here document in it. Some shells create links +for such here-documents on every @code{fork ()}, so that the clean-up +code they had installed correctly removes them. It is creating the +links that the shell can take forever. + +Moving the tests out of the @code{if}/@code{fi}, or creating multiple +@code{if}/@code{fi} constructs, would improve the performance +significantly. Anyway, this kind of construct is not exactly the +typical use of Autoconf. In fact, it's even not recommended, because M4 +macros can't look into shell conditionals, so we may fail to expand a +macro when it was expanded before in a conditional path, and the +condition turned out to be false at run-time, and we end up not +executing the macro at all. + + @item @command{exit} @c ----------------- @cindex @command{exit}