[Top][All Lists]

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

Re: AC_INIT design bug or automake thinko?

From: Stepan Kasal
Subject: Re: AC_INIT design bug or automake thinko?
Date: Mon, 2 Oct 2006 21:54:00 +0200
User-agent: Mutt/


On Mon, Oct 02, 2006 at 06:41:33PM +0200, Bruno Haible wrote:
> This is only a minor issue, but still: Why does autoconf want to have
> the version number at autoconf-time? It has no influence on the shell
> script code that needs to be expanded into 'configure'.

of course it has an influence; if nothing else, then `./configure
--version' and `./config.status --version' report the name and
version of the configured package.

I do not believe that all current usages of the PACKAGE_VERSION would
work with non-literal version strings out-of-the-box.
Moreover, I do not feel it is the right thing to compute the version
at configure time, so I do not want to ``fix'' this.

> Thanks for the tip. The major problem, however, is the one of syntax.
> Even to an experienced programmer, having to write an m4 function call
> in order to declare a value is _unnatural_. The natural syntax for
> declaring values is

If this is a problem, then suggest and extension.  For example, if
a file acvariables.eq is present in the same directory as
configure.ac, then each line in the above form defines a macro
`IDENTIFIER' which expands to `VALUE'.

But I do not thing that using macros in a macro language is
unnatural.  And I do not thing that preaching ``you can use Autoconf
as if it were an imperative language'' gets us far.

Autoconf need not be a macro language, especially now, when it seems
that shall functions do exist.  But the change won't be cheap.

> Makefile.am gets this right. sh script snippets got this right as well.

Makefile.am use the same syntax as makefiles, and that is right.

Makefiles use a syntax which resembles assignments, though it in fact
defines a macro.  In many cases the difference is not visible, but
when it is, it can bring confusion...

> Things like
>       AC_INIT([hello], [2.1])
> or
>       AM_GNU_GETTEXT_VERSION([0.14.6])
> are programmer-unfriendly hacks that are only motivated by the lack of
> a central parametrization file standard in GNU. (We do have a standard means
> for parametrization per-directory; this is the Makefile.am. But nothing
> that has the right syntax and exists only once per package.)

Interesting idea for a new generation of autotools.  But for now, we
have a make-like language and a macro language.

> A combination of your technique with the right syntax could look like
> this:
>   esyscmd([ if ! test -f version.sh; then cd ..; fi; ./version.sh; echo 
> "m4_define([gettext_version], [$version])" ])

Now that is natural!  ;-)

Please forgive me if I'm cheeky, I just try to use an amusing style.

Have a nice day,

reply via email to

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