[Top][All Lists]

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

Re: revisit: bare carriage return in status.m4 / configure

From: Steven R. Loomis
Subject: Re: revisit: bare carriage return in status.m4 / configure
Date: Mon, 27 Oct 2008 15:54:41 -0700
User-agent: Thunderbird (Macintosh/20080914)

Eric Blake wrote:
Steven R. Loomis <srl <at>> writes:
That works only on ASCII based platforms, and it requires tr (which wasn't formerly required, according to the thread quoted below).

Autoconf is already a significant client of tr (for example, look at the output of AC_CHECK_HEADERS). We need to submit a bug report against standards.texi that adds tr to the list of approved programs. But using tr in config.status is not an issue.
That's good to know.  Sorry about the top-posting.
The problem that config.status has to work around is that not all awk and sed recognize the \r escape sequence; for those that don't, the use of a literal ^M in the configure/config.status was deemed workable at the moment. On the other hand, our use of raw ^M is ASCII-agnostic:

ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then

If we change $ac_cr to be \015, then $ac_cs_awk_cr will likewise be \015 in the case where the \r escape sequence didn't work (and if it did work, then we know \r and \015 are equivalent). So, whether or not \015 is carriage return in the current encoding, we are doing an idempotent replace.

I agree that using raw ^M in a portable script comes with its own set of portability problems, therfore I will commit a patch that switches over to tr in the near future. Thanks Steven for the report, and Thomas for the patch idea.
You are welcome, and thanks for looking into this.

Note previous similar suggestion here:


reply via email to

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