diff options
author | Sergey 'Jin' Bostandzhyan <jin at mediatomb dot cc> | 2017-01-11 22:41:11 +0100 |
---|---|---|
committer | Sergey 'Jin' Bostandzhyan <jin at mediatomb dot cc> | 2017-01-18 11:20:07 +0100 |
commit | 3f24f048762736e1a5d785a080fec7e84172e708 (patch) | |
tree | 3a0a66087a0d0d97bc19c6f4ee379f923f4ab9e8 | |
parent | 5ad3c9890574cfe91a856e4836a553973b7da1a9 (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.am | 1 | ||||
-rw-r--r-- | build/Makefile.am | 12 | ||||
-rw-r--r-- | configure.ac | 23 | ||||
-rw-r--r-- | so.version | 16 | ||||
-rw-r--r-- | toxav/Makefile.inc | 8 | ||||
-rw-r--r-- | toxcore/Makefile.inc | 8 | ||||
-rw-r--r-- | toxdns/Makefile.inc | 8 | ||||
-rw-r--r-- | toxencryptsave/Makefile.inc | 8 |
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 = | |||
4 | noinst_bindir = $(top_builddir)/build | 4 | noinst_bindir = $(top_builddir)/build |
5 | EXTRA_DIST= | 5 | EXTRA_DIST= |
6 | 6 | ||
7 | if SET_SO_VERSION | ||
8 | |||
9 | include ../so.version | ||
10 | |||
11 | LT_LDFLAGS=-version-info $(CURRENT):$(REVISION):$(AGE) | ||
12 | |||
13 | else | ||
14 | |||
15 | LT_LDFLAGS=-avoid-version | ||
16 | |||
17 | endif | ||
18 | |||
7 | include ../toxcore/Makefile.inc | 19 | include ../toxcore/Makefile.inc |
8 | include ../toxdns/Makefile.inc | 20 | include ../toxdns/Makefile.inc |
9 | include ../toxencryptsave/Makefile.inc | 21 | include ../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 | ||
13 | EXTRA_LT_LDFLAGS= | 13 | EXTRA_LT_LDFLAGS= |
14 | 14 | ||
15 | LIBTOXCORE_LT_VERSION=0:0:0 | ||
16 | dnl | ||
17 | dnl current:revision:age | ||
18 | dnl | ||
19 | dnl current: increment if interfaces have been added, removed or changed | ||
20 | dnl revision: increment if source code has changed, set to zero if current is | ||
21 | dnl incremented | ||
22 | dnl age: increment if interfaces have been added, set to zero if | ||
23 | dnl interfaces have been removed or changed | ||
24 | |||
25 | if test "x${prefix}" = "xNONE"; then | 15 | if test "x${prefix}" = "xNONE"; then |
26 | prefix="${ac_default_prefix}" | 16 | prefix="${ac_default_prefix}" |
27 | fi | 17 | fi |
@@ -40,22 +30,19 @@ LIBCONFIG_FOUND="no" | |||
40 | LIBCHECK_FOUND="no" | 30 | LIBCHECK_FOUND="no" |
41 | WANT_NACL="no" | 31 | WANT_NACL="no" |
42 | ADD_NACL_OBJECTS_TO_PKGCONFIG="yes" | 32 | ADD_NACL_OBJECTS_TO_PKGCONFIG="yes" |
43 | 33 | SET_SO_VERSION="yes" | |
44 | TOXCORE_LT_LDFLAGS="-version-info $LIBTOXCORE_LT_VERSION" | ||
45 | TOXAV_LT_LDFLAGS="-version-info $LIBTOXCORE_LT_VERSION" | ||
46 | 34 | ||
47 | AC_ARG_ENABLE([soname-versions], | 35 | AC_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 | 45 | AM_CONDITIONAL(SET_SO_VERSION, test "x$SET_SO_VERSION" = "xyes") | |
57 | AC_SUBST(TOXCORE_LT_LDFLAGS) | ||
58 | AC_SUBST(TOXAV_LT_LDFLAGS) | ||
59 | 46 | ||
60 | AC_ARG_ENABLE([nacl], | 47 | AC_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 | |||
14 | CURRENT=5 | ||
15 | REVISION=0 | ||
16 | AGE=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 | ||
32 | libtoxav_la_LDFLAGS = $(TOXAV_LT_LDFLAGS) \ | 32 | libtoxav_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 | ||
44 | if SET_SO_VERSION | ||
45 | |||
46 | EXTRA_libtoxav_la_DEPENDENCIES = ../so.version | ||
47 | |||
48 | endif | ||
49 | |||
44 | endif | 50 | endif |
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 | ||
59 | libtoxcore_la_LDFLAGS = $(TOXCORE_LT_LDFLAGS) \ | 59 | libtoxcore_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 | |||
72 | if SET_SO_VERSION | ||
73 | |||
74 | EXTRA_libtoxcore_la_DEPENDENCIES = ../so.version | ||
75 | |||
76 | endif | ||
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 | ||
17 | libtoxdns_la_LDFLAGS = $(TOXCORE_LT_LDFLAGS) \ | 17 | libtoxdns_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 | |||
31 | if SET_SO_VERSION | ||
32 | |||
33 | EXTRA_libtoxdns_la_DEPENDENCIES = ../so.version | ||
34 | |||
35 | endif | ||
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 | ||
37 | libtoxencryptsave_la_LDFLAGS = $(TOXCORE_LT_LDFLAGS) \ | 37 | libtoxencryptsave_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 | |||
51 | if SET_SO_VERSION | ||
52 | |||
53 | EXTRA_libtoxencryptsave_la_DEPENDENCIES = ../so.version | ||
54 | |||
55 | endif | ||