]> git.ipfire.org Git - thirdparty/automake.git/commit
[ng] memoize: correctly work around a bug of GNU make < 3.83
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 15 May 2012 10:36:37 +0000 (12:36 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 15 May 2012 15:20:54 +0000 (17:20 +0200)
commit62f2e2d5860aa44d9a70eaef70b130580a3f62a0
treee27b7b22e0496efa49a8623120e41143ca29b530
parent99cb72ef8aec065d712ccafb5f434c5da9f980b8
[ng] memoize: correctly work around a bug of GNU make < 3.83

This is a follow-up to commit v1.12-218-g34a7d42 of 2012-05-15,
"[ng] memoize: expose a serious bug (affecting GNU make < 3.83)".

We implement a new workaround aimed at avoiding the subtle GNU make
bug affecting variable memoization:

  <http://lists.gnu.org/archive/html/bug-make/2012-05/msg00013.html>
  <https://savannah.gnu.org/patch/?7534>

Since that bug basically prevents dynamically reassigning to a variable
inside the expansion of the variable itself, we reimplement memoization
by having the memoized variable expanding to an $(if) branching either
to evaluate-and-store in *another* memo variable, else to the value of
that memo variable.

The new workaround works also in the situation that was causing our
previous workaround (as implemented in commit v1.12-217-gd55204f of
2012-05-12, "[ng] vars: implement memoization of make variables (new
'am__memoize' func)") to fail.

Approach suggested by Akim Demaille:
<http://lists.gnu.org/archive/html/automake-ng/2012-05/msg00074.html>
and coded by Stefano Lattarini.

* lib/am/header-vars (am__memoize): Change API and implementation.
(am__memoize_0): Delete, it's not needed anymore.
* t/memoize.tap: Update to new API, also removing checks that makes no
more sense with it.
* t/spy-override.sh: Delete, it's not needed anymore.

Co-authored-by: Akim Demaille <akim@lrde.epita.fr>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/am/header-vars.am
t/memoize.tap
t/spy-override.sh [deleted file]