Hello, On Wed, Oct 19, 2005 at 11:32:37AM +0200, Ralf Wildenhues wrote: > I believe what Stepan meant was: > If the status.m4 code encounters [EMAIL PROTECTED]@@\n@', where `FOO' has > been > AC_SUBSTed, then treat the replacement of the complete string > [EMAIL PROTECTED]@@\n@' in a special way.
not exactly. It is like this: 1) each occurence of @VAR@ is replaced by the value of VAR, for each AC_SUBSTed variable VAR. 2) if the original line matched /@[EMAIL PROTECTED]/, then - this match is removed - each embedded newline is esaped by a backslash - if the resulting string ends with a backslash, space is appendeded In other words, after the usual sed substtitutions, the following sed code is executed: /@[EMAIL PROTECTED]/ { s/\n/\\&/g s/@[EMAIL PROTECTED]// s/\\$/& / } > [...] unless an actual implementation can be shown not to > show execution time regression inside config.status. The above proposal is suited for this. (Having "@FOO\n@" for "flattened value of FOO" might look nicer, but effective implementation would be more difficult, if possible. The facts that the magical tag means "the whole line is flattened" and that the tag is at the end of the line enable easy effective implementation.) > If you accept that fact, you might as well flatten the variable before > substituting it. That would be more difficult, without any hint from outside. The @\n@ tag enables an implementation which presents only minimal regression in terms of execution time and size of config.status. Moreover: If the makefile contains FOO = foo\ bar then the value of make macro foo contains no newline, right? So it is almost equivalent to FOO = foo bar with one subtle difference: if autoconf "flattens" the variable, it is possible that the line would get too long, which could cause problems. Actually, there is a report that LIBOBJ can get too long with latest autotools and heavy gnulib usage: http://lists.gnu.org/archive/html/bug-autoconf/2005-09/msg00037.html I plan to solve that problem by making the value of LIBOBJS multiline, which, of course, needs the "backslashes". > [...] it also means that any occurrence of > @FOO@ > in a Makefile.in will be substituted by $FOO_FLATTENED rather than $FOO, That doesn't sound like a good idea. I think that one of the motivations for multiline substitutions was that we can AC_SUBST multiline make rules. Cheers, Stepan