autoconf
[Top][All Lists]
Advanced

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

Re: multiline output variables.


From: Dan Manthey
Subject: Re: multiline output variables.
Date: Wed, 9 Feb 2005 13:39:24 -0500

Okay, hopefully this is the last version of this patch, finally.

On Wed, 9 Feb 2005, Stepan Kasal wrote:

> > > m4_define([_AC_SED_CMDS],m4_defn([_AC_SED_CMDS])[| sed 's/|#_!!_#|//g' ])
>
> Thank you for explaining me this.
>
> This line appears twice in the source, though.
> Can't the duplication be elimited?  Wouldn't it make the code cleaner?
        I find that there are in fact times were duplicating a line is
actually easier than finding some control structure that causing the line
to be evaluated in more than one case.  If you see a way to remove the
duplication, more power to you.  I was getting lazy.

> But it might be better to leave the last segment as
> >       /@word@/!b end
> >       :end
> >       s/empty//g
> if that would simplify the m4 code.  But if you don't want to implement
> it, let it be for now.  (Perhaps I'll write a patch later.)
        Be my guest.

> >   for ac_last_try in false false :; do ...
> > so that the break-out step avoids one more call to test.
>
> Nice. (Though test should be builtin, so there is no difference.)
> Wouldn't    for ac_go_baby_go : : : : : : false; do ...
> be even nicer?  ;-)
        And I thought I was getting silly.

I've incorporated the fixes pointed out my Noah, and also the use of
m4_incr.  Apparently my short-term memory is going; I forgot about that
macro.

By the way, Noah pointed out that grep -q wasn't portable.  This is not
mentioned in the autoconf docs.  The manual says "The Bourne shell and
upward-compatible shells like the Korn shell and Bash have evolved over
the years, but to prevent trouble, do not take advantage of features that
were added after UNIX version 7, circa 1977."  I'm guessing that I'm not
the only one who doesn't actually know what features this means; I
certainly have never seen a manual from then.  (In fact, that was the year
I was born, so....)  Is there any place that it is documented what
features are acceptible?  Is the solution just to keep adding notes to the
autoconf docs?  It Would Be Nice(tm) if there were a set of man pages that
documented portable operation of all the tools that are available to
portable shell code.

-Dan

Attachment: multi.diff
Description: Text document


reply via email to

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