Stepan Kasal wrote: > But there is no need to set the version during the run of configure; > it is known when Autoconf runs. ... Actually, Autoconf requires that the > version is a literal, not shell variable.
This is only a minor issue, but still: Why does autoconf want to have the version number at autoconf-time? It has no influence on the shell script code that needs to be expanded into 'configure'. Sam asked it in http://lists.gnu.org/archive/html/autoconf/2005-03/msg00054.html and got no answer. > Could you replace your version.sh with version.m4, which would > contain: > m4_define([gettext_version], [1.2.3]) > ? > > Then you would have: > m4_include([version.m4]) > AC_INIT([GNU gettext], gettext_version, [EMAIL PROTECTED]) Thanks for the tip. The major problem, however, is the one of syntax. Even to an experienced programmer, having to write an m4 function call in order to declare a value is _unnatural_. The natural syntax for declaring values is IDENTIFIER = VALUE Makefile.am gets this right. sh script snippets got this right as well. Things like AC_INIT([hello], [2.1]) or AM_GNU_GETTEXT_VERSION([0.14.6]) are programmer-unfriendly hacks that are only motivated by the lack of a central parametrization file standard in GNU. (We do have a standard means for parametrization per-directory; this is the Makefile.am. But nothing that has the right syntax and exists only once per package.) A combination of your technique with the right syntax could look like this: esyscmd([ if ! test -f version.sh; then cd ..; fi; ./version.sh; echo "m4_define([gettext_version], [$version])" ]) AC_INIT([GNU gettext], gettext_version, [EMAIL PROTECTED]) Bruno
