198f395dae106e5064ba01b9d0aefa8dc6ea75f4
diff --git a/configure.ac b/configure.ac
index 492e01b..f0bd4d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,17 +1,34 @@
 dnl Process this file with autoconf to produce a configure script.
 
-m4_define([ev_version_major],[2])
-m4_define([ev_version_minor],[25])
-m4_define([ev_version_micro],[5])
-m4_define([ev_version_extra],[])
-m4_define([ev_version],[ev_version_major.ev_version_minor.ev_version_micro()ev_version_extra])
+m4_define([ev_major_version],[2])
+m4_define([ev_minor_version],[25])
+m4_define([ev_micro_version],[5])
+m4_define([ev_extra_version],[])
+m4_define([ev_version],[ev_major_version.ev_minor_version.ev_micro_version()ev_extra_version])
+
+# Making releases:
+#   EV_MICRO_VERSION += 1;
+#   EV_INTERFACE_AGE += 1;
+#   EV_BINARY_AGE += 1;
+# if any functions have been added, set EV_INTERFACE_AGE to 0.
+# if backwards compatibility has been broken,
+# set EV_BINARY_AGE and EV_INTERFACE_AGE to 0.
+
+m4_define([ev_interface_age], [0])
+m4_define([ev_binary_age], [m4_eval(100 * ev_minor_version + ev_micro_version)])
+
+m4_define([lt_current], [m4_eval(100 * ev_minor_version + ev_micro_version - ev_interface_age)])
+m4_define([lt_revision], [ev_interface_age])
+m4_define([lt_age], [m4_eval(ev_binary_age - ev_interface_age)])
+
+# The evince API version
+m4_define([ev_api_version], [2.0])
 
 AC_PREREQ(2.57)
 AC_INIT([Evince],[ev_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=evince],[evince])
 AM_INIT_AUTOMAKE([1.9 dist-bzip2 no-dist-gzip])
 
-EV_API_VERSION=2.25
-AC_SUBST(EV_API_VERSION)
+AC_SUBST([EV_API_VERSION],[ev_api_version])
 
 AM_CONFIG_HEADER(config.h)
 
@@ -419,9 +436,15 @@ AC_SUBST(EVINCE_MIME_TYPES)
 
 AC_CHECK_FUNC(localtime_r, AC_DEFINE(HAVE_LOCALTIME_R, 1, [Defines if localtime_r is available on your system]))
 
-AC_SUBST([EV_VERSION_MAJOR],[ev_version_major])
-AC_SUBST([EV_VERSION_MINOR],[ev_version_minor])
-AC_SUBST([EV_VERSION_MICRO],[ev_version_micro])
+# Versioning
+
+AC_SUBST([EV_MAJOR_VERSION],[ev_major_version])
+AC_SUBST([EV_MINOR_VERSION],[ev_minor_version])
+AC_SUBST([EV_MICRO_VERSION],[ev_micro_version])
+AC_SUBST([EV_LT_VERSION_INFO],[lt_current:lt_revision:lt_age])
+AC_SUBST([EV_LT_CURRENT_MINUS_AGE],[m4_eval(lt_current - lt_age)])
+
+# *****************************************************************************
 
 AC_CONFIG_FILES([
 evince.pc
diff --git a/libdocument/Makefile.am b/libdocument/Makefile.am
index b3adea9..cf8c40b 100644
--- a/libdocument/Makefile.am
+++ b/libdocument/Makefile.am
@@ -9,6 +9,11 @@ INCLUDES=						\
 
 lib_LTLIBRARIES = libevbackend.la
 
+libevbackend_la_LDFLAGS = \
+	-version-info $(EV_LT_VERSION_INFO)	\
+	-export-symbols-regex "^ev_*"	\
+	$(AM_LDFLAGS)
+
 libevbackend_la_LIBADD = $(LIBDOCUMENT_LIBS)
 
 NOINST_H_FILES =				\
diff --git a/libdocument/ev-version.h.in b/libdocument/ev-version.h.in
index 6613559..2601622 100644
--- a/libdocument/ev-version.h.in
+++ b/libdocument/ev-version.h.in
@@ -19,13 +19,13 @@
 #ifndef EV_VERSION_H
 #define EV_VERSION_H
 
-#define EV_VERSION_MAJOR (@EV_VERSION_MAJOR@)
-#define EV_VERSION_MINOR (@EV_VERSION_MINOR@)
-#define EV_VERSION_MICRO (@EV_VERSION_MICRO@)
+#define EV_MAJOR_VERSION (@EV_MAJOR_VERSION@)
+#define EV_MINOR_VERSION (@EV_MINOR_VERSION@)
+#define EV_MICRO_VERSION (@EV_MICRO_VERSION@)
 
 #define EV_CHECK_VERSION(major,minor,micro) \
-  (EV_VERSION_MAJOR > (major) || \
-   (EV_VERSION_MAJOR == (major) && EV_VERSION_MINOR > (minor)) || \
-   (EV_VERSION_MAJOR == (major) && EV_VERSION_MINOR == (minor) && EV_VERSION_MICRO >= (micro)))
+  (EV_MAJOR_VERSION > (major) || \
+   (EV_MAJOR_VERSION == (major) && EV_MINOR_VERSION > (minor)) || \
+   (EV_MAJOR_VERSION == (major) && EV_MINOR_VERSION == (minor) && EV_MICRO_VERSION >= (micro)))
 
 #endif /* #ifndef EV_VERSION_H */
diff --git a/libview/Makefile.am b/libview/Makefile.am
index 2f8e9a9..1fa3d1b 100644
--- a/libview/Makefile.am
+++ b/libview/Makefile.am
@@ -8,6 +8,11 @@ INCLUDES=					\
 
 lib_LTLIBRARIES = libevview.la
 
+libevview_la_LDFLAGS = \
+	-version-info $(EV_LT_VERSION_INFO)	\
+	-export-symbols-regex "^ev_*"	\
+	$(AM_LDFLAGS)
+
 libevview_la_LIBADD = $(LIBVIEW_LIBS)
 
 NOINST_H_FILES =			\
