summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-05-21 15:00:53 -0400
committerMike Frysinger <vapier@gentoo.org>2016-05-21 15:00:53 -0400
commit502e4cd873c3b37b307b9f450ef827d40916c3d6 (patch)
treeb8e2c66e4f84e6b59024709a79ab6c62541bdde4
parent0bc8586ee25ce33d95049927ddcc22195f701961 (diff)
downloadlibgd-502e4cd873c3b37b307b9f450ef827d40916c3d6.tar.gz
libtool: rework revision to fix OS X breakage
It seems the OS X linker restricts the revision field to 8 bits. Rework how we calculate that value and pack it in closer to fit. It might produce some collisions if we get to like 2.2.8, but oh well ... this field doesn't need to be super exact. Fixes #214.
-rw-r--r--configure.ac7
1 files changed, 6 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index a702d79..af4fb9f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,10 +38,15 @@ AC_SUBST(GDLIB_VERSION)
# See http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
GDLIB_LT_CURRENT=3
+dnl This is the version where the soname (current above) changes. We use it
+dnl to reset the revision base back to zero. It's a bit of a pain, but some
+dnl systems restrict the revision range below to [0..255] (like OS X).
+GDLIB_PREV_MAJOR=2
+GDLIB_PREV_MINOR=2
dnl This isn't 100% correct, but it tends to be a close enough approximation
dnl for how we manage the codebase. It's rare to do a release that doesn't
dnl modify the library since this project is centered around the library.
-GDLIB_LT_REVISION=$(printf '%i%02i%02i' $GDLIB_MAJOR $GDLIB_MINOR $GDLIB_REVISION)
+GDLIB_LT_REVISION=$(( ((GDLIB_MAJOR - GDLIB_PREV_MAJOR) << 6) | ((GDLIB_MINOR - GDLIB_PREV_MINOR) << 3) | GDLIB_REVISION ))
GDLIB_LT_AGE=0
AC_SUBST(GDLIB_LT_CURRENT)
AC_SUBST(GDLIB_LT_REVISION)