mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 12:58:08 +01:00
Fix calculation of version number in the library mapfiles
As reported by Andreas Metzler, the latest API change in lib WRaster caused a compatibility issue because the internal version number was increased. To correctly handle this situation, this patch does 2 things: - do not discard the 2 last number in the "c:r:a" version, because we need them; - when calculating the version for the mapfile, use the formula that is suggested in libtool's documentation. The purpose of the formula is that when API is changed, if a new function is added then the version is not incremented to reflect that we are still compatible with current binaries, it will be incremented only when there is a break in compatibility.
This commit is contained in:
committed by
Carlos R. Mafra
parent
d0aa2cefcd
commit
2264ed9de6
@@ -77,10 +77,8 @@ while [ $# -gt 0 ]; do
|
||||
|
||||
-v)
|
||||
shift
|
||||
# Version may be 'x:y:z', we keep only 'x'
|
||||
version="`echo "$1" | sed -e 's,:.*$,,' `"
|
||||
# the version should only be a number
|
||||
echo "$version" | grep '^[1-9][0-9]*$' > /dev/null || \
|
||||
version="$1"
|
||||
echo "$version" | grep -E '^[1-9][0-9]*(:[0-9]+(:[0-9]+)?)?$' > /dev/null || \
|
||||
arg_error "version \"$1\" is not valid"
|
||||
;;
|
||||
|
||||
@@ -109,9 +107,18 @@ fi
|
||||
# generate the rest of the script so that other symbols will not be kept.
|
||||
awk '
|
||||
BEGIN {
|
||||
# Version number here uses only 1 number from the full version used in libtool
|
||||
libversion="'"$version"'";
|
||||
if (split(libversion, subversions, ":") > 1) {
|
||||
# Calculate [CURRENT - AGE], the goal is that the number will not
|
||||
# change when functions are added to the API, but it will be incremented
|
||||
# when functions are removed or argument change (which breaks compat)
|
||||
libversion = subversions[1] - subversions[3];
|
||||
}
|
||||
|
||||
print "/* Generated version-script for ld */";
|
||||
print "";
|
||||
print "'"$libname$version"'";
|
||||
print "'"$libname"'" libversion;
|
||||
print "{";
|
||||
print " global:";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user