Merge commit '92db5083077a8b0f8e1050507671b456fd155125'
[ffmpeg.git] / ffbuild / libversion.sh
1 toupper(){
2     echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
3 }
4
5 name=lib$1
6 ucname=$(toupper ${name})
7 file=$2
8 raise_major=$3
9
10 eval $(awk "/#define ${ucname}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
11 eval ${ucname}_VERSION_MAJOR=$((${ucname}_VERSION_MAJOR+${raise_major}))
12 eval ${ucname}_VERSION=\$${ucname}_VERSION_MAJOR.\$${ucname}_VERSION_MINOR.\$${ucname}_VERSION_MICRO
13 eval echo "${name}_VERSION=\$${ucname}_VERSION"
14 eval echo "${name}_VERSION_MAJOR=\$${ucname}_VERSION_MAJOR"
15 eval echo "${name}_VERSION_MINOR=\$${ucname}_VERSION_MINOR"