Re: AC_INIT receiving PACKAGE_VERSION from outside

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

 



> * Stepan Kasal <xnfny@xxxxxx> [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.



_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux