This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++ configure time
On Mon, Mar 19, 2001 at 05:23:50PM -0800, Richard Henderson wrote:
> On Mon, Mar 19, 2001 at 02:54:39PM -0800, Zack Weinberg wrote:
> > > Well then perhaps we can use ed or something. Or do like
> > > perl and build our own echo. *Anything* but here documents.
> >
> > Department of disgusting hacks:
>
> Yep, that's disgusting. But you ain't seen nothing yet.
>
> I want to continue to use echo as much as possible because it is a
> shell builtin most places. But of course we have to watch out for
> the escape character cases and transform them into something else.
Makes sense.
> In most cases we'll be able to just change \ to @ in the echo text
> and use tr to revert the change. If both \ and @ appear in the
> original text, then a more complicated transformation is required
> in order to recover the original.
>
> The following handles all of the cases I could think of. I've come
> to the un-stunning conclusion that I absolutely lothe m4, and can't
> figure out why anyone would willingly use it.
I think this can be written more readably, will play with it a bit.
I'm nervous about using changequote in the middle of a macro - every
time I've tried that it's either caused infinite recursion or 'end of
file inside macro argument'.
The only further case I can think of is
AC_APPEND_FILE_Q(confdefs.h, -n)
which winds up as
echo '-n' >>confdefs.h
and obviously does not do the expected thing with a BSD echo. Bash's
echo also knows -e and -E ... basically we need to escape dash if it's
the first character being fed to echo. I think I see how to add that
to the mess.
zw