autoconf
[Top][All Lists]
Advanced

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

how to automatically generate package version, calling AC_INIT


From: Joost van Baal
Subject: how to automatically generate package version, calling AC_INIT
Date: Sun, 27 Apr 2003 12:50:47 +0200
User-agent: Mutt/1.5.4i

Hi,

[Please respect my Mail-Followup-To and Cc me on replies, I'm not
subscribed to this list.]

The new AC_INIT syntax (using autoconf 2.57 here, from Debian package
2.57-2) makes it more difficult to automatically generate a package's
version number.  I used to do in configure.ac something like

 AC_INIT()
 AM_INIT_AUTOMAKE(mypackage, `cat $srcdir/VERSION`)

and fill VERSION during ./bootstrap, which has

 echo "`date +%Y%m%d`" > VERSION

.  However, this breaks with the new setup; from the info page:

>>    Every `configure' script must call `AC_INIT' before doing anything
>>    else.

>>    It is preferable that the arguments of `AC_INIT' be static, i.e.,
>>    there should not be any shell computation, but they can be
>>    computed by M4.

So, I now do, in configure.ac:

 m4_include([VERSION.m4])dnl
 AC_INIT([My Package],
       [VERSION],
       address@hidden,
       [mypackage])
 AM_INIT_AUTOMAKE

and in ./bootstrap, I have

 echo 'm4_define([VERSION], ['`date +%Y%m%d`'])' > VERSION.m4

However, this breaks:

 % autoconf
 % ./configure
 checking for a BSD-compatible install... /usr/bin/install -c
 checking whether build environment is sane... yes
 checking whether make sets $(MAKE)... yes
 ./configure: line 1413: 20030426=: command not found
 checking for working aclocal-1.4... found
 checking for working autoconf... found
 checking for working automake-1.4... found
 checking for working autoheader... found
 <snip>

Indeed,the generated ./configure has a line:

 20030426=

(A workaround is having

 echo 'm4_define([VERSION], [v'`date +%Y%m%d`'])' > VERSION.m4

in bootstrap, so that the bogus assignment in configure is

 v20030426=

which does not break.  However, I'd prefer a version number with a
leading digit...)

Anybody got a clue on how to get this going?  Why does the value in the
m4_define get used as a shellvariable name in configure?  How can I find
out for myself?

Bye,

Joost

-- 
                               . .                  http://mdcc.cx/
Joost van Baal                .   .
                              .   .           http://banach.uvt.nl/
                               . .            http://logreport.org/

Attachment: pgps_pj3Mbu9I.pgp
Description: PGP signature


reply via email to

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