]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
configure: don't infloop when re-executing with $CONFIG_SHELL
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 3 Mar 2012 09:44:25 +0000 (10:44 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 3 Mar 2012 09:44:25 +0000 (10:44 +0100)
It turns out our guard against infinite recursion wasn't good
enough when shells without $LINENO support were involved, since
the creation-and-sourcing of configure.lineno broke the guard's
expectations.  Reports by Tim Rice and Paul Eggert.

* lib/m4sugar/m4sh.m4 (_AS_LINENO_PREPARE): Export '_as_can_reexec'
to "no" before sourcing the just-created configure.lineno.

lib/m4sugar/m4sh.m4

index be013aaaf3a683cfafc6a54cfd2698e21a7e36e7..f05346b7a0e44f8be85d37d9ab0b1f93c2018301 100644 (file)
@@ -1199,6 +1199,10 @@ dnl Eggert wrote the scripts with optimization help from Paolo Bonzini).
   chmod +x "$as_me.lineno"] ||
     AS_ERROR([cannot create $as_me.lineno; rerun with a POSIX shell])
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).