Skip to content
Snippets Groups Projects
Commit 50f933b5 authored by Ralph Giles's avatar Ralph Giles
Browse files

Query git for the repository revision and use that for the version string.

Rather than compiling in the fixed version number from the configure
file, it's more helpful for testing and debugging to directly embed
the repository's revision. We use 'git describe --tags' for this, since
for tagged revisions it just returns the tag name, and in other cases
is more readable than a raw commit id.

If git isn't present or can't find a repository to query, we fall back
to the static version number in the configure script.
parent 42eb9330
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,17 @@ OPUS_MAJOR_VERSION=0 ...@@ -11,7 +11,17 @@ OPUS_MAJOR_VERSION=0
OPUS_MINOR_VERSION=9 OPUS_MINOR_VERSION=9
OPUS_MICRO_VERSION=6 OPUS_MICRO_VERSION=6
OPUS_EXTRA_VERSION= OPUS_EXTRA_VERSION=
OPUS_VERSION=$OPUS_MAJOR_VERSION.$OPUS_MINOR_VERSION.$OPUS_MICRO_VERSION$OPUS_EXTRA_VERSION
OPUS_VERSION="$OPUS_MAJOR_VERSION.$OPUS_MINOR_VERSION.$OPUS_MICRO_VERSION$OPUS_EXTRA_VERSION"
AC_MSG_CHECKING([git revision])
GIT_VERSION=$(git describe --tags 2>/dev/null)
if test -z "$GIT_VERSION"; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([$GIT_VERSION])
OPUS_VERSION="$GIT_VERSION"
fi
LIBOPUS_SUFFIX=0 LIBOPUS_SUFFIX=0
OPUS_LT_CURRENT=0 OPUS_LT_CURRENT=0
...@@ -27,6 +37,7 @@ AC_SUBST(LIBOPUS_SUFFIX) ...@@ -27,6 +37,7 @@ AC_SUBST(LIBOPUS_SUFFIX)
VERSION=$OPUS_VERSION VERSION=$OPUS_VERSION
PACKAGE=opus PACKAGE=opus
# For our version string
AC_SUBST(OPUS_VERSION) AC_SUBST(OPUS_VERSION)
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define) AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment