5 GVH
=ext
/sleepy_penguin
/git_version.h
10 # First see if there is a version file (included in release tarballs),
11 # then try git-describe, then default.
14 VN
=$
(cat version
) || VN
="$DEF_VER"
15 elif test -d .git
-o -f .git
&&
16 VN
=$
(git describe
--abbrev=4 HEAD
2>/dev
/null
) &&
20 git update-index
-q --refresh
21 test -z "$(git diff-index --name-only HEAD --)" ||
25 VN
=$
(echo "$VN" |
sed -e 's/-/./g');
30 VN
=$
(expr "$VN" : v
*'\(.*\)')
34 VC
=$
(sed -e 's/^GIT_VERSION = //' <$GVF)
38 test "$VN" = "$VC" ||
{
40 echo '#ifndef MY_GIT_VERSION'
41 echo '#define MY_GIT_VERSION "'$VN'"'
42 echo '#endif /* MY_GIT_VERSION */'
45 echo >&2 "GIT_VERSION = $VN"
46 echo "GIT_VERSION = $VN" >$GVF