On Sun, 2009-11-29 at 22:10 +0100, Ralf Wildenhues wrote: > Hello Robert, and sorry for not replying on this earlier:
Hi - no problems ;). > * Robert Collins wrote on Wed, Sep 23, 2009 at 10:03:42AM CEST: > > There was discussion about getting version numbers from VCS recently; > > I've done a slightly different thing for a while now: > > AC_DEFUN([SUBUNIT_MAJOR_VERSION], [0]) > > AC_DEFUN([SUBUNIT_MINOR_VERSION], [0]) > > AC_DEFUN([SUBUNIT_MICRO_VERSION], [2]) > > AC_DEFUN([SUBUNIT_VERSION], > > [SUBUNIT_MAJOR_VERSION.SUBUNIT_MINOR_VERSION.SUBUNIT_MICRO_VERSION]) > > AC_PREREQ([2.59]) > > AC_INIT([subunit], [SUBUNIT_VERSION], [contact...]) > > AC_SUBST([SUBUNIT_MAJOR_VERSION]) ... > > > > This works well, until gnits is added to AM_INIT_AUTOMAKE. > > > > It looks like it expects a literal, not a macro in AC_INIT ? > > Yeah, the test unfortunately needs the version number literally at m4 > time; you can achieve that with something like > > m4_define([SUBUNIT_MAJOR_VERSION], [0]) > m4_define([SUBUNIT_MINOR_VERSION], [0]) > m4_define([SUBUNIT_MICRO_VERSION], [2]) > m4_define([SUBUNIT_VERSION], > > m4_defn([SUBUNIT_MAJOR_VERSION]).m4_defn([SUBUNIT_MINOR_VERSION]).m4_defn([SUBUNIT_MICRO_VERSION])) > AC_PREREQ([2.59]) > AC_INIT([subunit], m4_defn([SUBUNIT_VERSION]), [contact...]) > > BTW, and this is why I'm adding bug-autoconf here: Not changing the > AC_DEFUNs here to m4_define causes Autoconf 2.65 to barf with > configure.ac:7: error: m4_divert_push: cannot change diversion to `GROW' > inside m4_expand > > which seems a bit surprising to me. What's the NEWS entry that > described this change in behavior? Or was that always problematic > and we only didn't notice earlier by chance? I don't recall seeing a NEWS entry relating to this; what happened is that I was adding this idiom to an existing gnits project and it failed. We could bisect for it I guess, but I suspect its latent for a while - and will likely raise trouble for folk wanting to make their version numbers very dynamic too. -Rob
signature.asc
Description: This is a digitally signed message part