path64/open64: filter out unsupported flags
[libav.git] / version.sh
CommitLineData
f1cc88a5
DB
1#!/bin/sh
2
40eaf780 3# check for git short hash
faa6f1c3
JG
4revision=$(cd "$1" && git describe --always 2> /dev/null)
5test "$revision" && revision=git-$revision
40eaf780 6
de2c2b5a 7# no revision number found
f318ee3e 8test "$revision" || revision=UNKNOWN
123103ca 9
de2c2b5a 10# releases extract the version number from the VERSION file
8202d905 11version=$(cd "$1" && cat VERSION 2> /dev/null)
f318ee3e 12test "$version" || version=$revision
ac63af34 13
de2c2b5a
DB
14test -n "$3" && version=$version-$3
15
16064462
MR
16if [ -z "$2" ]; then
17 echo "$version"
18 exit
19fi
20
a03be6e1 21NEW_REVISION="#define LIBAV_VERSION \"$version\""
d33a14e4 22OLD_REVISION=$(cat version.h 2> /dev/null)
f1cc88a5
DB
23
24# Update version.h only on revision changes to avoid spurious rebuilds
25if test "$NEW_REVISION" != "$OLD_REVISION"; then
9e6165b5 26 echo "$NEW_REVISION" > "$2"
f1cc88a5 27fi