5 dnl This macro expands to one of 'git', 'snapshot', or 'release'
6 m4_define([cairo_release_status],
7 [m4_if(m4_eval(cairo_version_micro % 2), [1], [git],
8 [m4_if(m4_eval(cairo_version_minor % 2), [1], [snapshot],
11 dnl This is the .so/dll number. 2 for cairo-1.x.x
12 m4_define([cairo_version_sonum], m4_eval(cairo_version_major + 1))
14 dnl The libtool shared library version stuff
15 m4_define([cairo_version],
16 m4_eval(cairo_version_major*10000 + cairo_version_minor*100 + cairo_version_micro))
17 m4_if(m4_eval(cairo_version_minor % 2), [1],
19 dnl for unstable releases
20 m4_define([cairo_libtool_revision], 0)
23 dnl for stable releases
24 m4_define([cairo_libtool_revision], cairo_version_micro)
26 m4_define([cairo_libtool_current],
27 m4_eval(cairo_version_sonum + cairo_version - cairo_libtool_revision))
28 m4_define([cairo_libtool_age],
29 m4_eval(cairo_libtool_current - cairo_version_sonum))
31 CAIRO_VERSION_MAJOR=cairo_version_major
32 CAIRO_VERSION_MINOR=cairo_version_minor
33 CAIRO_VERSION_MICRO=cairo_version_micro
34 CAIRO_VERSION_SONUM=cairo_version_sonum
35 CAIRO_RELEASE_STATUS=cairo_release_status
36 CAIRO_LIBTOOL_VERSION_INFO=cairo_libtool_current:cairo_libtool_revision:cairo_libtool_age
37 AC_SUBST(CAIRO_VERSION_MAJOR)
38 AC_SUBST(CAIRO_VERSION_MINOR)
39 AC_SUBST(CAIRO_VERSION_MICRO)
40 AC_SUBST(CAIRO_VERSION_SONUM)
41 AC_SUBST(CAIRO_RELEASE_STATUS)
42 AC_SUBST(CAIRO_LIBTOOL_VERSION_INFO)
44 dnl Disable autoconf's version macros. We try hard to not rebuild the entire
45 dnl library just because version changed. The PACKAGE_VERSION* stuff in
46 dnl config.h is negating all the effort.
47 AC_DEFINE(PACKAGE_VERSION, [USE_cairo_version_OR_cairo_version_string_INSTEAD])
48 AC_DEFINE(PACKAGE_STRING, [USE_cairo_version_OR_cairo_version_string_INSTEAD])
49 AC_DEFINE(PACKAGE_NAME, [USE_cairo_INSTEAD])
50 AC_DEFINE(PACKAGE_TARNAME, [USE_cairo_INSTEAD])