Alexandre Duret-Lutz wrote:

> AC_INIT([foobar], m4_normalize(m4_include([version])))
>
> And write down your version string in the `version' file.

Ah, thanks for the great trick!

> (m4_normalize strips extra spaces and new lines.)

The call to m4_normalize appears to be needed, since usually a file or an
esyscmd output ends in a newline. But it is not documented. Could in be
documented in the autoconf manual?

>   2) you don't break `autoconf --trace AC_INIT' so any build tool can
>      retrieve your version without knowing where it is stored.

... assuming these build tools are run from the same directory. If a tool
is run from a subdirectory, it needs to m4_include([../version]) instead.

> Beware that sourced shell scripts add hidden dependency to
> ./config.status.

Yes, we add a dependency from version.sh to config.status.

> Almost no configure.ac I have seen sourcing a version script do define
> CONFIG_STATUS_DEPENDENCIES as they should.

Thanks for the tip. I missed that too :-)

Bruno



_______________________________________________
Autoconf mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/autoconf

Reply via email to