[Top][All Lists]

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

Re: AC_INIT receiving PACKAGE_VERSION from outside

From: Bruno Haible
Subject: Re: AC_INIT receiving PACKAGE_VERSION from outside
Date: Fri, 11 Mar 2005 16:20:29 +0100
User-agent: KMail/1.5

Stepan Kasal wrote:
> > . ./
> > 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).

But this one works:

  . $srcdir/

> OTOH, I'm not sure why you need this.

I need it for three purposes:

1) In GNU gettext, I generate the man pages using help2man from programs.
   The version number that the programs have becomes the version number in
   the manpages. Initially automake provided no dependency information that
   the programs should be rebuilt when the file changes. So
   before a release, after I changed the version number in
   and did "make", the manpages were rebuilt with the _previous_ version
   number. So I changed the Makefiles so that all programs need to be
   rebuilt when or configure changes. You can imagine that
   this hampers usual development...

2) In GNU gettext I would have to store the version number in three
   different locations:
   This is against the "single source" principle.

3) In GNU clisp, we need the version number also for building the
   infrastructure (such as documentation and Makefiles for exotic platforms),
   a task that is performed in the source directory, not the build directory.
   (When this task runs, there is no config.status anywhere.) So we
   extracted the version number from the using 'grep'. (Could
   be using autom4te as well, doesn't matter.) So the version number ended
   up being copied and transformed in various steps:  -->  configure  -->  config.status  --> Makefile  -->  src/VERSION  -->  doc/impnotes.html

   At some point this jungle of dependencies was missing a dependency
   somewhere, and the dependency on caused too many rebuilds.
   It was just too much copying around of information that should be
   centralized in a single place.

autoconf is made for putting platform/configuration dependent information
in many places. But for static information like a version number it is
more reliable to store it in a single place outside

> 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],
>         [])

This would work, but now I need 'm4' or 'autoconf --trace' to retrieve
the version number from version.m4. Which is not an improvement over
'grep'. A small shell script is more handsome.



reply via email to

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