From 9cd72c21c90ac5469c101649cca0f247bdbd6c17 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Fri, 2 Jan 2009 08:48:13 +0000 Subject: [PATCH] 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. --- configure.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 76f3de946..32ef0f4ca 100644 --- a/configure.in +++ b/configure.in @@ -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"