summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rwxr-xr-xconfigure2
-rwxr-xr-xversion.sh12
3 files changed, 7 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 005a721b48..b50448a1be 100644
--- a/Makefile
+++ b/Makefile
@@ -768,10 +768,6 @@ config.mak: configure
help_mp.h: help/help_mp-en.h $(HELP_FILE)
help/help_create.sh $(HELP_FILE) $(CHARSET)
-# rebuild version.h each time the working copy is updated
-ifeq ($(wildcard .svn/entries),.svn/entries)
-version.h: .svn/entries
-endif
version.h: version.sh
./$< `$(CC) -dumpversion`
diff --git a/configure b/configure
index 76f0233ea7..3bd8adcc11 100755
--- a/configure
+++ b/configure
@@ -8434,6 +8434,8 @@ cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
#############################################################################
+./version.sh `$_cc -dumpversion`
+
cat << EOF
Config files successfully generated by ./configure $_configuration !
diff --git a/version.sh b/version.sh
index dd8b7b4fe1..1a3f14049e 100755
--- a/version.sh
+++ b/version.sh
@@ -4,16 +4,14 @@ test "$1" && extra="-$1"
# Extract revision number from file used by daily tarball snapshots
# or from the places different Subversion versions have it.
-svn_revision=$(cat snapshot_version 2> /dev/null)
-test $svn_revision || svn_revision=$(LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2)
-test $svn_revision || svn_revision=$(grep revision .svn/entries 2>/dev/null | cut -d '"' -f2)
-test $svn_revision || svn_revision=$(sed -n -e '/^dir$/{n;p;q;}' .svn/entries 2>/dev/null)
-test $svn_revision && svn_revision=SVN-r$svn_revision
-test $svn_revision || svn_revision=UNKNOWN
+git_revision=$(cat snapshot_version 2> /dev/null)
+test $git_revision || test -d .git && git_revision=`git describe --always`
+test $git_revision && git_revision=git-$git_revision
+test $git_revision || git_revision=UNKNOWN
# releases extract the version number from the VERSION file
version=$(cat VERSION 2> /dev/null)
-test $version || version=$svn_revision
+test $version || version=$git_revision
NEW_REVISION="#define VERSION \"${version}${extra}\""
OLD_REVISION=$(head -n 1 version.h 2> /dev/null)