Set BUILD_SVN_REVISION which fixes saving config.dat between instances. This

uses 'svnversion $srcdir' for svn builds, and the file svn_revision which is
supplied with tarballs.

Originally committed to SVN as r2612.
This commit is contained in:
Amar Takhar 2009-01-02 08:48:13 +00:00
parent bd5ecab6ed
commit 9cd72c21c9
1 changed files with 7 additions and 3 deletions

View File

@ -108,21 +108,25 @@ AM_MAINTAINER_MODE
AC_ARG_ENABLE(build-dist)
if test "$enable_build_dist" = "yes"; then
`svnversion > $srcdir/svn_revision`
`svnversion $srcdir | sed "s/\(^@<:@0-9@:>@*\).*/\1/" > $srcdir/svn_revision`
fi
# XXX: This needs to be fixed to handle mixed revisions properly
# There is probably a better way to handle it as well.
AC_MSG_CHECKING([for svn version])
if test -d "$srcdir/.svn"; then
SVN_REVISION=`svnversion $srcdir`
SVN_REVISION=`svnversion $srcdir | sed "s/\(^@<:@0-9@:>@*\).*/\1/"`
AC_MSG_RESULT([$SVN_REVISION from "svnversion $srcdir"])
elif test -f "$srcdir/svn_revision"; then
SVN_REVISION=`cat $srcdir/svn_revision`
AC_MSG_RESULT([$SVN_REVISION from "$srcdir/svn_revision"])
else
SVN_REVISION="_unknown"
AC_MSG_RESULT([not found])
AC_MSG_FAILURE([unable to get SVN Revision from svn_version (file) or 'svnversion $srcdir'])
fi
AC_DEFINE_UNQUOTED([BUILD_SVN_REVISION], [$SVN_REVISION], [SVN Revision number, used for config.dat and verison.cpp])
PACKAGE_STRING="${PACKAGE_STRING}-r$SVN_REVISION"
PACKAGE_VERSION="${PACKAGE_VERSION}-r$SVN_REVISION"
VERSION="${VERSION}-r$SVN_REVISION"