Hi Eric. On 01/12/2012 08:16 PM, Eric Blake wrote: > I was chatting with Federico on IRC about a way to avoid duplication > between Makefile.am and configure.ac. His particular case had a script > file that wanted a few full substitutions (which implies a make-time > substitution, per [1]), but he didn't want to have to copy the whole > list of AC_SUBST from configure.ac into Makefile.am in his do_subst > script, and didn't want to build a file.in.in that goes through > configure AC_CONFIG_FILES only to have file.in then go through a > make-time expansion. We came up with the autoconf-documented use of > $(top_builddir)/config.status --file=- (from [2]). > Thanks for the link, I wasn't aware of this feature.
> And to demonstrate the ease of use, I've done this preliminary patch > against automake itself. > I like the idea. Thanks for working on this! > Is this something we are interested in doing (since it _does_ provide a > reduced maintenance burden, where adding a new AC_SUBST that does not > need make-time expansion can now be done in just one file instead of > two)? And if so, should I expand this RFC patch into something that > passes the testsuite as well as mentioning it in the automake manual? > [For the purposes of my quick test, I started a 'make check', > About this: note that a mere "make check" might not catch all the possible blunders, since the testsuite by default uses wrapper scripts that redefine various internal directories affected by AC_SUBST (e.g., the directories where automake looks for *.am fragments and for its extra perl libraries, and the directories where aclocal looks for *.m4 files by default). You'd be probably better off trying with "make installcheck" (unfortunately available only in master), which is more faithful in this regard. > still underway as I type, and noticed that at least aclocal5.test failed, > but everything else through f90only.test is happy so far. But I won't > bother to investigate failures unless we decide to go forward with this > plan.] > > [1] https://www.gnu.org/software/automake/manual/html_node/Scripts.html > [2] > https://www.gnu.org/software/autoconf/manual/autoconf.html#config_002estatus-Invocation > > > diff --git i/Makefile.am w/Makefile.am > index 8fe9c0f..0ef39c1 100644 > --- i/Makefile.am > +++ w/Makefile.am > > [SNIP CODE] > Have you considered doing something similar also for the recipe for the creation of `tests/defs-static' in master? That would be useful as well. Thanks, Stefano
