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 Mar 20, 2001, Richard Henderson <rth@redhat.com> wrote:

> On Tue, Mar 20, 2001 at 02:21:10AM -0300, Alexandre Oliva wrote:
>> Of course, if the string is a literal, you can get m4 to do the
>> transformation for you ...

> Which is what I've been doing.

>> ... but sometimes you don't have a string literal.

> That's true, I hadn't considered shell variables expanding
> to echo meta characters.  Well, I think that's rare enough
> that we can stand to outlaw it for normal practice.

Perhaps for GCC, but certainly not in autoconf.

Anyway, the only situation in which here documents are so much
expensive is when there are lots of them within a single top-level
command.  For example, if you have:

if something; then
  command << EOF
...
EOF

  another_command << EOF
...
EOF
fi

when the shell parses the whole command, it creates one file per here
document, and keeps them until the end of the top-level command.

The easy solution is to move commands containing here documents to the
top level, os that you never get more than a handful of here documents
at any time.

Of course, arranging for autoconf to reduce the usage of here
documents is certainly going to be a win.  It's certainly not too hard
to do.  But it's something that should probably be discussed in the
autoconf mailing list, not here :-)

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


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