[Top][All Lists]

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

Re: Autoconf Data Representation

From: Paul Eggert
Subject: Re: Autoconf Data Representation
Date: Wed, 5 Dec 2001 11:47:24 -0800 (PST)

> From: Ryan Collins <address@hidden>
> Date: Wed, 5 Dec 2001 03:35:25 -0500 (EST)
>    @INSTALL_atom@ -->  "/usr/bin/install -c"
>    @INSTALL_list@ -->  '("/usr/bin/install" "-c")

An interesting idea.  Hmm, wouldn't it be better to use a syntax that
doesn't infringe on the user name space?  Also, something where the
terminology isn't scsh-specific, and where the semantics are easier to
grok instantly.  For example, how about using the following syntax

@INSTALL@ --> /usr/bin/install -c
@"INSTALL"@ -> "/usr/bin/install -c"
@("INSTALL")@ -> ("/usr/bin/install" "-c")

> I think it'd probably be useful to include something like this in
> the next version of autoconf,

Likewise, though perhaps it should be the version after next.

> I'm sure someone else can find a more elegant solution than this.

But you're the one most motivated to get it to work, and you have the
most experience, so how about if we help you to make it more portable?
(Elegance is secondary.  :-) Once you have it whipped into shape we
can then install it into the next version (or so) of autoconf.

> m4_define([_AC_OUTPUT_FILES],
> [
> # Makesexp function
> makesexp()

First off, I'm afraid that we can't use shell functions.  They aren't

>   printf -- "s,@${symbol}_${type}@,"

Also, the shell "printf" command isn't portable.

>         y=`echo "[$]1" | sed -e 's/\"/\\\"/g'`

This isn't portable, because some 'echo' implementations treat backslashes
in a funny way.  Others treat '-n' and some other options in a funny way.
Here's a more portable way to do that sort of thing:

quotedform='"'`sed "$script" <<EOF

(Don't you just love shell syntax?  :-)

But we really don't want to run 'sed' for each variable; it's better
to issue those commands just once, for all such variables.

A couple more points.  In proposed patches, please observe the
autoconf namespace conventions as documented in the manual.  Also, for
a change like this, please start with the latest test version, which
you can get from

Thanks again for your suggestion, and I hope you don't mind my trying
to improve on it.

reply via email to

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