bug-autoconf
[Top][All Lists]
Advanced

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

Re: echo vs. printf regression (darwin8)


From: Paolo Bonzini
Subject: Re: echo vs. printf regression (darwin8)
Date: Sun, 15 Aug 2010 21:06:56 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.0.5

On 08/15/2010 09:05 PM, David Fang wrote:

On 08/15/2010 06:59 PM, David Fang wrote:
The ECHO that is chosen by autoconf on darwin8 (printf %s\n) is buggy:

fangism % printf %s\n foo
foonfangism% printf '%s\n' foo
foo

Must be due to the version of the Bourne shell (2.05b).
Failure is similar with sh-3.2.
The 'correct' value of ECHO should be printf '%s\n' (note the extra
single quote protection).
I don't know yet whether that is forward-compatible with newer versions
of Bourne shell.

Don't recall which version of autoconf broke this, betweem 2.63 and
latest.

The problem seems to be in the way that "printf '%s\n'" is assigned to
as_echo.

I've tried to hack config.status with quote-protections and escapes:

ECHO='printf "%s\n"'
ECHO='printf %s\\n'

(and tried hacking the generated 'configure')

But the substitution process (uses some creative sed magic) during
AC_OUTPUT keeps destroying the result.

Yes, the problem is in how $ECHO is then "unquoted" by the shell. We should really use a shell function for echo (and printf for echo -n) instead.

Paolo



reply via email to

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