Eric Blake wrote:
Steven R. Loomis <srl <at> icu-project.org> 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_cr='
'
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
ac_cs_awk_cr='\\r'
else
ac_cs_awk_cr=$ac_cr
fi
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:
http://lists.gnu.org/archive/html/autoconf-patches/2008-04/msg00007.html
-steven
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf