summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2012-11-19 18:14:33 +0000
committerLRN <lrn1986@gmail.com>2012-11-19 18:14:33 +0000
commit99d0b2ce7659f0dbe0d632d370a5fb8a9bb0f6c9 (patch)
treee6b857aefb94d06f686921d98bf0b95928c30e4d /configure.ac
parentf64e7ab9c26ccc0d0d32e7458745f2c70bffd352 (diff)
Hardcode svn revision in compiled binaries
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 21 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 6d7790313..c0d44484f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1137,6 +1137,27 @@ AC_MSG_RESULT($use_gcov)
AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"])
+# version info
+AC_PATH_PROG(svnversioncommand, svnversion)
+AC_PATH_PROG(gitcommand, git)
+if test "X$svnversioncommand" = "X" || test `$svnversioncommand -n '.'` = "exported"
+then
+ if test "X$gitcommand" = "X"
+ then
+ AC_DEFINE_UNQUOTED(VCS_VERSION, ["release"], [repository svn version])
+ else
+ gitver=$(git log -1 | grep "git-svn-id" | sed -e 's/.*@\([[0-9]]\+\) .*/\1/')
+ if "X$gitver" = "X"
+ then
+ AC_DEFINE_UNQUOTED(VCS_VERSION, ["release"], [repository svn version])
+ else
+ AC_DEFINE_UNQUOTED(VCS_VERSION, ["svn-$gitver"], [repository svn version])
+ fi
+ fi
+else
+ AC_DEFINE_UNQUOTED(VCS_VERSION, ["svn-`svnversion -n`"], [repository svn version])
+fi
+
AC_CONFIG_FILES([
Makefile
contrib/Makefile