You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.9 KiB

  1. From 635dd9a3065ed88e1741e6b963044b80e913f96a Mon Sep 17 00:00:00 2001
  2. From: Remi Collet <remi@remirepo.net>
  3. Date: Tue, 24 Mar 2020 08:01:01 +0100
  4. Subject: [PATCH] distribute getlib.sh
  5. ---
  6. config/getlib.sh | 42 ++++++++++++++++++++++++++++++++++++++++++
  7. 1 file changed, 42 insertions(+)
  8. create mode 100755 config/getlib.sh
  9. diff --git a/config/getlib.sh b/config/getlib.sh
  10. new file mode 100755
  11. index 0000000..4835cf6
  12. --- /dev/null
  13. +++ b/config/getlib.sh
  14. @@ -0,0 +1,42 @@
  15. +#!/bin/sh
  16. +
  17. +GETVER="${0%/*}/getver.pl"
  18. +GDLIB_MAJOR=$("${GETVER}" MAJOR)
  19. +GDLIB_MINOR=$("${GETVER}" MINOR)
  20. +GDLIB_REVISION=$("${GETVER}" RELEASE)
  21. +
  22. +# Dynamic library version information
  23. +# See http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
  24. +
  25. +GDLIB_LT_CURRENT=3
  26. +# This is the version where the soname (current above) changes. We use it
  27. +# to reset the revision base back to zero. It's a bit of a pain, but some
  28. +# systems restrict the revision range below to [0..255] (like OS X).
  29. +GDLIB_PREV_MAJOR=2
  30. +GDLIB_PREV_MINOR=2
  31. +# This isn't 100% correct, but it tends to be a close enough approximation
  32. +# for how we manage the codebase. It's rare to do a release that doesn't
  33. +# modify the library since this project is centered around the library.
  34. +GDLIB_LT_REVISION=$(( ((GDLIB_MAJOR - GDLIB_PREV_MAJOR) << 6) | ((GDLIB_MINOR - GDLIB_PREV_MINOR) << 3) | GDLIB_REVISION ))
  35. +GDLIB_LT_AGE=0
  36. +
  37. +# The first three fields we feed into libtool and the OS target determines how
  38. +# they get used. The last two fields we feed into cmake. We use the same rules
  39. +# as Linux SONAME versioning in libtool, but cmake should handle it for us.
  40. +case $1 in
  41. +CURRENT)
  42. + printf '%s' "${GDLIB_LT_CURRENT}"
  43. + ;;
  44. +REVISION)
  45. + printf '%s' "${GDLIB_LT_REVISION}"
  46. + ;;
  47. +AGE)
  48. + printf '%s' "${GDLIB_LT_AGE}"
  49. + ;;
  50. +VERSION)
  51. + printf '%s' "$(( GDLIB_LT_CURRENT - GDLIB_LT_AGE )).${GDLIB_LT_AGE}.${GDLIB_LT_REVISION}"
  52. + ;;
  53. +SONAME)
  54. + printf '%s' "$(( GDLIB_LT_CURRENT - GDLIB_LT_AGE ))"
  55. + ;;
  56. +esac
  57. --
  58. 2.25.1