-dnl Process this file with autoconf to produce a configure script.
-
-AC_PREREQ(2.57)
-AC_INIT([Evince],[2.25.4],[http://bugzilla.gnome.org/enter_bug.cgi?product=evince],[evince])
+# *****************************************************************************
+# Versioning
+# *****************************************************************************
+
+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])
+
+# The evince API version
+m4_define([ev_api_version], [2.25])
+
+# Libtool versioning. The backend and view libraries have separate versions.
+# Before making a release, the libtool version should be modified.
+# The string is of the form C:R:A.
+# - If interfaces have been changed or added, but binary compatibility has
+# been preserved, change to C+1:0:A+1
+# - If binary compatibility has been broken (eg removed or changed interfaces)
+# change to C+1:0:0
+# - If the interface is the same as the previous version, change to C:R+1:A
+
+# Libtool version of the backend library
+m4_define([ev_backend_lt_current],[1])
+m4_define([ev_backend_lt_revision],[0])
+m4_define([ev_backend_lt_age],[0])
+m4_define([ev_backend_lt_version_info],[ev_backend_lt_current:ev_backend_lt_revision:ev_backend_lt_age])
+m4_define([ev_backend_lt_current_minus_age],[m4_eval(ev_backend_lt_current - ev_backend_lt_age)])
+
+# Libtool version of the view library
+m4_define([ev_view_lt_current],[1])
+m4_define([ev_view_lt_revision],[0])
+m4_define([ev_view_lt_age],[0])
+m4_define([ev_view_lt_version_info],[ev_view_lt_current:ev_view_lt_revision:ev_view_lt_age])
+m4_define([ev_view_lt_current_minus_age],[m4_eval(ev_view_lt_current - ev_view_lt_age)])
+
+# *****************************************************************************
+
+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.20
-AC_SUBST(EV_API_VERSION)
-
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
GTK_REQUIRED=2.12.0
GLIB_REQUIRED=2.18.0
KEYRING_REQUIRED=2.22.0
+AC_SUBST([GLIB_REQUIRED])
+AC_SUBST([GTK_REQUIRED])
GNOME_ICON_THEME_REQUIRED=2.17.1
LIBXML_REQUIRED=2.5.0
-PKG_CHECK_MODULES(LIB, gtk+-2.0 >= $GTK_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED gio-2.0 >= $GLIB_REQUIRED)
+PKG_CHECK_MODULES(LIBDOCUMENT, gtk+-2.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED)
+PKG_CHECK_MODULES(LIBVIEW, gtk+-2.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
PKG_CHECK_MODULES(BACKEND, gtk+-2.0 >= $GTK_REQUIRED)
PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED gtk+-unix-print-2.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED gthread-2.0 gconf-2.0)
fi
-LIB_CFLAGS="$LIB_CFLAGS $DEBUG_FLAGS"
-LIB_LIBS="$LIB_LIBS"
-AC_SUBST(LIB_CFLAGS)
-AC_SUBST(LIB_LIBS)
+LIBDOCUMENT_CFLAGS="$LIBDOCUMENT_CFLAGS $DEBUG_FLAGS"
+LIBDOCUMENT_LIBS="$LIBDOCUMENT_LIBS"
+AC_SUBST(LIBDOCUMENT_CFLAGS)
+AC_SUBST(LIBDOCUMENT_LIBS)
+
+LIBVIEW_CFLAGS="$LIBVIEW_CFLAGS $DEBUG_FLAGS"
+LIBVIEW_LIBS="$LIBVIEW_LIBS"
+AC_SUBST(LIBVIEW_CFLAGS)
+AC_SUBST(LIBVIEW_LIBS)
BACKEND_CFLAGS="$BACKEND_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG_FLAGS"
AC_SUBST(BACKEND_CFLAGS)
fi
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]))
+
+# 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_API_VERSION],[ev_api_version])
+
+AC_SUBST([EV_BACKEND_LT_VERSION_INFO],[ev_backend_lt_version_info])
+AC_SUBST([EV_BACKEND_LT_CURRENT_MINUS_AGE],[ev_backend_lt_current_minus_age])
+AC_SUBST([EV_VIEW_LT_VERSION_INFO],[ev_view_lt_version_info])
+AC_SUBST([EV_VIEW_LT_CURRENT_MINUS_AGE],[ev_view_lt_current_minus_age])
+
+# *****************************************************************************
+
AC_CONFIG_FILES([
backend/Makefile
backend/comics/Makefile
help/reference/Makefile
help/reference/version.xml
libdocument/Makefile
+libdocument/ev-version.h
+libview/Makefile
Makefile
po/Makefile.in
properties/Makefile
thumbnailer/Makefile
])
+AC_CONFIG_FILES(evince-backend-[]ev_api_version[].pc:evince-backend.pc.in)
+AC_CONFIG_FILES(evince-view-[]ev_api_version[].pc:evince-view.pc.in)
+
AC_OUTPUT
echo "