[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_INIT receiving PACKAGE_VERSION from outside
From: |
Sam Steingold |
Subject: |
Re: AC_INIT receiving PACKAGE_VERSION from outside |
Date: |
Fri, 11 Mar 2005 09:21:24 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) |
> * Stepan Kasal <address@hidden> [2005-03-11 09:48:42 +0100]:
>
> On Thu, Mar 10, 2005 at 01:13:47PM -0500, Sam Steingold wrote:
>> Is there a way to keep the package version outside of
>> configure.ac:AC_INIT?
> ...
>> . ./version.sh
>> AC_INIT(my package, ${myversion})
>
> this solution doesn't work, as AC_INIT expects that it's arguments are
> known when m4 runs (ie. when configure is created).
so, it is impossible for configure to get the version information from
outside, it must be hard coded in the shell script.
why was this design decision made?
I (and apparently at least two more other people) consider this
behavior a bug, not a feature.
Is there a chance this will be eventually fixed?
> gnumeric uses the following solution:
>
> m4_define([gnumeric_version_epoch], [1])
> m4_define([gnumeric_version_major], [5])
> m4_define([gnumeric_version_minor], [1])
> m4_define([gnumeric_version_extra], [])
> m4_define([gnumeric_full_version],
>
> [gnumeric_version_epoch.gnumeric_version_major.gnumeric_version_minor[]gnumeric_version_extra])
>
> AC_INIT([gnumeric], [gnumeric_full_version],
> [http://bugzilla.gnome.org/enter_bug.cgi?product=gnumeric])
>
> Of course, this can be simplified:
>
> m4_define([gnumeric_full_version], 1.5.1)
> AC_INIT([gnumeric], [gnumeric_full_version],
> [http://bugzilla.gnome.org/enter_bug.cgi?product=gnumeric])
>
> In your case, you would put the defines in a separate file, and include it
> like this
>
> m4_include([m4/version.m4])
> AC_INIT([gnumeric], [gnumeric_full_version],
> [http://bugzilla.gnome.org/enter_bug.cgi?product=gnumeric])
this is no solution - it just adds a level of indirection.
still, configure will depend on m4/version.m4 (which will in turn depend
on version.sh) and will have to be regenerated on each modification of
version.sh. Yuk.
> OTOH, I'm not sure why you need this.
> According to my experience, it's easy to set the source so that
> configure.ac is the only place where the version number is present.
version can be more complex than "1.5.1".
CLISP version usually looks something like "2.34 (2005-03-11)",
while tar files look like clisp-2.34.tar.gz &c.
it is easier to have a file
--- version.sh ---
# Version number and release date.
VERSION_NUMBER=2.33.82
RELEASE_DATE=2005-03-10 # in "date +%Y-%m-%d" format
--- version.sh ---
and in configure.ac
AC_INIT(GNU CLISP, [${VERSION_NUMBER} (${RELEASE_DATE})], clisp)
than parse "configure --version" every time the VERSION_NUMBER is needed.
--
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.memri.org/> <http://www.dhimmi.com/> <http://www.camera.org>
<http://www.mideasttruth.com/> <http://www.jihadwatch.org/>
Apathy Club meeting this Friday. If you want to come, you're not invited.
- AC_INIT receiving PACKAGE_VERSION from outside, Sam Steingold, 2005/03/10
- Re: AC_INIT receiving PACKAGE_VERSION from outside, Eric Hanchrow, 2005/03/10
- Re: AC_INIT receiving PACKAGE_VERSION from outside, Stepan Kasal, 2005/03/11
- Re: AC_INIT receiving PACKAGE_VERSION from outside,
Sam Steingold <=
- Message not available
- Re: AC_INIT receiving PACKAGE_VERSION from outside, Bruno Haible, 2005/03/11
- Re: AC_INIT receiving PACKAGE_VERSION from outside, Sam Steingold, 2005/03/11
- Re: AC_INIT receiving PACKAGE_VERSION from outside, Bruno Haible, 2005/03/11
- Re: AC_INIT receiving PACKAGE_VERSION from outside, Sam Steingold, 2005/03/11
- Re: AC_INIT receiving PACKAGE_VERSION from outside, Bruno Haible, 2005/03/11
- Re: AC_INIT receiving PACKAGE_VERSION from outside, Bruce Korb, 2005/03/12
- Re: AC_INIT receiving PACKAGE_VERSION from outside, Alexandre Duret-Lutz, 2005/03/17
- Re: AC_INIT receiving PACKAGE_VERSION from outside, Sam Steingold, 2005/03/18
- Re: AC_INIT receiving PACKAGE_VERSION from outside, Bruno Haible, 2005/03/18