automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 8/8] maint: simplify generation of files with @substed@ stuff


From: Stefano Lattarini
Subject: Re: [PATCH 8/8] maint: simplify generation of files with @substed@ stuff
Date: Sun, 08 Apr 2012 17:50:29 +0200

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,address@hidden@],$(scriptdir),g' \
   -e 's,address@hidden@],$(automake_acdir),g' \
   -e 's,address@hidden@],$(system_acdir),g' \
-  | $(SHELL) ./config.status --file=- )
+## Hack to avoid a spurious substitution in the Automake script (part 1).
+  -e 's,address@hidden@],address@hidden@!!,g' \
+  | $(SHELL) ./config.status --file=- \
+## Hack to avoid a spurious substitution in the Automake script (part 2).
+  | sed -e 's,address@hidden@!!,@''am__isrc@,g' \
+  )

 # Generated  files shouldn't contain unexpanded '@substitutions@', and
 # should be made read-only, to prevent them from being edited by mistake





reply via email to

[Prev in Thread] Current Thread [Next in Thread]