Hello Robert, and sorry for not replying on this earlier: * 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? Thanks, Ralf