3
# This script is used to generate version numbers for autotools
5
# The top-level main version is collected from the top-level build.xml
7
# The information for libtool is maintained manually since
8
# the public API for the C library can change independent of the project
10
# Do each of these steps in order and libtool will do the right thing
11
# (1) If there are changes to libavro:
12
# libavro_micro_version++
13
# libavro_interface_age++
14
# libavro_binary_age++
15
# (2) If any functions have been added:
16
# libavro_interface_age = 0
17
# (3) If backwards compatibility has been broken:
18
# libavro_binary_age = 0
19
# libavro_interface_age = 0
21
libavro_micro_version=22
22
libavro_interface_age=0
25
# IGNORE EVERYTHING ELSE FROM HERE DOWN.........
28
echo " where CMD is one of: project, libtool, libcurrent, librevision, libage"
32
# http://sources.redhat.com/autobook/autobook/autobook_91.html
33
# 'Current' is the most recent interface number that this library implements
34
libcurrent=$(($libavro_micro_version - $libavro_interface_age))
35
# The implementation number of the 'current' interface
36
librevision=$libavro_interface_age
37
# The difference between the newest and oldest interfaces that this library implements
38
# In other words, the library implements all the interface numbers in the range from
39
# number 'current - age' to current
40
libage=$(($libavro_binary_age - $libavro_interface_age))
42
if test "$1" = "project"; then
44
version_file="VERSION.txt"
45
if test -f $version_file; then
46
project_ver=$(cat $version_file)
48
version_file="../../share/VERSION.txt"
49
if test -f $version_file; then
50
project_ver=$(cat $version_file)
53
printf "%s" $project_ver
54
elif test "$1" = "libtool"; then
55
# useful for the -version-info flag for libtool
56
printf "%d:%d:%d" $libcurrent $librevision $libage
57
elif test "$1" = "libcurrent"; then
58
printf "%d" $libcurrent
59
elif test "$1" = "librevision"; then
60
printf "%d" $librevision
61
elif test "$1" = "libage"; then