cairo/build/configure.ac.version
Behdad Esfahbod 567be443a2 [configure.ac] Make sure version information do not end up in config.h
By introducing $(top_srcdir)/cairo-version.h I tried to make it
unnecessary to rebuild the entire library when the version changes.
That comes handy around releases and when bisecting.

However this was not working as the version info was also ending
up in config.h and hence forcing a full rebuild upon change.
I now undefine the PACKAGE_VERSION* macros that autoconf defines,
so config.h does not change when cairo-version.h changes.
2008-09-18 16:27:02 -04:00

50 lines
1.9 KiB
Text

dnl
dnl Version stuff
dnl
dnl This macro expands to one of 'git', 'snapshot', or 'release'
m4_define([cairo_release_status],
[m4_if(m4_eval(cairo_version_micro % 2), [1], [git],
[m4_if(m4_eval(cairo_version_minor % 2), [1], [snapshot],
[release])])])
dnl This is the .so/dll number. 2 for cairo-1.x.x
m4_define([cairo_version_sonum], m4_eval(cairo_version_major + 1))
dnl The libtool shared library version stuff
m4_define([cairo_version],
m4_eval(cairo_version_major*10000 + cairo_version_minor*100 + cairo_version_micro))
m4_if(m4_eval(cairo_version_minor % 2), [1],
[
dnl for unstable releases
m4_define([cairo_libtool_revision], 0)
],
[
dnl for stable releases
m4_define([cairo_libtool_revision], cairo_version_micro)
])
m4_define([cairo_libtool_current],
m4_eval(cairo_version_sonum + cairo_version - cairo_libtool_revision))
m4_define([cairo_libtool_age],
m4_eval(cairo_libtool_current - cairo_version_sonum))
CAIRO_VERSION_MAJOR=cairo_version_major
CAIRO_VERSION_MINOR=cairo_version_minor
CAIRO_VERSION_MICRO=cairo_version_micro
CAIRO_VERSION_SONUM=cairo_version_sonum
CAIRO_RELEASE_STATUS=cairo_release_status
CAIRO_LIBTOOL_VERSION_INFO=cairo_libtool_current:cairo_libtool_revision:cairo_libtool_age
AC_SUBST(CAIRO_VERSION_MAJOR)
AC_SUBST(CAIRO_VERSION_MINOR)
AC_SUBST(CAIRO_VERSION_MICRO)
AC_SUBST(CAIRO_VERSION_SONUM)
AC_SUBST(CAIRO_RELEASE_STATUS)
AC_SUBST(CAIRO_LIBTOOL_VERSION_INFO)
dnl Disable autoconf's version macros. We try hard to not rebuild the entire
dnl library just because version changed. The PACKAGE_VERSION* stuff in
dnl config.h is negating all the effort.
AC_DEFINE(PACKAGE_VERSION, [USE_cairo_version_OR_cairo_version_string_INSTEAD])
AC_DEFINE(PACKAGE_STRING, [USE_cairo_version_OR_cairo_version_string_INSTEAD])
AC_DEFINE(PACKAGE_NAME, [USE_cairo_INSTEAD])
AC_DEFINE(PACKAGE_TARNAME, [USE_cairo_INSTEAD])