automake
[Top][All Lists]
Advanced

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

Re: setting $VERSION at runtime


From: NotFound
Subject: Re: setting $VERSION at runtime
Date: Fri, 27 Jan 2006 18:50:05 +0100

On 1/23/06, Brian Dessent <address@hidden> wrote:

I've been using the following solution suggested by a friend to use a
version number extracted from a source file:

AC_MSG_CHECKING(for version number in $srcdir/version.cpp)

VERSION_MAJOR=`grep 'version::Major' $srcdir/version.cpp | \
                                sed 's/.*version::.*= *//;s/[[,;]]//'`
VERSION_MINOR=`grep 'version::Minor' $srcdir/version.cpp | \
                                sed 's/.*version::.*= *//;s/[[,;]]//'`
VERSION_RELEASE=`grep 'version::Release' $srcdir/version.cpp | \
                                sed 's/.*version::.*= *//;s/[[,;]]//'`

AC_MSG_RESULT([got $VERSION_MAJOR.$VERSION_MINOR.$VERSION_RELEASE])

if test "_$VERSION_MAJOR" = "_"; then
        AC_MSG_ERROR([version::Major not found])
elif test "_$VERSION_MINOR" = "_"; then
        AC_MSG_ERROR([version::Minor not found])
elif test "_$VERSION_RELEASE" = "_"; then
        AC_MSG_ERROR([version::Release not found])
fi

AM_INIT_AUTOMAKE(blassic, $VERSION_MAJOR.$VERSION_MINOR.$VERSION_RELEASE)

This was needed because the program was previously builded without
using automake and at that time changing it was undesired.

Unfortunately this trick requires the use of the obsolete form of
AC_INIT and AM_INIT_AUTOMAKE

--
Salu2




reply via email to

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