]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi (Limitations of Builtins): Complete the
authorAkim Demaille <akim@epita.fr>
Sat, 9 Jun 2001 18:39:12 +0000 (18:39 +0000)
committerAkim Demaille <akim@epita.fr>
Sat, 9 Jun 2001 18:39:12 +0000 (18:39 +0000)
description of the here-docs penalties with Alexandre Oliva's
explanations.

ChangeLog
doc/autoconf.texi

index 8920a597e5782046c2116feeb07424a4582289af..b9292a2c7838d5d537763c72fc9feec5ec1eea51 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-06-09  Akim Demaille  <akim@epita.fr>
+
+       * doc/autoconf.texi (Limitations of Builtins): Complete the
+       description of the here-docs penalties with Alexandre Oliva's
+       explanations.
+
 2001-06-01  Paul Eggert  <eggert@twinsun.com>
 
        * doc/autoconf.texi: Talk about here documents and speedups.
index 49a3ba6a236609c8b842281371bd5e7d5e878054..e696841a80f643feda6865b0cdda0e09fb9f5fea 100644 (file)
@@ -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 <cross_compiling>; 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}