summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey 'Jin' Bostandzhyan <jin at mediatomb dot cc>2017-01-11 22:41:11 +0100
committerSergey 'Jin' Bostandzhyan <jin at mediatomb dot cc>2017-01-18 11:20:07 +0100
commit3f24f048762736e1a5d785a080fec7e84172e708 (patch)
tree3a0a66087a0d0d97bc19c6f4ee379f923f4ab9e8
parent5ad3c9890574cfe91a856e4836a553973b7da1a9 (diff)
Setup autotools to read .so version info from a separate file
We want to use the same libtool style .so versions in both build systems, ideally both systems should read the version information from the same configuration file. This commit introduces an so.version configuration file and sets up the autotools to use it. The version numbers in so.version define the ABI compatibility and should be updated prior to each release. implements #323
-rw-r--r--Makefile.am1
-rw-r--r--build/Makefile.am12
-rw-r--r--configure.ac23
-rw-r--r--so.version16
-rw-r--r--toxav/Makefile.inc8
-rw-r--r--toxcore/Makefile.inc8
-rw-r--r--toxdns/Makefile.inc8
-rw-r--r--toxencryptsave/Makefile.inc8
8 files changed, 62 insertions, 22 deletions
diff --git a/Makefile.am b/Makefile.am
index 4a204135..300c5c07 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,6 +14,7 @@ EXTRA_DIST = \
14 README.md \ 14 README.md \
15 libtoxcore.pc.in \ 15 libtoxcore.pc.in \
16 tox.spec \ 16 tox.spec \
17 so.version \
17 dist-build/android-arm.sh \ 18 dist-build/android-arm.sh \
18 dist-build/android-armv7.sh \ 19 dist-build/android-armv7.sh \
19 dist-build/android-x86.sh \ 20 dist-build/android-x86.sh \
diff --git a/build/Makefile.am b/build/Makefile.am
index ea844b3f..e4f36509 100644
--- a/build/Makefile.am
+++ b/build/Makefile.am
@@ -4,6 +4,18 @@ lib_LTLIBRARIES =
4noinst_bindir = $(top_builddir)/build 4noinst_bindir = $(top_builddir)/build
5EXTRA_DIST= 5EXTRA_DIST=
6 6
7if SET_SO_VERSION
8
9include ../so.version
10
11LT_LDFLAGS=-version-info $(CURRENT):$(REVISION):$(AGE)
12
13else
14
15LT_LDFLAGS=-avoid-version
16
17endif
18
7include ../toxcore/Makefile.inc 19include ../toxcore/Makefile.inc
8include ../toxdns/Makefile.inc 20include ../toxdns/Makefile.inc
9include ../toxencryptsave/Makefile.inc 21include ../toxencryptsave/Makefile.inc
diff --git a/configure.ac b/configure.ac
index bdf64dc2..8efffef0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,16 +12,6 @@ AC_CONFIG_MACRO_DIR([m4])
12 12
13EXTRA_LT_LDFLAGS= 13EXTRA_LT_LDFLAGS=
14 14
15LIBTOXCORE_LT_VERSION=0:0:0
16dnl
17dnl current:revision:age
18dnl
19dnl current: increment if interfaces have been added, removed or changed
20dnl revision: increment if source code has changed, set to zero if current is
21dnl incremented
22dnl age: increment if interfaces have been added, set to zero if
23dnl interfaces have been removed or changed
24
25if test "x${prefix}" = "xNONE"; then 15if test "x${prefix}" = "xNONE"; then
26 prefix="${ac_default_prefix}" 16 prefix="${ac_default_prefix}"
27fi 17fi
@@ -40,22 +30,19 @@ LIBCONFIG_FOUND="no"
40LIBCHECK_FOUND="no" 30LIBCHECK_FOUND="no"
41WANT_NACL="no" 31WANT_NACL="no"
42ADD_NACL_OBJECTS_TO_PKGCONFIG="yes" 32ADD_NACL_OBJECTS_TO_PKGCONFIG="yes"
43 33SET_SO_VERSION="yes"
44TOXCORE_LT_LDFLAGS="-version-info $LIBTOXCORE_LT_VERSION"
45TOXAV_LT_LDFLAGS="-version-info $LIBTOXCORE_LT_VERSION"
46 34
47AC_ARG_ENABLE([soname-versions], 35AC_ARG_ENABLE([soname-versions],
48 [AC_HELP_STRING([--enable-soname-versions], [enable soname versions (must be disabled for android) (default: enabled)]) ], 36 [AC_HELP_STRING([--enable-soname-versions], [enable soname versions (must be disabled for android) (default: enabled)]) ],
49 [ 37 [
50 if test "x$enableval" = "xno"; then 38 if test "x$enableval" = "xno"; then
51 TOXCORE_LT_LDFLAGS="-avoid-version" 39 SET_SO_VERSION="no"
52 TOXAV_LT_LDFLAGS="-avoid-version" 40 elif test "x$enableval" = "xyes"; then
41 SET_SO_VERSION="yes"
53 fi 42 fi
54 ] 43 ]
55) 44)
56 45AM_CONDITIONAL(SET_SO_VERSION, test "x$SET_SO_VERSION" = "xyes")
57AC_SUBST(TOXCORE_LT_LDFLAGS)
58AC_SUBST(TOXAV_LT_LDFLAGS)
59 46
60AC_ARG_ENABLE([nacl], 47AC_ARG_ENABLE([nacl],
61 [AC_HELP_STRING([--enable-nacl], [use nacl instead of libsodium (default: disabled)]) ], 48 [AC_HELP_STRING([--enable-nacl], [use nacl instead of libsodium (default: disabled)]) ],
diff --git a/so.version b/so.version
new file mode 100644
index 00000000..5c3a8be5
--- /dev/null
+++ b/so.version
@@ -0,0 +1,16 @@
1# .so library version, following the libtool scheme:
2#
3# current:revision:age
4#
5# current: increment if interfaces have been added, removed or changed
6# revision: increment if source code has changed, set to zero if current is
7# incremented
8# age: increment if interfaces have been added, set to zero if
9# interfaces have been removed or changed
10#
11# For a full reference see:
12# https://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
13
14CURRENT=5
15REVISION=0
16AGE=4
diff --git a/toxav/Makefile.inc b/toxav/Makefile.inc
index b7669677..7b788198 100644
--- a/toxav/Makefile.inc
+++ b/toxav/Makefile.inc
@@ -29,7 +29,7 @@ libtoxav_la_CFLAGS = -I../toxcore \
29 $(AV_CFLAGS) \ 29 $(AV_CFLAGS) \
30 $(PTHREAD_CFLAGS) 30 $(PTHREAD_CFLAGS)
31 31
32libtoxav_la_LDFLAGS = $(TOXAV_LT_LDFLAGS) \ 32libtoxav_la_LDFLAGS = $(LT_LDFLAGS) \
33 $(LIBSODIUM_LDFLAGS) \ 33 $(LIBSODIUM_LDFLAGS) \
34 $(NACL_LDFLAGS) \ 34 $(NACL_LDFLAGS) \
35 $(EXTRA_LT_LDFLAGS) \ 35 $(EXTRA_LT_LDFLAGS) \
@@ -41,4 +41,10 @@ libtoxav_la_LIBADD = libtoxcore.la \
41 $(PTHREAD_LIBS) \ 41 $(PTHREAD_LIBS) \
42 $(AV_LIBS) 42 $(AV_LIBS)
43 43
44if SET_SO_VERSION
45
46EXTRA_libtoxav_la_DEPENDENCIES = ../so.version
47
48endif
49
44endif 50endif
diff --git a/toxcore/Makefile.inc b/toxcore/Makefile.inc
index f30e6c06..f01a5d62 100644
--- a/toxcore/Makefile.inc
+++ b/toxcore/Makefile.inc
@@ -56,7 +56,7 @@ libtoxcore_la_CFLAGS = -I$(top_srcdir) \
56 $(NACL_CFLAGS) \ 56 $(NACL_CFLAGS) \
57 $(PTHREAD_CFLAGS) 57 $(PTHREAD_CFLAGS)
58 58
59libtoxcore_la_LDFLAGS = $(TOXCORE_LT_LDFLAGS) \ 59libtoxcore_la_LDFLAGS = $(LT_LDFLAGS) \
60 $(EXTRA_LT_LDFLAGS) \ 60 $(EXTRA_LT_LDFLAGS) \
61 $(LIBSODIUM_LDFLAGS) \ 61 $(LIBSODIUM_LDFLAGS) \
62 $(NACL_LDFLAGS) \ 62 $(NACL_LDFLAGS) \
@@ -68,3 +68,9 @@ libtoxcore_la_LIBADD = $(LIBSODIUM_LIBS) \
68 $(NACL_OBJECTS) \ 68 $(NACL_OBJECTS) \
69 $(NAC_LIBS) \ 69 $(NAC_LIBS) \
70 $(PTHREAD_LIBS) 70 $(PTHREAD_LIBS)
71
72if SET_SO_VERSION
73
74EXTRA_libtoxcore_la_DEPENDENCIES = ../so.version
75
76endif
diff --git a/toxdns/Makefile.inc b/toxdns/Makefile.inc
index 689a58a5..5b7c0123 100644
--- a/toxdns/Makefile.inc
+++ b/toxdns/Makefile.inc
@@ -14,7 +14,7 @@ libtoxdns_la_CFLAGS = -I$(top_srcdir) \
14 $(NACL_CFLAGS) \ 14 $(NACL_CFLAGS) \
15 $(PTHREAD_CFLAGS) 15 $(PTHREAD_CFLAGS)
16 16
17libtoxdns_la_LDFLAGS = $(TOXCORE_LT_LDFLAGS) \ 17libtoxdns_la_LDFLAGS = $(LT_LDFLAGS) \
18 $(EXTRA_LT_LDFLAGS) \ 18 $(EXTRA_LT_LDFLAGS) \
19 $(LIBSODIUM_LDFLAGS) \ 19 $(LIBSODIUM_LDFLAGS) \
20 $(NACL_LDFLAGS) \ 20 $(NACL_LDFLAGS) \
@@ -27,3 +27,9 @@ libtoxdns_la_LIBADD = $(LIBSODIUM_LIBS) \
27 $(NAC_LIBS) \ 27 $(NAC_LIBS) \
28 $(PTHREAD_LIBS) \ 28 $(PTHREAD_LIBS) \
29 libtoxcore.la 29 libtoxcore.la
30
31if SET_SO_VERSION
32
33EXTRA_libtoxdns_la_DEPENDENCIES = ../so.version
34
35endif
diff --git a/toxencryptsave/Makefile.inc b/toxencryptsave/Makefile.inc
index 56bc101d..bde026cd 100644
--- a/toxencryptsave/Makefile.inc
+++ b/toxencryptsave/Makefile.inc
@@ -34,7 +34,7 @@ libtoxencryptsave_la_CFLAGS = -I$(top_srcdir) \
34 $(NACL_CFLAGS) \ 34 $(NACL_CFLAGS) \
35 $(PTHREAD_CFLAGS) 35 $(PTHREAD_CFLAGS)
36 36
37libtoxencryptsave_la_LDFLAGS = $(TOXCORE_LT_LDFLAGS) \ 37libtoxencryptsave_la_LDFLAGS = $(LT_LDFLAGS) \
38 $(EXTRA_LT_LDFLAGS) \ 38 $(EXTRA_LT_LDFLAGS) \
39 $(LIBSODIUM_LDFLAGS) \ 39 $(LIBSODIUM_LDFLAGS) \
40 $(NACL_LDFLAGS) \ 40 $(NACL_LDFLAGS) \
@@ -47,3 +47,9 @@ libtoxencryptsave_la_LIBADD = $(LIBSODIUM_LIBS) \
47 $(NAC_LIBS) \ 47 $(NAC_LIBS) \
48 $(PTHREAD_LIBS) \ 48 $(PTHREAD_LIBS) \
49 libtoxcore.la 49 libtoxcore.la
50
51if SET_SO_VERSION
52
53EXTRA_libtoxencryptsave_la_DEPENDENCIES = ../so.version
54
55endif