summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Salzman <daniel.salzman@nic.cz>2019-01-22 14:25:46 +0100
committerDaniel Salzman <daniel.salzman@nic.cz>2019-01-23 09:05:05 +0100
commit8b9fe86bd1163c0411f45daa3f844004e3037970 (patch)
tree9a695126cf4b7dfa40cd1384d422fe75a5656b84
parentMerge branch 'no_sign_empty_update' into 'master' (diff)
downloadknot-8b9fe86bd1163c0411f45daa3f844004e3037970.tar.xz
knot-8b9fe86bd1163c0411f45daa3f844004e3037970.zip
Add 'soname' variable to pkg-config files
-rw-r--r--configure.ac13
-rw-r--r--m4/knot-lib-version.m413
-rw-r--r--python/libknot/__init__.py.in2
-rw-r--r--src/libdnssec.pc.in1
-rw-r--r--src/libknot.pc.in1
-rw-r--r--src/libzscanner.pc.in1
6 files changed, 23 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 60d9eb2fb..cba5cf209 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,6 +7,12 @@ m4_include([m4/knot-version.m4])
AC_INIT([knot], knot_PKG_VERSION, [knot-dns@labs.nic.cz])
+# Update library versions
+# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
+KNOT_LIB_VERSION([libknot], 8, 0, 0)
+KNOT_LIB_VERSION([libdnssec], 6, 0, 0)
+KNOT_LIB_VERSION([libzscanner], 2, 0, 0)
+
# Store ./configure parameters and CFLAGS
AC_DEFINE_UNQUOTED([CONFIGURE_PARAMS],["$*"],[Params passed to configure])
AC_DEFINE_UNQUOTED([CONFIGURE_CFLAGS],["$CFLAGS"],[Passed CFLAGS from environment])
@@ -19,13 +25,6 @@ AC_CONFIG_MACRO_DIR([m4])
AC_USE_SYSTEM_EXTENSIONS
AC_CANONICAL_HOST
-# Update library versions
-# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
-AC_SUBST([python_libknot_VERSION], ["8"])
-AC_SUBST([libknot_VERSION_INFO], ["-version-info 8:0:0"])
-AC_SUBST([libdnssec_VERSION_INFO], ["-version-info 6:0:0"])
-AC_SUBST([libzscanner_VERSION_INFO], ["-version-info 2:0:0"])
-
AC_SUBST([KNOT_VERSION_MAJOR], knot_VERSION_MAJOR)
AC_SUBST([KNOT_VERSION_MINOR], knot_VERSION_MINOR)
AC_SUBST([KNOT_VERSION_PATCH], knot_VERSION_PATCH)
diff --git a/m4/knot-lib-version.m4 b/m4/knot-lib-version.m4
new file mode 100644
index 000000000..47f882dfa
--- /dev/null
+++ b/m4/knot-lib-version.m4
@@ -0,0 +1,13 @@
+# KNOT_LIB_VERSION([library-name], [current], [revision], [age])
+# --------------------------------------------------------------
+# See https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
+
+AC_DEFUN([KNOT_LIB_VERSION],
+[
+ AC_SUBST([$1_VERSION_INFO], ["-version-info $2:$3:$4"])
+ AC_SUBST([$1_SOVERSION], ["$2"])
+ AS_CASE([$host_os],
+ [darwin*], [AC_SUBST([$1_SONAME], ["$1.$2.dylib"])],
+ [*], [AC_SUBST([$1_SONAME], ["$1.so.$2"])]
+ )
+])
diff --git a/python/libknot/__init__.py.in b/python/libknot/__init__.py.in
index a13b36945..59843404f 100644
--- a/python/libknot/__init__.py.in
+++ b/python/libknot/__init__.py.in
@@ -1,3 +1,3 @@
"""Python libknot interface."""
-LIBKNOT_VERSION = "@python_libknot_VERSION@"
+LIBKNOT_VERSION = "@libknot_SOVERSION@"
diff --git a/src/libdnssec.pc.in b/src/libdnssec.pc.in
index 7b2a68c5c..6c0aa5c42 100644
--- a/src/libdnssec.pc.in
+++ b/src/libdnssec.pc.in
@@ -2,6 +2,7 @@ prefix=@prefix@
exec_prefix=@prefix@
libdir=@libdir@
includedir=@includedir@
+soname=@libdnssec_SONAME@
Name: libdnssec
Description: Knot DNS DNSSEC library
diff --git a/src/libknot.pc.in b/src/libknot.pc.in
index b40f88b95..b723b24ee 100644
--- a/src/libknot.pc.in
+++ b/src/libknot.pc.in
@@ -2,6 +2,7 @@ prefix=@prefix@
exec_prefix=@prefix@
libdir=@libdir@
includedir=@includedir@
+soname=@libknot_SONAME@
Name: libknot
Description: Knot DNS library
diff --git a/src/libzscanner.pc.in b/src/libzscanner.pc.in
index 1ace23c27..35a8dab10 100644
--- a/src/libzscanner.pc.in
+++ b/src/libzscanner.pc.in
@@ -2,6 +2,7 @@ prefix=@prefix@
exec_prefix=@prefix@
libdir=@libdir@
includedir=@includedir@
+soname=@libzscanner_SONAME@
Name: libzscanner
Description: Knot DNS Zone Parsing library