autoconf-patches
[Top][All Lists]
Advanced

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

Re: proposed Autoconf patch so that "configure" need not use Awk


From: Akim Demaille
Subject: Re: proposed Autoconf patch so that "configure" need not use Awk
Date: 31 Oct 2001 15:28:53 +0100

| We've now established that this issue is not urgent and is irrelevant
| to Autoconf 2.53, but I still want to persist in suggesting that we
| not use Awk in "configure", for three reasons:
| 
| 1.  The GNU Coding Standards suggest that we not use Awk.

IMHO this is wrong from the portability point of view.  But GCS is not
about stating the truth, just stating about the GCS so it's right by
definition, agreed.

| 2.  If we don't use Awk, it's one less program to worry about while
| porting.

Sorry, but I somewhat disagree with this statement: escaping from
adequate tools forces us to strech our uses of other tools much
further.  In particular, I'm not sure you didn't escape portable uses
of Awk and Sed to fall into nonportable sed uses.

| 3.  In this case the non-Awk version is simpler and easier to understand.

Not MHO :)

| (2) has been a problem with Autoconf before.  Long ago, autoconf used
| to use Awk to generate config.h, but Autoconf 1.3 removed the need for
| Awk.  This fix was installed on Dec 18 00:21:23 1992 by djm (patch
| from Ian Lance Taylor) and was presumably done for a good reason.

Arg, you beat me here, nothing to answer to that.

| Both commands work, but the Sed version is shorter and easier to follow,
| assuming you know both Awk and Sed.

OK, I'm convinced.


| +  # uniformly replaced by the line number.
| +  sed '=' <$as_myself |
| +    sed '
| +      N
| +      s/$/ /
| +      : loop
| +      s/^\([[0-9]]*\)\(.*\)[[$]]LINENO\([[^a-zA-Z0-9_]]\)/\1\2\1\3/
| +      t loop
| +      s/ $//
| +      s/.*\n//
| +    ' >$as_me.lineno &&

Wow.  I never played with multiline pattern spaces.  I trust you about
the portability of s/.*\n//, but I don't understand well how this
script works.  In particular, it is not clear to me who ^ and $ are:
the usual ones, or they refer to the beginning and end of the pattern
space.

In any case, I'm surprised by s/ $//;s/.*\n//.  I would be less
surprised, I guess, with s/ $//g;s/.*\n//.
                               ^



reply via email to

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