diff options
author | Diego Biurrun <diego@biurrun.de> | 2016-12-17 20:01:07 +0100 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2016-12-22 12:17:37 +0100 |
commit | edb434873238876790f6a17bb65490cc29a1d176 (patch) | |
tree | ccf95adc42317493c5056ff77a682da44b6daf31 /avbuild/libversion.sh | |
parent | 11a9320de54759340531177c9f2b1e31e6112cc2 (diff) | |
download | ffmpeg-edb434873238876790f6a17bb65490cc29a1d176.tar.gz |
build: Store library version numbers in .version files
This moves work from the configure to the Make stage where it can
be parallelized and ensures that shared libraries are built with
the right version number in the filename.
Diffstat (limited to 'avbuild/libversion.sh')
-rwxr-xr-x | avbuild/libversion.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/avbuild/libversion.sh b/avbuild/libversion.sh new file mode 100755 index 0000000000..30046b1d25 --- /dev/null +++ b/avbuild/libversion.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +toupper(){ + echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ +} + +name=lib$1 +ucname=$(toupper ${name}) +file=$2 + +eval $(awk "/#define ${ucname}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file") +eval ${ucname}_VERSION=\$${ucname}_VERSION_MAJOR.\$${ucname}_VERSION_MINOR.\$${ucname}_VERSION_MICRO +eval echo "${name}_VERSION=\$${ucname}_VERSION" +eval echo "${name}_VERSION_MAJOR=\$${ucname}_VERSION_MAJOR" +eval echo "${name}_VERSION_MINOR=\$${ucname}_VERSION_MINOR" |