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: David Fang
Subject: Re: echo vs. printf regression (darwin8)
Date: Sun, 15 Aug 2010 15:26:07 -0400 (EDT)

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.

My autotoolized projects all use $(ECHO) in Makefile{.am} inside the target scripts. Everything that would normally use 'echo' is dying horribly, especially constructs like: var=`$(ECHO) ...`. Can you suggest a temporary work-around until that is fixed?
either at configure-time or post-configure-time?

I'm desperate enough to use sed to patch config.status after it's been generated:
        ECHO='printf %s\n'
with
        ECHO='echo'
to get the old behavior.

Fang

David Fang
http://www.csl.cornell.edu/~fang/
http://www.achronix.com/




reply via email to

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