This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: libstdc++ configure time


On Mon, Mar 19, 2001 at 11:31:13AM -0800, Richard Henderson wrote:
> On Mon, Mar 19, 2001 at 07:42:22PM +0100, Andreas Schwab wrote:
> > XSI-conformat echo both recognizes no options and always interprets
> > escape sequences.
> 
> 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:

changequote([,])dnl
define(echo_with_sed, 
[sed 's/^$/patsubst(patsubst([$1], [[\\/&]], [\\\&]), ['], ['\\''])/' dummy])dnl
# I tried to make this work with /dev/null but failed.
echo >dummy
echo_with_sed([foo & bar \ baz])
echo_with_sed([[#]define TICK '\''])
echo_with_sed([[#]define NEWLINE '\n'])
echo_with_sed([[#]define PACKAGE "gcc-4.37"])
rm dummy

Getting shell variables substituted is not terribly harder, but the
variables can't contain any sed magic characters.  

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]