3 # check for git short hash
4 if ! test "$revision"; then
5 revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)
8 # no revision number found
9 test "$revision" || revision=$(cd "$1" && cat RELEASE 2> /dev/null)
11 # releases extract the version number from the VERSION file
12 version=$(cd "$1" && cat VERSION 2> /dev/null)
13 test "$version" || version=$revision
15 test -n "$3" && version=$version-$3
22 NEW_REVISION="#define FFMPEG_VERSION \"$version\""
23 OLD_REVISION=$(cat version.h 2> /dev/null)
25 # Update version.h only on revision changes to avoid spurious rebuilds
26 if test "$NEW_REVISION" != "$OLD_REVISION"; then
27 echo "$NEW_REVISION" > "$2"