On 04/08/2012 02:55 PM, Stefano Lattarini wrote: > Use a proper "config.status --file=-" idiom to do most substitutions > in our generated files, to avoid too much duplications between the > various $(do_subst) commands in Makefile.am and the (explicit or > implicit AC_SUBST) invocation in configure.ac. > > From a suggestion by Eric Blake and Federico Simoncelli: > <http://lists.gnu.org/archive/html/automake/2012-01/msg00011.html> > > * Makefile.am (do_subst): Rewrite to take advantage of the > "config.status --file=-" idiom. > (generated_file_finalize): New, to help checking that generated > files don't contain unexpanded '@substitutions@', and are made > read-only. > (automake, aclocal): Take advantage of the improved $(do_subst). > Improve comments. > (lib/Automake/Config.pm): Likewise, and of the new variable > $(generated_file_finalize) as well. > ($(top_srcdir)/m4/amversion.m4): Likewise. > (defs-static): Likewise, and depend explicitly on 'Makefile'. > (do_subst_t): Remove as obsolete. > * THANKS: Update. > And consider the hunk below squashed in to avoid a "maintcheck" failure.
Sorry for the noise, Stefano -*-*- diff --git a/Makefile.am b/Makefile.am index 8bf9200..991de4c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,7 +41,12 @@ do_subst = ( sed \ -e 's,[@]scriptdir[@],$(scriptdir),g' \ -e 's,[@]automake_acdir[@],$(automake_acdir),g' \ -e 's,[@]system_acdir[@],$(system_acdir),g' \ - | $(SHELL) ./config.status --file=- ) +## Hack to avoid a spurious substitution in the Automake script (part 1). + -e 's,[@]am__isrc[@],!!@!!am__isrc!!@!!,g' \ + | $(SHELL) ./config.status --file=- \ +## Hack to avoid a spurious substitution in the Automake script (part 2). + | sed -e 's,!!@!!am__isrc!!@!!,@''am__isrc@,g' \ + ) # Generated files shouldn't contain unexpanded '@substitutions@', and # should be made read-only, to prevent them from being edited by mistake